[PATCH 2/3] iio: dummy: convert events to device-managed handlers

2020-12-03 Thread Alexandru Ardelean
, and so can it's usage/call. Signed-off-by: Alexandru Ardelean --- drivers/iio/dummy/iio_simple_dummy.c| 8 +--- drivers/iio/dummy/iio_simple_dummy.h| 9 +--- drivers/iio/dummy/iio_simple_dummy_events.c | 53 + 3 files changed, 26 insertions(+), 44 deletions

[PATCH] net: phy: adin: add signal mean square error registers to phy-stats

2020-12-03 Thread Alexandru Ardelean
. This change implements support for these registers using the PHY statistics mechanism. Signed-off-by: Alexandru Ardelean --- drivers/net/phy/adin.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/adin.c b/drivers/net/phy/adin.c index 55a0b91816e2

[RESEND PATCH 2/2] clk: axi-clkgen: move the OF table at the bottom of the file

2020-12-02 Thread Alexandru Ardelean
The change is mostly cosmetic. No functional changes. Since the driver now uses of_device_get_match_data() to obtain some driver specific info, there is no need to define the OF table before the probe function. Signed-off-by: Alexandru Ardelean --- drivers/clk/clk-axi-clkgen.c | 18

[RESEND PATCH 1/2] clk: axi-clkgen: wrap limits in a struct and keep copy on the state object

2020-12-02 Thread Alexandru Ardelean
-tree OF table, so that we can adjust them via the compatible string. Signed-off-by: Alexandru Ardelean --- Initial send: https://lore.kernel.org/linux-clk/20201019111809.56374-1-alexandru.ardel...@analog.com/ drivers/clk/clk-axi-clkgen.c | 48 +++- 1 file

[PATCH] iio: adc: ti_am335x_adc: remove omitted iio_kfifo_free()

2020-12-02 Thread Alexandru Ardelean
When the conversion was done to use devm_iio_kfifo_allocate(), a call to iio_kfifo_free() was omitted (to be removed). This change removes it. Fixes: 3c5308058899 ("iio: adc: ti_am335x_adc: alloc kfifo & IRQ via devm_ functions") Signed-off-by: Alexandru Ardelean --- Seems I was

Re: [PATCH 1/2] clk: axi-clkgen: wrap limits in a struct and keep copy on the state object

2020-12-02 Thread Alexandru Ardelean
On Mon, Oct 19, 2020 at 2:14 PM Alexandru Ardelean wrote: > > Up until now the these limits were global/hard-coded, since they are > typically limits of the fabric. > > However, since this is an FPGA generated clock, this may run on setups > where one clock is on a fabri

[PATCH v3 3/3] spi: dt-bindings: document zero value for spi-{rx,tx}-bus-width properties

2020-11-27 Thread Alexandru Ardelean
Following a change to the SPI framework, providing a value of zero for 'spi-rx-bus-width' and 'spi-tx-bus-width' is now possible and will essentially mean than no RX or TX is allowed. Signed-off-by: Alexandru Ardelean --- Documentation/devicetree/bindings/spi/spi-controller.yaml | 6 -- 1

[PATCH v3 1/3] spi: uapi: unify SPI modes into a single spi.h header

2020-11-27 Thread Alexandru Ardelean
; no conversions to BIT() macros are being done at this point. This can be done later, as that requires also another header inclusion (the 'const.h' header). The change as-is makes this 'spi.h' header more standalone. Signed-off-by: Alexandru Ardelean --- Personally, I am not sure whether to convert

[PATCH v3 2/3] spi: Add SPI_NO_TX/RX support

2020-11-27 Thread Alexandru Ardelean
of these two lines is missing and to adjust the transfers accordingly. Signed-off-by: Dragos Bogdan Signed-off-by: Alexandru Ardelean --- drivers/spi/spi.c| 26 +- include/uapi/linux/spi/spi.h | 2 ++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git

Re: [PATCH v2 1/4] iio: adc: ad7887: convert dual-channel mode to DT/ACPI

2020-11-27 Thread Alexandru Ardelean
On Sat, Nov 21, 2020 at 5:38 PM Jonathan Cameron wrote: > > On Thu, 19 Nov 2020 12:07:45 +0200 > Alexandru Ardelean wrote: > > > This change converts the configuration of the dual-channel mode from the > > old platform-data, to the device_property_present() function,

[PATCH v3 2/4] Input: adp5589-keys - wrap device probing into chip info struct

2020-11-27 Thread Alexandru Ardelean
This change wraps the devices supported by the adp5589 driver into a chip info struct. With this, a device table can be created, and the probed device can be selected based on the enum value provided by the i2c driver data. Signed-off-by: Alexandru Ardelean --- drivers/input/keyboard/adp5589

[PATCH v3 3/4] Input: adp5589-keys - add basic devicetree support

2020-11-27 Thread Alexandru Ardelean
From: Lars-Peter Clausen Add very basic devicetree suppport to the adp5589 allowing the device to be registered from devicetree and ACPI via PRP0001. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/input/keyboard/adp5589-keys.c | 30

[PATCH v3 4/4] dt-bindings: add ADP5585/ADP5589 entries to trivial-devices

2020-11-27 Thread Alexandru Ardelean
This change adds the device-tree entries for the Analog Devices ADP5585 and ADP5589 devices to the trivial devices list. Signed-off-by: Alexandru Ardelean --- Documentation/devicetree/bindings/trivial-devices.yaml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation

[PATCH v3 1/4] Input: adp5589-keys - add default platform data

2020-11-27 Thread Alexandru Ardelean
. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- Changelog v2 - v3: * https://lore.kernel.org/linux-input/20201124082255.13427-1-alexandru.ardel...@analog.com/ * added patch 'dt-bindings: add ADP5585/ADP5589 entries to trivial-devices' drivers/input/keyboard/adp5589

[PATCH 1/2] iio: adc: ad7298: convert probe to device-managed functions

2020-11-27 Thread Alexandru Ardelean
data()) call that need it. Cc: Colin Ian King Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/ad7298.c | 46 +--- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/drivers/iio/adc/ad7298.c b/drivers/iio/adc/ad7298.c index fa1047f74a1f..ecdb01bd

[PATCH 2/2] iio: adc: ad7298: check regulator for null in ad7298_get_ref_voltage()

2020-11-27 Thread Alexandru Ardelean
'st->ext_ref' & 'st->reg' are both non-zero/non-null at the same time, so logically the code isn't broken. But it is more correct to check that 'st->reg' is non-null, since we make sure that the regulator is NULL (in probe) in case one isn't defined. Cc: Colin Ian King Signed-off-

[PATCH v3] iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack

2020-11-24 Thread Alexandru Ardelean
") Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/ad_sigma_delta.c | 18 -- include/linux/iio/adc/ad_sigma_delta.h | 6 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/iio/adc/ad_sigma_delta.c b/d

[PATCH v2 2/3] spi: Add SPI_NO_TX/RX support

2020-11-24 Thread Alexandru Ardelean
of these two lines is missing and to adjust the transfers accordingly. Signed-off-by: Dragos Bogdan Signed-off-by: Alexandru Ardelean --- Changelog v1 -> v2: * https://lore.kernel.org/linux-spi/2020141529.98147-1-alexandru.ardel...@analog.com/ * convert comment to new multi-line format driv

[PATCH v2 1/3] spi: convert to BIT() all spi_device flags

2020-11-24 Thread Alexandru Ardelean
This change converts all bit flags for the 'struct spi_device' mode to the BIT() macro. The change is mostly for readability. Since adding more bit fields, might as well convert it now. Signed-off-by: Alexandru Ardelean --- Changelog v1 -> v2: * https://lore.kernel.org/linux-

[PATCH v2 3/3] spi: dt-bindings: document zero value for spi-{rx,tx}-bus-width properties

2020-11-24 Thread Alexandru Ardelean
Following a change to the SPI framework, providing a value of zero for 'spi-rx-bus-width' and 'spi-tx-bus-width' is now possible and will essentially mean than no RX or TX is allowed. Signed-off-by: Alexandru Ardelean --- Changelog v1 -> v2: * https://lore.kernel.org/linux-

[PATCH v2 3/3] Input: adp5589-keys - add basic devicetree support

2020-11-24 Thread Alexandru Ardelean
From: Lars-Peter Clausen Add very basic devicetree suppport to the adp5589 allowing the device to be registered from devicetree and ACPI via PRP0001. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/input/keyboard/adp5589-keys.c | 30

[PATCH v2 2/3] Input: adp5589-keys - wrap device probing into chip info struct

2020-11-24 Thread Alexandru Ardelean
This change wraps the devices supported by the adp5589 driver into a chip info struct. With this, a device table can be created, and the probed device can be selected based on the enum value provided by the i2c driver data. Signed-off-by: Alexandru Ardelean --- drivers/input/keyboard/adp5589

[PATCH v2 1/3] Input: adp5589-keys - add default platform data

2020-11-24 Thread Alexandru Ardelean
. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- Changelog v1 -> v2: * rebased on newer input/next tree; a conflict appeared for this patchset https://lore.kernel.org/r/20201119072440.GA116840@dtor-ws drivers/input/keyboard/adp5589-keys.c |

[PATCH 1/2] iio: cros_ec: do an early exit if not physical_device case

2020-11-23 Thread Alexandru Ardelean
This whole code-block was put under one big if() condition/block. This change does an early return if the 'physical_device' boolean is false, thus unindenting the block by one level. No other functional change has been done. Signed-off-by: Alexandru Ardelean --- .../cros_ec_sensors

[PATCH 2/2] iio: cros_ec: un-indent block that configures motion sensor fifo

2020-11-23 Thread Alexandru Ardelean
) is smaller. The code block for the EC_FEATURE_MOTION_SENSE_FIFO flag has been un-indented. Signed-off-by: Alexandru Ardelean --- .../cros_ec_sensors/cros_ec_sensors_core.c| 63 +-- 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/drivers/iio/common

[PATCH v2] uio/uio_pci_generic: remove unneeded pci_set_drvdata()

2020-11-23 Thread Alexandru Ardelean
o retrieve the information. This change removes it. Fixes: ef84928cff58 ("io/uio_pci_generic: use device-managed function equivalents") Signed-off-by: Alexandru Ardelean --- drivers/uio/uio_pci_generic.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/uio/uio_pci

Re: [RFC PATCH 11/12] iio: buffer: introduce support for attaching more IIO buffers

2020-11-23 Thread Alexandru Ardelean
On Sat, Nov 21, 2020 at 8:46 PM Jonathan Cameron wrote: > > On Tue, 17 Nov 2020 18:23:39 +0200 > Alexandru Ardelean wrote: > > > With this change, calling iio_device_attach_buffer() will actually attach > > more buffers. > > Right now this doesn't do any

Re: [RFC PATCH 00/12] iio: core,buffer: add support for multiple IIO buffers per IIO device

2020-11-23 Thread Alexandru Ardelean
On Sat, Nov 21, 2020 at 8:53 PM Jonathan Cameron wrote: > > On Tue, 17 Nov 2020 18:23:28 +0200 > Alexandru Ardelean wrote: > > > Continuing from: > > https://lore.kernel.org/linux-iio/20200517144023.6c5cb169@archlinux/ > > > > This is a V2 of the ini

Re: [RFC PATCH 12/12] iio: buffer: add ioctl() to support opening extra buffers for IIO device

2020-11-23 Thread Alexandru Ardelean
On Sat, Nov 21, 2020 at 8:53 PM Jonathan Cameron wrote: > > On Tue, 17 Nov 2020 18:23:40 +0200 > Alexandru Ardelean wrote: > > > With this change, an ioctl() call is added to open a character device for a > > buffer. > > The ioctl() will not work for the first buf

Re: [RFC PATCH 06/12] iio: buffer: re-route scan_elements via it's kobj_type

2020-11-23 Thread Alexandru Ardelean
On Sat, Nov 21, 2020 at 8:34 PM Jonathan Cameron wrote: > > On Tue, 17 Nov 2020 18:23:34 +0200 > Alexandru Ardelean wrote: > > > The scan_elements attributes are solely located inside > > 'industrialio-buffer-sysfs.c'. In order to support more than one buffer per

Re: [RFC PATCH 03/12] iio: buffer: rework buffer & scan_elements dir creation

2020-11-23 Thread Alexandru Ardelean
On Sat, Nov 21, 2020 at 8:25 PM Jonathan Cameron wrote: > > On Tue, 17 Nov 2020 18:23:31 +0200 > Alexandru Ardelean wrote: > > > When adding more than one IIO buffer per IIO device, we will need to create > > a buffer & scan_elements directory for each buff

Re: [RFC PATCH 01/12] iio: core: register chardev only if needed

2020-11-23 Thread Alexandru Ardelean
On Sat, Nov 21, 2020 at 8:05 PM Jonathan Cameron wrote: > > On Tue, 17 Nov 2020 18:23:29 +0200 > Alexandru Ardelean wrote: > > > We only need a chardev if we need to support buffers and/or events. > > > > With this change, a chardev will be created only if

Re: [Cocci] Proposal for a new checkpatch check; matching _set_drvdata() & _get_drvdata()

2020-11-20 Thread Alexandru Ardelean
On Fri, Nov 20, 2020 at 3:16 PM Lars-Peter Clausen wrote: > > On 11/20/20 12:54 PM, Alexandru Ardelean wrote: > > On Fri, Nov 20, 2020 at 12:47 PM Julia Lawall wrote: > >> > >> > >> On Thu, 19 Nov 2020, Joe Perches wrote: > >> > >>&

Re: [Cocci] Proposal for a new checkpatch check; matching _set_drvdata() & _get_drvdata()

2020-11-20 Thread Alexandru Ardelean
On Fri, Nov 20, 2020 at 1:57 PM Julia Lawall wrote: > > > > On Fri, 20 Nov 2020, Alexandru Ardelean wrote: > > > On Fri, Nov 20, 2020 at 12:47 PM Julia Lawall wrote: > > > > > > > > > > > > On Thu, 19 Nov 2020, Joe Perches wrote: > &g

Re: [Cocci] Proposal for a new checkpatch check; matching _set_drvdata() & _get_drvdata()

2020-11-20 Thread Alexandru Ardelean
On Fri, Nov 20, 2020 at 12:47 PM Julia Lawall wrote: > > > > On Thu, 19 Nov 2020, Joe Perches wrote: > > > On Thu, 2020-11-19 at 17:16 +0200, Andy Shevchenko wrote: > > > On Thu, Nov 19, 2020 at 4:09 PM Alexandru Ardelean > > > wrote: > > > > &

[PATCH 2/3] uio: uio_mf624: use devm_kzalloc() for uio_info object

2020-11-20 Thread Alexandru Ardelean
This change uses the devm_kzalloc() function to tie the life-time of the uio_info object to PCI device. This cleans up the exit & error path a bit. Signed-off-by: Alexandru Ardelean --- drivers/uio/uio_mf624.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dri

[PATCH 3/3] uio: uio_netx: use devm_kzalloc() for or uio_info object

2020-11-20 Thread Alexandru Ardelean
This change uses the devm_kzalloc() function to tie the life-time of the uio_info object to PCI device. This cleans up the exit & error path a bit. Signed-off-by: Alexandru Ardelean --- drivers/uio/uio_netx.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dri

[PATCH 1/3] uio: uio_sercos3: use device-managed functions for simple allocs

2020-11-20 Thread Alexandru Ardelean
. Signed-off-by: Alexandru Ardelean --- drivers/uio/uio_sercos3.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/uio/uio_sercos3.c b/drivers/uio/uio_sercos3.c index 9658a0887fee..b93a5f8f4cba 100644 --- a/drivers/uio/uio_sercos3.c +++ b/drivers/uio

[PATCH 1/2] uio: uio_dmem_genirq: convert simple allocations to device-managed

2020-11-19 Thread Alexandru Ardelean
This change converts the simple allocations in the driver to used device-managed allocation functions. This removes the error path entirely in the probe function, and reduces some code in the remove function. Signed-off-by: Alexandru Ardelean --- drivers/uio/uio_dmem_genirq.c | 34

[PATCH 2/2] uio: uio_dmem_genirq: finalize conversion of probe to devm_ handlers

2020-11-19 Thread Alexandru Ardelean
This moves move pm_runtime_disable on a devm_add_action_or_reset() handler. And with the use of the devm_uio_register_device() function, the remove hook is no longer required. Signed-off-by: Alexandru Ardelean --- drivers/uio/uio_dmem_genirq.c | 28 ++-- 1 file changed

[PATCH 4/4] uio: uio_hv_generic: use devm_kzalloc() for private data alloc

2020-11-19 Thread Alexandru Ardelean
This is a minor cleanup for the management of the private object of this driver. The allocation can be tied to the life-time of the hv_device object. This cleans up a bit the exit & error paths, since the object doesn't need to be explicitly free'd anymore. Signed-off-by: Alexandru Arde

[PATCH 1/4] uio: uio_cif: use devm_kzalloc() for uio_info object

2020-11-19 Thread Alexandru Ardelean
The uio_info object is free'd last, so it's life-time is tied PCI device object. Using devm_kzalloc() cleans up the error path a bit and the exit path. Signed-off-by: Alexandru Ardelean --- drivers/uio/uio_cif.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers

[PATCH 3/4] uio: uio_fsl_elbc_gpcm: use device-managed allocators

2020-11-19 Thread Alexandru Ardelean
-off-by: Alexandru Ardelean --- drivers/uio/uio_fsl_elbc_gpcm.c | 32 +--- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/drivers/uio/uio_fsl_elbc_gpcm.c b/drivers/uio/uio_fsl_elbc_gpcm.c index be8a6905f507..7d8eb9dc2068 100644 --- a/drivers

[PATCH 2/4] uio: uio_aec: use devm_kzalloc() for uio_info object

2020-11-19 Thread Alexandru Ardelean
The uio_info object is free'd last, so it's life-time is tied PCI device object. Using devm_kzalloc() cleans up the error path a bit and the exit path. Signed-off-by: Alexandru Ardelean --- drivers/uio/uio_aec.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers

[PATCH] uio/uio_pci_generic: remove unneeded pci_set_drvdata()

2020-11-19 Thread Alexandru Ardelean
The pci_get_drvdata() was moved during commit ef84928cff58 ("uio/uio_pci_generic: use device-managed function equivalents"). I should have notice that the pci_set_drvdata() requires a pci_get_drvdata() for it to make sense. Signed-off-by: Alexandru Ardelean --- Apologies for no

[PATCH v2] uio: pruss: use devm_clk_get() for clk init

2020-11-19 Thread Alexandru Ardelean
This change uses devm_clk_get() to obtain a reference to the clock. It has the benefit that clk_put() is no longer required, and cleans up the exit & error path. Signed-off-by: Alexandru Ardelean --- Changelog v1 -> v2: * reverted silly/goofed `return ret` to `return PTR_ERR(gdev->

[PATCH] iio: adc: ad7292: remove unneeded spi_set_drvdata()

2020-11-19 Thread Alexandru Ardelean
This seems to have been copied from a driver that calls spi_set_drvdata() but doesn't call spi_get_drvdata(). Setting a private object on the SPI device's object isn't necessary if it won't be accessed. This change removes the spi_set_drvdata() call. Signed-off-by: Alexandru Ardelean

[PATCH] gpio: xra1403: remove unneeded spi_set_drvdata()

2020-11-19 Thread Alexandru Ardelean
There is no matching spi_get_drvdata() call in the driver, so there is no need to do spi_set_drvdata(). This looks like it probably was copied from a driver that used both spi_set_drvdata() & spi_get_drvdata(). Signed-off-by: Alexandru Ardelean --- drivers/gpio/gpio-xra1403.c | 10 +

[PATCH] iio: accel: adis16209: remove unneeded spi_set_drvdata()

2020-11-19 Thread Alexandru Ardelean
There is no matching spi_get_drvdata() in the driver. This looks like a left-over from before the driver was converted to device-managed functions. Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/adis16209.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iio/accel/adis16209

[PATCH] iio: accel: adis16201: remove unneeded spi_set_drvdata()

2020-11-19 Thread Alexandru Ardelean
There is no matching spi_get_drvdata() in the driver. This looks like a left-over from before the driver was converted to device-managed functions. Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/adis16201.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iio/accel/adis16201

Proposal for a new checkpatch check; matching _set_drvdata() & _get_drvdata()

2020-11-19 Thread Alexandru Ardelean
Hey, So, I stumbled on a new check that could be added to checkpatch. Since it's in Perl, I'm reluctant to try it. Seems many drivers got to a point where they now call (let's say) spi_set_drvdata(), but never access that information via spi_get_drvdata(). Reasons for this seem to be: 1. They

[PATCH v2 3/4] iio: adc: ad7887: add OF match table

2020-11-19 Thread Alexandru Ardelean
This will make the driver probe-able via device-tree and ACPI via PRP0001. While the SPI match table may be sufficient, this should extend the cover of this driver being probed by other methods. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/ad7887.c | 7 +++ 1 file changed, 7

[PATCH v2 4/4] dt-bindings: adc: ad7887: add binding doc for AD7887

2020-11-19 Thread Alexandru Ardelean
This change adds a simple device-tree binding for thhe Analog Devices AD7887 ADC. Signed-off-by: Alexandru Ardelean --- .../bindings/iio/adc/adi,ad7887.yaml | 70 +++ 1 file changed, 70 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/adi

[PATCH v2 1/4] iio: adc: ad7887: convert dual-channel mode to DT/ACPI

2020-11-19 Thread Alexandru Ardelean
-by: Alexandru Ardelean --- I'm wondering if this changeset is what was in mind here: https://lore.kernel.org/linux-iio/CA+U=DsqF5tu8Be9KXeyCWD2uHvV688Nc3n=z_xi2j6h6dfj...@mail.gmail.com/T/#mbe72e4da3acea3899d0d35402ea81e52a9bc34e6 This driver could have been simplified/reduced a whole lot more, but I'm

[PATCH v2 2/4] iio: adc: ad7887: remove matching code from driver

2020-11-19 Thread Alexandru Ardelean
The driver currently supports a single part. So we don't need to do any extra matching based on what the SPI framework has found during probe. This should make the driver probe-able via other mechanisms like greybus. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/ad7887.c | 5 ++--- 1

[PATCH 3/3] Input: adp5589-keys - add basic devicetree support

2020-11-19 Thread Alexandru Ardelean
From: Lars-Peter Clausen Add very basic devicetree suppport to the adp5589 allowing the device to be registered from devicetree and ACPI via PRP0001. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/input/keyboard/adp5589-keys.c | 30

[PATCH 1/3] Input: adp5589-keys - add default platform data

2020-11-19 Thread Alexandru Ardelean
. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/input/keyboard/adp5589-keys.c | 33 +++ 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c index

[PATCH 2/3] Input: adp5589-keys - wrap device probing into chip info struct

2020-11-19 Thread Alexandru Ardelean
This change wraps the devices supported by the adp5589 driver into a chip info struct. With this, a device table can be created, and the probed device can be selected based on the enum value provided by the i2c driver data. Signed-off-by: Alexandru Ardelean --- drivers/input/keyboard/adp5589

Re: [PATCH v2] iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack

2020-11-19 Thread Alexandru Ardelean
On Sat, Nov 14, 2020 at 6:20 PM Jonathan Cameron wrote: > > On Fri, 13 Nov 2020 11:40:59 +0200 > Alexandru Ardelean wrote: > > > From: Lars-Peter Clausen > > > > Use a heap allocated memory for the SPI transfer buffer. Using stack memory > > can corrupt

Re: [PATCH v2 3/4] hwmon: (ltc2945): add support for sense resistor

2020-11-18 Thread Alexandru Ardelean
On Wed, Nov 11, 2020 at 11:08 AM Alexandru Ardelean wrote: > > The sense resistor is a parameter of the board. It should be configured in > the driver via a device-tree / ACPI property, so that the proper current > measurements can be done in the driver. > > It shou

Re: [PATCH v2 2/4] docs: hwmon: (ltc2945): change type of val to ULL in ltc2945_val_to_reg()

2020-11-18 Thread Alexandru Ardelean
On Wed, Nov 11, 2020 at 4:54 PM Guenter Roeck wrote: > > On 11/11/20 1:12 AM, Alexandru Ardelean wrote: > > In order to account for any potential overflows that could occur. > > > > Signed-off-by: Alexandru Ardelean > > Thinking about it, this can only real

Re: [PATCH 2/3] iio: adc: ad7887: convert driver to full DT probing

2020-11-18 Thread Alexandru Ardelean
On Tue, Nov 17, 2020 at 6:02 PM Jonathan Cameron wrote: > > On Tue, 17 Nov 2020 17:03:06 +0200 > Alexandru Ardelean wrote: > > > On Tue, Nov 17, 2020 at 1:06 PM Jonathan Cameron > > wrote: > > > > > > On Tue, 17 Nov 2020 11:01:11 + > > > Jo

Re: [PATCH 1/3] iio: adc: ad7887: convert dual-channel mode to DT/ACPI

2020-11-18 Thread Alexandru Ardelean
On Tue, Nov 17, 2020 at 1:10 PM Andy Shevchenko wrote: > > On Tue, Nov 17, 2020 at 12:42 PM Jonathan Cameron > wrote: > > > > On Tue, 17 Nov 2020 09:52:52 +0200 > > Alexandru Ardelean wrote: > > > > > This change converts the configuration of the dua

Re: [PATCH v3 7/9] iio: cros_ec: use devm_iio_triggered_buffer_setup_ext()

2020-11-18 Thread Alexandru Ardelean
On Tue, Sep 29, 2020 at 6:40 PM Jonathan Cameron wrote: > > On Tue, 29 Sep 2020 17:31:55 +0300 > Alexandru Ardelean wrote: > > > On Tue, Sep 29, 2020 at 4:09 PM Andy Shevchenko > > wrote: > > > > > > On Tue, Sep 29, 2020 at 3:55 PM Alexandru Ardele

[RFC PATCH 05/12] iio: core: split __iio_device_attr_init() to init only the attr object

2020-11-17 Thread Alexandru Ardelean
the creation of the attribute name. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-core.c | 43 + 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index f389d8feacb0

[RFC PATCH 01/12] iio: core: register chardev only if needed

2020-11-17 Thread Alexandru Ardelean
zed, cdev_device_add() behaves like device_add(). Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-core.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 419d6f8acc13..ca8b11541

[RFC PATCH 04/12] iio: buffer: add index to the first IIO buffer dir and symlink it back

2020-11-17 Thread Alexandru Ardelean
This change makes it so that the first buffer directory is named 'buffer0' and moves the 'scan_elements' under it. For backwards compatibility these folders are symlinked back to the original folders. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 38

[RFC PATCH 03/12] iio: buffer: rework buffer & scan_elements dir creation

2020-11-17 Thread Alexandru Ardelean
gned-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 151 ++ drivers/iio/industrialio-core.c | 24 ++--- include/linux/iio/buffer_impl.h | 14 ++- include/linux/iio/iio.h | 2 +- 4 files changed, 156 insertions(+), 35 deletions(-) di

[RFC PATCH 02/12] iio: buffer: add back-ref from iio_buffer to iio_dev

2020-11-17 Thread Alexandru Ardelean
to the IIO device [from the IIO buffer]. This change adds that. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 2 ++ include/linux/iio/buffer_impl.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio

[RFC PATCH 09/12] iio: re-route all buffer attributes through new buffer kobj_type

2020-11-17 Thread Alexandru Ardelean
weird at first, as most of them will just pass back their reference to the IIO device. But this can also allow for newer (maybe more interesting) uses. Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/adxl372.c | 36 - drivers/iio/accel/bmc150-accel-core.c

[RFC PATCH 10/12] iio: core: wrap iio device & buffer into struct for character devices

2020-11-17 Thread Alexandru Ardelean
need to pass another buffer object than 'indio_dev->buffer'. Since we'll also open some chardevs via anon inodes, we can pass extra buffers in that function by assigning another object to the iio_dev_buffer_pair object. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h

[RFC PATCH 12/12] iio: buffer: add ioctl() to support opening extra buffers for IIO device

2020-11-17 Thread Alexandru Ardelean
the first buffer) this ioctl() will be required. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 111 ++ drivers/iio/industrialio-core.c | 8 +++ include/linux/iio/buffer_impl.h | 5 ++ include/linux/iio/iio-opaque.h| 2

[RFC PATCH 08/12] iio: buffer: add helper to get the IIO device to which a buffer belongs

2020-11-17 Thread Alexandru Ardelean
This is useful for drivers that may have a reference to an IIO buffer, to be able to get a reference back to the IIO device. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 14 ++ include/linux/iio/buffer.h| 2 ++ 2 files changed, 16 insertions

[RFC PATCH 11/12] iio: buffer: introduce support for attaching more IIO buffers

2020-11-17 Thread Alexandru Ardelean
buffer is the legacy buffer, so a reference is kept to it. At this point, accessing the data for the extra buffers (that are added after the first one) isn't possible yet. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 58 +-- include/linux/iio

[RFC PATCH 06/12] iio: buffer: re-route scan_elements via it's kobj_type

2020-11-17 Thread Alexandru Ardelean
need to the 'kobj' to expand from the 'bufferX' directory back to an IIO buffer. kobjects are simpler to manage. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h| 5 + drivers/iio/industrialio-buffer.c | 162 +++--- drivers/iio/industrialio-core.c | 1

[RFC PATCH 00/12] iio: core,buffer: add support for multiple IIO buffers per IIO device

2020-11-17 Thread Alexandru Ardelean
the 5th-7th patch, that the approach is correct. And I get even more unsure after that. I'll create some userspace code to test this a bit, but I thought I'd send an RFC in the meantime. Alexandru Ardelean (12): iio: core: register chardev only if needed iio: buffer: add back-ref from iio_buffer

[RFC PATCH 07/12] iio: buffer: re-route core buffer attributes via it's new kobj_type

2020-11-17 Thread Alexandru Ardelean
For the buffer attributes that are present inside the IIO core buffer logic we can re-route them to expand the attribute into iio_buffer objects. The rest, will still expand to device_attributes. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 113

Re: [PATCH 2/3] iio: adc: ad7887: convert driver to full DT probing

2020-11-17 Thread Alexandru Ardelean
On Tue, Nov 17, 2020 at 1:06 PM Jonathan Cameron wrote: > > On Tue, 17 Nov 2020 11:01:11 + > Jonathan Cameron wrote: > > > On Tue, 17 Nov 2020 09:52:53 +0200 > > Alexandru Ardelean wrote: > > > > > This change removes the SPI device table, adds an OF

[PATCH] iio: core: organize buffer file-ops in the order defined in the struct

2020-11-17 Thread Alexandru Ardelean
The change is mostly cosmetic. This organizes the order of assignment of the members of 'iio_buffer_fileops' to be similar to the one as defined in the 'struct file_operations' type. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-core.c | 8 1 file changed, 4 insertions

[PATCH] iio: core: return -EINVAL when no ioctl handler has been run

2020-11-17 Thread Alexandru Ardelean
. In that case -EINVAL should be returned. Fixes: 8dedcc3eee3a ("iio: core: centralize ioctl() calls to the main chardev") Signed-off-by: Alexandru Ardelean --- Apologies for not noticing this earlier. This came up when trying to write more IIO buffer code. >From my side either is

[PATCH 3/3] dt-bindings: adc: ad7887: add binding doc for AD7887

2020-11-16 Thread Alexandru Ardelean
This change adds a simple device-tree binding for thhe Analog Devices AD7887 ADC. Signed-off-by: Alexandru Ardelean --- .../bindings/iio/adc/adi,ad7887.yaml | 70 +++ 1 file changed, 70 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/adi

[PATCH 1/3] iio: adc: ad7887: convert dual-channel mode to DT/ACPI

2020-11-16 Thread Alexandru Ardelean
-by: Alexandru Ardelean --- drivers/iio/adc/ad7887.c | 10 +- include/linux/platform_data/ad7887.h | 21 - 2 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 include/linux/platform_data/ad7887.h diff --git a/drivers/iio/adc/ad7887.c b/drivers/iio

[PATCH 2/3] iio: adc: ad7887: convert driver to full DT probing

2020-11-16 Thread Alexandru Ardelean
This change removes the SPI device table, adds an OF device table instead. This should also be usable for ACPI via PRP0001. This device is usually probed via device-tree, so it makes more sense to use the OF device table. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/ad7887.c | 23

Re: [PATCH] iio: core: centralize ioctl() calls to the main chardev

2020-11-14 Thread Alexandru Ardelean
On Sat, Nov 14, 2020 at 5:32 PM Jonathan Cameron wrote: > > On Sat, 14 Nov 2020 15:30:23 + > Jonathan Cameron wrote: > > > On Mon, 2 Nov 2020 08:59:57 +0200 > > Alexandru Ardelean wrote: > > > > > On Fri, Sep 25, 2020 at 3:38 PM Jonathan Cameron wro

[PATCH v2] iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack

2020-11-13 Thread Alexandru Ardelean
takes into account the alignment for the timestamp, which is 8 bytes. So the buffer is put at an offset of 8 bytes. Fixes: af3008485ea03 ("iio:adc: Add common code for ADI Sigma Delta devices") Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- Changelog v1 ->

[PATCH] iio: adc: ad7887: convert probe to device-managed functions

2020-11-13 Thread Alexandru Ardelean
is cleaned up in probe. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/ad7887.c | 43 ++-- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/drivers/iio/adc/ad7887.c b/drivers/iio/adc/ad7887.c index 99a480ad3985..4f6f0e0e03ee 100644 --- a/drivers

Re: [PATCH] iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack

2020-11-12 Thread Alexandru Ardelean
On Thu, Nov 12, 2020 at 11:55 AM Lars-Peter Clausen wrote: > > On 11/12/20 10:10 AM, Alexandru Ardelean wrote: > > From: Lars-Peter Clausen > > > > Use a heap allocated memory for the SPI transfer buffer. Using stack memory > > can corrupt stack memory

[PATCH] iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack

2020-11-12 Thread Alexandru Ardelean
the first 4 bytes are reserved for register data. Fixes: af3008485ea03 ("iio:adc: Add common code for ADI Sigma Delta devices") Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/ad_sigma_delta.c | 4 ++-- include/linux/iio/adc/ad_sigma_delta.h

[PATCH v2 4/5] Input: adp5589: use devm_gpiochip_add_data() for gpios

2020-11-11 Thread Alexandru Ardelean
This change makes use of the devm_gpiochip_add_data() function. With this the gpiochip_remove() function can be removed, and the adp5589_gpio_remove() function as well. The kpad->export_gpio variable is also redundant now, and has been removed. Signed-off-by: Alexandru Ardelean --- driv

[PATCH v2 2/5] Input: adp5589: use device-managed function in adp5589_keypad_add()

2020-11-11 Thread Alexandru Ardelean
move() hook, but doesn't look like it is. This change may also also fix some potential leaks that were probably omitted earlier. Signed-off-by: Alexandru Ardelean --- drivers/input/keyboard/adp5589-keys.c | 47 +++ 1 file changed, 11 insertions(+), 36 deletions(-) diff -

[PATCH v2 3/5] Input: adp5589: remove setup/teardown hooks for gpios

2020-11-11 Thread Alexandru Ardelean
This is currently just dead code. It's from around a time when platform-data was used, and a board could hook it's own special callback for setup/teardown, and a private object (via 'context'). This change removes it, as there are no more users in mainline for this. Signed-off-by: Alexandru

[PATCH v2 1/5] Input: adp5589: use devm_kzalloc() to allocate the kpad object

2020-11-11 Thread Alexandru Ardelean
This removes the need to manually free the kpad object and cleans up some exit/error paths. The error path cleanup should reduce the risk of any memory leaks with this object. Signed-off-by: Alexandru Ardelean --- drivers/input/keyboard/adp5589-keys.c | 13 - 1 file changed, 4

[PATCH v2 0/5] Input: adp5589: cleanup and use device-managed functions

2020-11-11 Thread Alexandru Ardelean
d patch: 'Input: adp5589: use a single variable for error in probe' * for patch 'Input: adp5589: use devm_add_action_or_reset() for register clear' moved devm_add_action_or_reset() right after switch statement; using 'error' variable to check for error condition Alexandru Ardelean (5): Input:

[PATCH v2 5/5] Input: adp5589: use devm_add_action_or_reset() for register clear

2020-11-11 Thread Alexandru Ardelean
The driver clears the general configuration register during the remove() hook. This should also be done in case the driver exits on error. This change move the clear of that register to the devm_add_action_or_reset() hook. Signed-off-by: Alexandru Ardelean --- drivers/input/keyboard/adp5589

Re: [PATCH v2 2/4] docs: hwmon: (ltc2945): change type of val to ULL in ltc2945_val_to_reg()

2020-11-11 Thread Alexandru Ardelean
On Wed, Nov 11, 2020 at 4:54 PM Guenter Roeck wrote: > > On 11/11/20 1:12 AM, Alexandru Ardelean wrote: > > In order to account for any potential overflows that could occur. > > > > Signed-off-by: Alexandru Ardelean > > Thinking about it, this can only real

Re: [PATCH] spi: Add SPI_NO_TX/RX support

2020-11-11 Thread Alexandru Ardelean
On Wed, Nov 11, 2020 at 4:45 PM Andy Shevchenko wrote: > > On Wed, Nov 11, 2020 at 4:13 PM Alexandru Ardelean > wrote: > > > > From: Dragos Bogdan > > > > Transmit/receive only is a valid SPI mode. For example, the MOSI/TX line > > might be missing from

[PATCH] spi: Add SPI_NO_TX/RX support

2020-11-11 Thread Alexandru Ardelean
of these two lines is missing and to adjust the transfers accordingly. Signed-off-by: Dragos Bogdan Signed-off-by: Alexandru Ardelean --- drivers/spi/spi.c | 25 - include/linux/spi/spi.h | 2 ++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/drivers/spi

[PATCH] uio/uio_pci_generic: use device-managed function equivalents

2020-11-11 Thread Alexandru Ardelean
This driver can be easily converted to use the device-managed allocator function and the PCI managed enable function. With these conversions the probe error paths are no longer needed and neither is the remove function. Signed-off-by: Alexandru Ardelean --- drivers/uio/uio_pci_generic.c | 37

[PATCH 2/2] uio: pruss: use devm_clk_get() for clk init

2020-11-11 Thread Alexandru Ardelean
This change uses devm_clk_get() to obtain a reference to the clock. It has the benefit that clk_put() is no longer required, and cleans up the exit & error path. Signed-off-by: Alexandru Ardelean --- drivers/uio/uio_pruss.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-)

[PATCH 1/2] uio: pruss: move simple allocations to dem_ equivalents

2020-11-11 Thread Alexandru Ardelean
This change moves the simple allocations to their device-managed equivalents. This cleans up some error/exit paths. Signed-off-by: Alexandru Ardelean --- drivers/uio/uio_pruss.c | 27 +++ 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/uio

<    1   2   3   4   5   6   7   8   9   10   >