Re: [PATCH 2/2] iio: accel: Add driver for Murata SCA3300 accelerometer

2021-04-20 Thread Alexandru Ardelean
40.638747] r5:0800 r4:bf00c080 > > > >>>> [ 40.642311] [] (sca3300_driver_exit [sca3300]) from > > > >>>> [] (sys_delete_module+0x16c/0x238) > > > >>>> [ 40.651990] [] (sys_delete_module) from [] > > > >>>> (__sys_trace_

[PATCH] iio: hid-sensors: select IIO_TRIGGERED_BUFFER under HID_SENSOR_IIO_TRIGGER

2021-04-14 Thread Alexandru Ardelean
gger") Reported-by: Thomas Deutschmann Cc: Srinivas Pandruvada Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/Kconfig | 1 - drivers/iio/common/hid-sensors/Kconfig | 1 + drivers/iio/gyro/Kconfig | 1 - drivers/iio/humidity/Kconfig | 1 - drive

Re: [PATCH 0/3] staging: iio: cdc: ad7746: remove platform_data in favor of device tree bindings

2021-04-10 Thread Alexandru Ardelean
On Fri, Apr 9, 2021 at 9:50 PM Lucas Stankus wrote: > > This patch series aims to replace the platform_struct for the ad7746 driver > in favor of device tree bindings, creating the dt-bindings documentation in > the process. > > Since the header file was only used to define the struct and the

Re: [PATCH 2/3] staging: iio: cdc: ad7746: use dt bindings to set the EXCx pins output

2021-04-10 Thread Alexandru Ardelean
On Sat, Apr 10, 2021 at 7:12 PM Alexandru Ardelean wrote: > > On Fri, Apr 9, 2021 at 9:51 PM Lucas Stankus > wrote: > > > > Ditch platform_data fields in favor of device tree properties for > > configuring EXCA and EXCB output. > > This also removes the fie

Re: [PATCH 2/3] staging: iio: cdc: ad7746: use dt bindings to set the EXCx pins output

2021-04-10 Thread Alexandru Ardelean
On Fri, Apr 9, 2021 at 9:51 PM Lucas Stankus wrote: > > Ditch platform_data fields in favor of device tree properties for > configuring EXCA and EXCB output. > This also removes the fields from the platform_data struct, since they're > not used anymore. > > Signed-off-by: Lucas Stankus > --- >

[PATCH] iio: buffer: use sysfs_attr_init() on allocated attrs

2021-04-02 Thread Alexandru Ardelean
: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") Reported-by: Marek Szyprowski Signed-off-by: Alexandru Ardelean --- @Marek: could you maybe test this on your setup? I haven't been able to reproduce this on mine. Thanks Alex drivers/iio/industrialio-buffer.c | 1

Re: [PATCH v6 14/24] iio: buffer: wrap all buffer attributes into iio_dev_attr

2021-04-01 Thread Alexandru Ardelean
On Thu, Apr 1, 2021 at 11:29 AM Jonathan Cameron wrote: > > On Thu, 1 Apr 2021 09:39:47 +0200 > Marek Szyprowski wrote: > > > Hi > > > > On 15.02.2021 11:40, Alexandru Ardelean wrote: > > > This change wraps all buffer attributes into iio_dev_attr

Re: [PATCH 00/10] platform/x86: toshiba_acpi: move acpi add/remove to device-managed routines

2021-03-30 Thread Alexandru Ardelean
On Tue, Mar 30, 2021 at 11:21 AM Hans de Goede wrote: > > Hi Alexadru, Jonathan, > > On 3/24/21 1:55 PM, Alexandru Ardelean wrote: > > This changeset tries to do a conversion of the toshiba_acpi driver to use > > only device-managed routines. The driver registers as a s

Re: [PATCH 01/10] platform/x86: toshiba_acpi: bind life-time of toshiba_acpi_dev to parent

2021-03-30 Thread Alexandru Ardelean
On Mon, 29 Mar 2021 at 17:30, Jonathan Cameron wrote: > > On Wed, 24 Mar 2021 14:55:39 +0200 > Alexandru Ardelean wrote: > > > The 'toshiba_acpi_dev' object is allocated first and free'd last. We can > > bind it's life-time to the parent ACPI device object. This is a firs

Re: [PATCH 00/10] platform/x86: toshiba_acpi: move acpi add/remove to device-managed routines

2021-03-29 Thread Alexandru Ardelean
On Mon, 29 Mar 2021 at 15:38, Jonathan Cameron wrote: > > On Wed, 24 Mar 2021 14:55:38 +0200 > Alexandru Ardelean wrote: > > > This changeset tries to do a conversion of the toshiba_acpi driver to use > > only device-managed routines. The driver registers as a singleton,

Re: linux-next: build failure after merge of the staging tree

2021-03-29 Thread Alexandru Ardelean
from the spi tree. > > > > I have applied the following merge fix patch. > > > > From: Stephen Rothwell > > Date: Mon, 29 Mar 2021 16:51:22 +1100 > > Subject: [PATCH] iio: adc: merge fix for "spi: core: remove 'delay_usecs' > > field from spi_tra

Re: [PATCH 0/3] iio: adc: ad7923: convert driver resources routines to device-managed counterparts

2021-03-29 Thread Alexandru Ardelean
_set_drvdata() omission. With that fixed: Reviewed-by: Alexandru Ardelean If you want, you can also search for more of these xxx_set_drvdata() omissions. There were more conversions to devm_ that forgot to remove those. Maybe a cocci script would be nice to find them. But all this is optional. Only

Re: [PATCH] drivers: iio: adc: fix unmet dependency on OF

2021-03-29 Thread Alexandru Ardelean
On Sun, Mar 28, 2021 at 7:08 AM Julian Braha wrote: > > When AD9467 is enabled, and OF is disabled, > Kbuild gives the following warning: > > WARNING: unmet direct dependencies detected for ADI_AXI_ADC > Depends on [n]: IIO [=y] && HAS_IOMEM [=y] && OF [=n] > Selected by [y]: > - AD9467 [=y]

[PATCH] iio: adc: Kconfig: make AD9467 depend on ADI_AXI_ADC symbol

2021-03-24 Thread Alexandru Ardelean
depend on the ADI_AXI_ADC symbol. At some point this could become it's own subgroup of high-speed ADCs. Fixes: be24c65e9fa24 ("iio: adc: adi-axi-adc: add proper Kconfig dependencies") Reported-by: Randy Dunlap Signed-off-by: Alexandru Ardelean --- Apologies for this being too la

[PATCH 09/10] platform/x86: toshiba_acpi: use device-managed for sysfs removal

2021-03-24 Thread Alexandru Ardelean
This change moves the creation of the Toshiba ACPI group to be automatically removed when the parent refcount goes to zero. The main reason to do this, is to also enforce that the order of removal is mirroring the order of initialization. Signed-off-by: Alexandru Ardelean --- drivers/platform

[PATCH 07/10] platform/x86: toshiba_acpi: use device-managed functions for accelerometer

2021-03-24 Thread Alexandru Ardelean
operation. Signed-off-by: Alexandru Ardelean --- drivers/platform/x86/toshiba_acpi.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index e787c140eec2..12860ef60e4d 100644 --- a/drivers

[PATCH 10/10] platform/x86: toshiba_acpi: bind proc entries creation to parent

2021-03-24 Thread Alexandru Ardelean
() function, so in this change this function is removed. Signed-off-by: Alexandru Ardelean --- drivers/platform/x86/toshiba_acpi.c | 45 ++--- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86

[PATCH 06/10] platform/x86: toshiba_acpi: use devm_led_classdev_register() for LEDs

2021-03-24 Thread Alexandru Ardelean
also unifies the reference to the parent object from '_dev->dev' and '>acpi_dev->dev' to 'parent', since it's the same reference, and makes the code-lines a bit shorter. Signed-off-by: Alexandru Ardelean --- drivers/platform/x86/toshiba_acpi.c | 16 +--- 1 file changed, 9 i

[PATCH 08/10] platform/x86: toshiba_acpi: use device-managed for wwan_rfkill management

2021-03-24 Thread Alexandru Ardelean
reason to do this is to enforce ordering on cleanup, when the Toshiba ACPI device is cleaned up. Signed-off-by: Alexandru Ardelean --- drivers/platform/x86/toshiba_acpi.c | 40 ++--- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86

[PATCH 04/10] platform/x86: toshiba_acpi: use device-managed functions for input device

2021-03-24 Thread Alexandru Ardelean
this relies on the fact that there can a single toshiba_acpi_dev object. Signed-off-by: Alexandru Ardelean --- drivers/platform/x86/toshiba_acpi.c | 55 +++-- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers

[PATCH 01/10] platform/x86: toshiba_acpi: bind life-time of toshiba_acpi_dev to parent

2021-03-24 Thread Alexandru Ardelean
functions (i.e. devm_iio_device_alloc() and devm_iio_device_register()). It's still not 100% sure that this is possible, but for now, this is the process of taking it slowly in that direction. Signed-off-by: Alexandru Ardelean --- drivers/platform/x86/toshiba_acpi.c | 6 ++ 1 file changed, 2

[PATCH 05/10] platform/x86: toshiba_acpi: register backlight with device-managed variant

2021-03-24 Thread Alexandru Ardelean
-by: Alexandru Ardelean --- drivers/platform/x86/toshiba_acpi.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 556f2cc99bad..ada2a2d8c913 100644 --- a/drivers/platform/x86

[PATCH 02/10] platform/x86: toshiba_acpi: use devm_add_action_or_reset() for singleton clear

2021-03-24 Thread Alexandru Ardelean
The only reason to do this is to enforce the ordering of deinitialization, when the conversion of the device-managed functions is done. The singleton object should be cleared right before it is free'd. Signed-off-by: Alexandru Ardelean --- drivers/platform/x86/toshiba_acpi.c | 15

[PATCH 03/10] platform/x86: toshiba_acpi: bind registration of miscdev object to parent

2021-03-24 Thread Alexandru Ardelean
the miscdev was deregistered first. Now it will be deregistered right before the toshiba_acpi_dev object is free'd. Signed-off-by: Alexandru Ardelean --- drivers/platform/x86/toshiba_acpi.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86

[PATCH 00/10] platform/x86: toshiba_acpi: move acpi add/remove to device-managed routines

2021-03-24 Thread Alexandru Ardelean
to remove the iio_device_alloc() function. While I admit this may look like an overzealous effort to use devm_ everywhere (in IIO at least), for me it's a fun/interesting excercise. Alexandru Ardelean (10): platform/x86: toshiba_acpi: bind life-time of toshiba_acpi_dev to parent platform/x86

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

2021-03-24 Thread Alexandru Ardelean
On Tue, Mar 23, 2021 at 1:35 PM Jonathan Cameron wrote: > > On Tue, 23 Mar 2021 11:51:04 +0200 > Alexandru Ardelean wrote: > > > On Sun, Mar 21, 2021 at 7:37 PM Jonathan Cameron > > wrote: > > > > > > On Sat, 20 Mar 2021 17:41:00 + > > > Jo

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

2021-03-23 Thread Alexandru Ardelean
On Sun, Mar 21, 2021 at 7:37 PM Jonathan Cameron wrote: > > On Sat, 20 Mar 2021 17:41:00 + > Jonathan Cameron wrote: > > > On Mon, 15 Mar 2021 09:58:08 + > > "Sa, Nuno" wrote: > > > > > > -Original Message- > > > >

[PATCH] iio: buffer: return 0 for buffer getfd ioctl handler

2021-03-22 Thread Alexandru Ardelean
. Maybe we should change this to a higher negative number, to avoid such cases when/if we add more ioctl() handlers. Cc: Lars-Peter Clausen Fixes: f73f7f4da5818 ("iio: buffer: add ioctl() to support opening extra buffers for IIO device") Signed-off-by: Alexandru Ardelean --- drivers/iio/in

Re: linux-next: Tree for Mar 16 (AD9467 & ADI_AXI_ADC)

2021-03-17 Thread Alexandru Ardelean
On Tue, Mar 16, 2021 at 11:20 PM Randy Dunlap wrote: > > On 3/15/21 9:50 PM, Stephen Rothwell wrote: > > Hi all, > > > > News: there will be no linux-next release on Friday this week. > > > > Warning: Some of the branches in linux-next are still based on v5.12-rc1, > > so please be careful if you

Re: [PATCH] iio:dac:max517: Use devm_iio_device_register()

2021-03-14 Thread Alexandru Ardelean
On Sun, Mar 14, 2021 at 11:34 AM Mugilraj Dhavachelvan wrote: > > Use devm_iio_device_register() to avoid remove function and > drop explicit call to iio_device_unregister(). > > Signed-off-by: Mugilraj Dhavachelvan > --- > drivers/iio/dac/max517.c | 9 + > 1 file changed, 1

Re: [PATCH] iio: kfifo: add devm_iio_triggered_buffer_setup_ext variant

2021-03-11 Thread Alexandru Ardelean
On Thu, Mar 11, 2021 at 11:14 AM Alexandru Ardelean wrote: > > This is similar to the {devm_}iio_triggered_buffer_setup_ext variants added > via commit 5164c7889857 ("iio: triggered-buffer: add > {devm_}iio_triggered_buffer_setup_ext variants"). > > These can

[PATCH] iio: kfifo: add devm_iio_triggered_buffer_setup_ext variant

2021-03-11 Thread Alexandru Ardelean
o let them include 'buffer_impl.h' directly). Signed-off-by: Alexandru Ardelean --- Related to the discussion here: https://lore.kernel.org/linux-iio/CA+U=Dspk3cWjiiRmDrgfHAY6houjr-KtSD3u4BssUcb=c2u...@mail.gmail.com/T/#mcfda9d6cb6426caefa4a5db6d634640bfdbe328e drivers/iio/buffer/kfifo_

[PATCH] staging: iio: ad9834: convert to device-managed functions in probe

2021-03-10 Thread Alexandru Ardelean
to export only the device-managed functions of it's API. That's a long way to go and this a small step in that direction. Signed-off-by: Alexandru Ardelean --- drivers/staging/iio/frequency/ad9834.c | 64 +- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git

[PATCH] iio: temperature: tmp007: use device-managed functions in probe

2021-03-10 Thread Alexandru Ardelean
the device-managed functions of it's API. That's a long way to go and this a small step in that direction. Signed-off-by: Alexandru Ardelean --- drivers/iio/temperature/tmp007.c | 36 +--- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/drivers/iio/temperature

Re: [PATCH 01/10] spi: spi-axi-spi-engine: remove usage of delay_usecs

2021-03-09 Thread Alexandru Ardelean
On Mon, 8 Mar 2021 at 18:42, Lars-Peter Clausen wrote: > > On 3/8/21 3:54 PM, Alexandru Ardelean wrote: > > The 'delay_usecs' field was handled for backwards compatibility in case > > there were some users that still configured SPI delay transfers with > > this field.

[PATCH 09/10] spi: core: remove 'delay_usecs' field from spi_transfer

2021-03-08 Thread Alexandru Ardelean
The 'delay' field in the spi_transfer struct is meant to replace the 'delay_usecs' field. However some cleanup was required to remove the uses of 'delay_usecs'. Now that it's been cleaned up, we can remove it from the kernel tree. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi.c

[PATCH 08/10] spi: fsl-espi: remove usage of 'delay_usecs' field

2021-03-08 Thread Alexandru Ardelean
The 'delay_usecs' field is being removed from the spi_transfer struct. This change removes it from the SPI FSL ESPI driver. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-fsl-espi.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/spi/spi-fsl

[PATCH 10/10] spi: docs: update info about 'delay_usecs'

2021-03-08 Thread Alexandru Ardelean
The 'delay_usecs' field is no longer present on the spi_transfer struct. This change updates the doc to mention the usage of the (relatively) new 'delay' field. Signed-off-by: Alexandru Ardelean --- Documentation/spi/spi-summary.rst | 7 +-- 1 file changed, 5 insertions(+), 2 deletions

[PATCH 00/10] spi: finalize 'delay_usecs' removal/transition

2021-03-08 Thread Alexandru Ardelean
the 'delay' field. This changeset adapts all SPI drivers to do without 'delay_usecs'. Additionally, for greybus we need to adapt it to use the 'delay' in nano-seconds and convert it to micro-seconds. Alexandru Ardelean (10): spi: spi-axi-spi-engine: remove usage of delay_usecs spi: bcm63xx-spi

[PATCH 04/10] spi: spi-sh: replace 'delay_usecs' with 'delay.value' in pr_debug

2021-03-08 Thread Alexandru Ardelean
The 'delay_usecs' field is going away. The replacement for it is the 'delay' field. So, we should print the 'delay.value' value instead. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-sh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-sh.c b

[PATCH 06/10] staging: greybus: spilib: use 'spi_delay_to_ns' for getting xfer delay

2021-03-08 Thread Alexandru Ardelean
of spi_delay_to_ns() is int, the delay is being computed in 32 bits and then clamped between 0 & U16_MAX. Signed-off-by: Alexandru Ardelean --- drivers/staging/greybus/spilib.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/spilib.c b/drivers/sta

[PATCH 05/10] spi: spi-tegra20-flash: don't check 'delay_usecs' field for spi transfer

2021-03-08 Thread Alexandru Ardelean
The 'delay_usecs' field was handled for backwards compatibility in case there were some users that still configured SPI delay transfers with this field. They should all be removed by now. So we can remove the 'delay_usecs' handling in this driver. Signed-off-by: Alexandru Ardelean --- drivers

[PATCH 07/10] spi: spi-falcon: remove check for 'delay_usecs'

2021-03-08 Thread Alexandru Ardelean
The 'delay_usecs' field is being removed from the spi_transfer struct. This change removes it from the SPI Falcon driver. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-falcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-falcon.c b/drivers/spi/spi

[PATCH 02/10] spi: bcm63xx-spi: don't check 'delay_usecs' field

2021-03-08 Thread Alexandru Ardelean
The 'delay_usecs' field was handled for backwards compatibility in case there were some users that still configured SPI delay transfers with this field. They should all be removed by now. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-bcm63xx.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 03/10] spi: spi-bcm-qspi: replace 'delay_usecs' with 'delay.value' check

2021-03-08 Thread Alexandru Ardelean
The 'delay_usecs' field is going away. The replacement for it is the 'delay' field. So, we should check for 'delay.value' being non-zero. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-bcm-qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-bcm

[PATCH 01/10] spi: spi-axi-spi-engine: remove usage of delay_usecs

2021-03-08 Thread Alexandru Ardelean
The 'delay_usecs' field was handled for backwards compatibility in case there were some users that still configured SPI delay transfers with this field. They should all be removed by now. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-axi-spi-engine.c | 12 1 file changed

Re: [PATCH v2] iio: buffer: fix use-after-free for attached_buffers array

2021-03-07 Thread Alexandru Ardelean
On Sun, Mar 7, 2021 at 8:55 PM Alexandru Ardelean wrote: > > Thanks to Lars for finding this. > The free of the 'attached_buffers' array should be done as late as > possible. This change moves it to iio_buffers_put(), which looks like > the best place for it, since it takes pla

[PATCH v2] iio: buffer: fix use-after-free for attached_buffers array

2021-03-07 Thread Alexandru Ardelean
a comment in the doc-header of iio_device_attach_buffer() to mention how this will be free'd in case anyone is reading the code and becoming confused about it. Fixes: 36f3118c414d ("iio: buffer: introduce support for attaching more IIO buffers") Reported-by: Lars-Peter Clausen Signed-off-by:

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

2021-03-07 Thread Alexandru Ardelean
On Sun, Mar 7, 2021 at 1:59 PM Jonathan Cameron wrote: > > On Tue, 2 Mar 2021 11:46:06 +0100 > Enric Balletbo i Serra wrote: > > > Hi all, > > > > On 21/2/21 17:29, Jonathan Cameron wrote: > > > On Mon, 23 Nov 2020 16:40:16 +0200 > > > Alexand

Re: [PATCH] iio: buffer: fix use-after-free for attached_buffers array

2021-03-07 Thread Alexandru Ardelean
On Sun, Mar 7, 2021 at 2:54 PM Lars-Peter Clausen wrote: > > On 3/7/21 1:36 PM, Jonathan Cameron wrote: > > On Sat, 6 Mar 2021 18:47:10 +0200 > > Alexandru Ardelean wrote: > > > >> Thanks to Lars for finding this. > >> The free of the 'atta

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

2021-03-06 Thread Alexandru Ardelean
On Sun, Feb 28, 2021 at 9:00 PM Jonathan Cameron wrote: > > On Sun, 28 Feb 2021 16:51:51 +0100 > Lars-Peter Clausen wrote: > > > On 2/28/21 3:34 PM, Jonathan Cameron wrote: > > > On Sun, 28 Feb 2021 09:51:38 +0100 > > > Lars-Peter Clausen wrote: > &g

[PATCH] iio: buffer: fix use-after-free for attached_buffers array

2021-03-06 Thread Alexandru Ardelean
and becoming confused about it. Fixes: 36f3118c414d ("iio: buffer: introduce support for attaching more IIO buffers") Reported-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-)

[PATCH] iio: kfifo: mask flags without zero-check in devm_iio_kfifo_buffer_setup()

2021-03-06 Thread Alexandru Ardelean
of a tweak. Fixes: ae9886d6aa29 ("iio: kfifo: add devm_iio_kfifo_buffer_setup() helper") Cc: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- Apologies for the late-ness of this. I don't know if this makes sense to squash in the original, or to have as a fix commit. It is a bit

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

2021-02-28 Thread Alexandru Ardelean
On Sun, Feb 28, 2021 at 5:54 PM Lars-Peter Clausen wrote: > > On 2/28/21 3:34 PM, Jonathan Cameron wrote: > > On Sun, 28 Feb 2021 09:51:38 +0100 > > Lars-Peter Clausen wrote: > > > >> On 2/15/21 11:40 AM, Alexandru Ardelean wrote: > >>> With

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

2021-02-28 Thread Alexandru Ardelean
On Sun, Feb 28, 2021 at 9:58 AM Lars-Peter Clausen wrote: > > On 2/15/21 11:40 AM, Alexandru Ardelean wrote: > > [...] > > /** > >* iio_buffer_wakeup_poll - Wakes up the buffer waitqueue > >* @indio_dev: The IIO device > >

Re: [PATCH v6 02/24] iio: kfifo: add devm_iio_kfifo_buffer_setup() helper

2021-02-28 Thread Alexandru Ardelean
On Sun, Feb 28, 2021 at 10:08 AM Lars-Peter Clausen wrote: > > On 2/15/21 11:40 AM, Alexandru Ardelean wrote: > > +int devm_iio_kfifo_buffer_setup(struct device *dev, > > + struct iio_dev *indio_dev, > > +

Re: [PATCH v6 19/24] iio: buffer: introduce support for attaching more IIO buffers

2021-02-28 Thread Alexandru Ardelean
On Sun, Feb 28, 2021 at 10:31 AM Lars-Peter Clausen wrote: > > On 2/15/21 11:40 AM, Alexandru Ardelean wrote: > > static ssize_t iio_show_scan_index(struct device *dev, > > struct device_attribute *attr, > >

[PATCH v2] iio: core: use kstrdup_const/kfree_const for buffer attributes

2021-02-22 Thread Alexandru Ardelean
some attributes allocated on the heap. Fixes: a1a11142f66c ("iio: buffer: wrap all buffer attributes into iio_dev_attr") Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 1 + drivers/iio/industrialio-core.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(

Re: [PATCH 1/2] iio: core: use kfree_const in iio_free_chan_devattr_list() to free names

2021-02-22 Thread Alexandru Ardelean
On Mon, Feb 22, 2021 at 6:06 PM Jonathan Cameron wrote: > > On Fri, 19 Feb 2021 10:58:25 +0200 > Alexandru Ardelean wrote: > > > When the buffer attributes were wrapped in iio_dev_attr types, I forgot to > > duplicate the names, so that when iio_free_chan_de

Re: [PATCH v3 6/6] iio: buffer-dma: add support for cyclic DMA transfers

2021-02-22 Thread Alexandru Ardelean
On Sun, Feb 21, 2021 at 2:11 PM Jonathan Cameron wrote: > > On Fri, 19 Feb 2021 14:40:12 +0200 > Alexandru Ardelean wrote: > > > From: Lars-Peter Clausen > > > > This change adds support for cyclic DMA transfers using the IIO buffer DMA > > infrastructure

[PATCH v3 6/6] iio: buffer-dma: add support for cyclic DMA transfers

2021-02-19 Thread Alexandru Ardelean
-by: Alexandru Ardelean --- .../buffer/industrialio-buffer-dmaengine.c| 24 --- include/uapi/linux/iio/buffer.h | 1 + 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer

[PATCH v3 2/6] iio: kfifo-buffer: Add output buffer support

2021-02-19 Thread Alexandru Ardelean
From: Lars-Peter Clausen Add output buffer support to the kfifo buffer implementation. The implementation is straight forward and mostly just wraps the kfifo API to provide the required operations. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer

[PATCH v3 5/6] iio: buffer-dma: Add output buffer support

2021-02-19 Thread Alexandru Ardelean
From: Lars-Peter Clausen Add support for output buffers to the dma buffer implementation. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/adi-axi-adc.c | 3 +- drivers/iio/buffer/industrialio-buffer-dma.c | 116

[PATCH v3 3/6] iio: triggered-buffer: extend support to configure output buffers

2021-02-19 Thread Alexandru Ardelean
5 drivers where {devm_}iio_triggered_buffer_setup_ext() is used. Well, it's doable, but may not be worth the trouble vs just updating all these 5 drivers. Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/adxl372.c | 1 + drivers/iio/accel/bmc150-accel-core.c

[PATCH v3 4/6] iio: buffer-dma: Allow to provide custom buffer ops

2021-02-19 Thread Alexandru Ardelean
From: Lars-Peter Clausen Some devices that want to make use of the DMA buffer might need to do something special, like write a register when the buffer is enabled. Extend the API to allow those drivers to provide their own buffer ops. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru

[PATCH v3 1/6] iio: Add output buffer support

2021-02-19 Thread Alexandru Ardelean
after allocating and before registering it. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- Documentation/ABI/testing/sysfs-bus-iio | 7 ++ drivers/iio/industrialio-buffer.c | 133 +++- include/linux/iio/buffer.h | 7 ++ include

[PATCH v3 0/6] iio: Add output buffer support

2021-02-19 Thread Alexandru Ardelean
ges * patch 'iio: Add output buffer support' - moved new 'bufferY/direction' attribute at the end and added comment about what it should be added at the end * removed Lars' comment '/* need a way of knowing if there may be enough data... */' * updated some various formatting; Alexandru Ardel

[PATCH] iio: adc: adi-axi-adc: fix typo in doc-string

2021-02-19 Thread Alexandru Ardelean
The channels are of type iio_chan_spec, not axi_adc_chan_spec. They were in some earlier version, but forgot to rename in the doc-string. Fixes: ef04070692a21 ("iio: adc: adi-axi-adc: add support for AXI ADC IP core") Signed-off-by: Alexandru Ardelean --- include/linux/iio/adc/adi-axi

[PATCH 1/2] iio: core: use kfree_const in iio_free_chan_devattr_list() to free names

2021-02-19 Thread Alexandru Ardelean
ated or be stored in rodata. Fixes: a1a11142f66c ("iio: buffer: wrap all buffer attributes into iio_dev_attr") Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/industrialio-core.c

[PATCH 2/2] iio: buffer-dma: fix type of 'i' in iio_dma_buffer_alloc_blocks()

2021-02-19 Thread Alexandru Ardelean
t Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-buffer-dma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/buffer/industrialio-buffer-dma.c b/drivers/iio/buffer/industrialio-buffer-dma.c index d04479194cb4..83074d060535 100644 --- a/drive

[PATCH 0/2] iio: core,buffer-dma: 2 fixes for the recent IIO buffer series

2021-02-19 Thread Alexandru Ardelean
can also re-send the series, but not from an Analog email; since I will not have access to it. Alexandru Ardelean (2): iio: core: use kfree_const in iio_free_chan_devattr_list() to free names iio: buffer-dma: fix type of 'i' in iio_dma_buffer_alloc_blocks() drivers/iio/buffer/industrialio

Re: [PATCH v2 5/5] iio: dac: ad5686: Add PWM as a trigger source

2021-02-19 Thread Alexandru Ardelean
On Thu, Feb 18, 2021 at 5:31 PM Rob Herring wrote: > > On Thu, Feb 18, 2021 at 8:05 AM Jonathan Cameron wrote: > > > > On Wed, 17 Feb 2021 10:34:38 +0200 > > Alexandru Ardelean wrote: > > > > > From: Mircea Caprioru > > > > > &

Re: [PATCH v2 2/5] iio: Add output buffer support

2021-02-19 Thread Alexandru Ardelean
On Thu, Feb 18, 2021 at 5:30 PM Jonathan Cameron wrote: > > On Wed, 17 Feb 2021 10:34:35 +0200 > Alexandru Ardelean wrote: > > > From: Lars-Peter Clausen > > > > Currently IIO only supports buffer mode for capture devices like ADCs. Add > > support for buffer

[PATCH v2 4/5] iio: triggered-buffer: extend support to configure output buffers

2021-02-17 Thread Alexandru Ardelean
5 drivers where {devm_}iio_triggered_buffer_setup_ext() is used. Well, it's doable, but may not be worth the trouble vs just updating all these 5 drivers. Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/adxl372.c | 1 + drivers/iio/accel/bmc150-accel-core.c

[PATCH v2 5/5] iio: dac: ad5686: Add PWM as a trigger source

2021-02-17 Thread Alexandru Ardelean
Signed-off-by: Mihail Chindris Signed-off-by: Alexandru Ardelean --- drivers/iio/dac/ad5686-spi.c | 2 +- drivers/iio/dac/ad5686.c | 146 ++- drivers/iio/dac/ad5686.h | 7 +- drivers/iio/dac/ad5696-i2c.c | 2 +- 4 files changed, 152 insertions(+), 5

[PATCH v2 2/5] iio: Add output buffer support

2021-02-17 Thread Alexandru Ardelean
after allocating and before registering it. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- Documentation/ABI/testing/sysfs-bus-iio | 7 ++ drivers/iio/industrialio-buffer.c | 128 +++- include/linux/iio/buffer.h | 7 ++ include

[PATCH v2 3/5] iio: kfifo-buffer: Add output buffer support

2021-02-17 Thread Alexandru Ardelean
From: Lars-Peter Clausen Add output buffer support to the kfifo buffer implementation. The implementation is straight forward and mostly just wraps the kfifo API to provide the required operations. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer

[PATCH v2 1/5] iio: Documentation: update definitions for bufferY and scan_elements

2021-02-17 Thread Alexandru Ardelean
be used via the legacy buffer/ directory until they are moved into core. Signed-off-by: Alexandru Ardelean --- Documentation/ABI/testing/sysfs-bus-iio | 85 + 1 file changed, 85 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing

[PATCH v2 0/5] iio: Add output buffer support

2021-02-17 Thread Alexandru Ardelean
nal multibuffer patchset * added 'iio: triggered-buffer: extend support to configure output buffers' - basically output triggered buffer support * added 'iio: dac: ad5686: Add PWM as a trigger source' - this is a first user of this infrastructure Alexandru Ardelean (2): iio: Documentation: upd

[PATCH][RESEND] iio: dac: ad5686: Add support for AD5673R/AD5677R

2021-02-16 Thread Alexandru Ardelean
. Signed-off-by: Mircea Caprioru Signed-off-by: Alexandru Ardelean --- Forgot to include the linux-iio list in the first send. drivers/iio/dac/Kconfig | 5 +++-- drivers/iio/dac/ad5686.c | 12 drivers/iio/dac/ad5686.h | 2 ++ drivers/iio/dac/ad5696-i2c.c | 6 -- 4

[PATCH v4 6/6] tools: iio: add example for high-speed buffer support

2021-02-16 Thread Alexandru Ardelean
), to make sure that the mmap mode is used and not the fileio mode. Signed-off-by: Alexandru Ardelean --- tools/iio/iio_generic_buffer.c | 185 +++-- 1 file changed, 179 insertions(+), 6 deletions(-) diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio

[PATCH v4 5/6] iio: buffer-dma: Add mmap support

2021-02-16 Thread Alexandru Ardelean
a significant overhead. In addition this interface allows more fine grained control over how many blocks are allocated and their size. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-buffer-dma.c | 279 +- .../buffer

[PATCH v4 4/6] iio: buffer-dma: reduce the type of block.size to u32

2021-02-16 Thread Alexandru Ardelean
be enough. The idea is to allocate more blocks if the size of a block grows to 4 GB. Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-buffer-dmaengine.c | 6 +++--- include/linux/iio/buffer-dma.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff

[PATCH v4 3/6] iio: buffer-dma: split iio_dma_buffer_fileio_free() function

2021-02-16 Thread Alexandru Ardelean
A part of the logic in the iio_dma_buffer_exit() is required for the change to add mmap support to IIO buffers. This change splits the logic into a separate function, which will be re-used later. Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-buffer-dma.c | 45

[PATCH v4 2/6] Documentation: iio: add doc for high-speed buffer API

2021-02-16 Thread Alexandru Ardelean
This change takes the comment from the commit that introduces the IIO high-speed buffer API, and formats it into rst format. Signed-off-by: Alexandru Ardelean --- Documentation/iio/iio_high_speed_buffers.rst | 100 +++ Documentation/iio/index.rst | 2

[PATCH v4 1/6] iio: core: Add mmap interface infrastructure

2021-02-16 Thread Alexandru Ardelean
Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 158 ++ include/linux/iio/buffer-dma.h| 5 - include/linux/iio/buffer_impl.h | 23 + include/uapi/linux/iio/buffer.h | 46 + 4 files changed, 227 insertions(+), 5

[PATCH v4 0/6] iio: core: Add mmap interface infrastructure

2021-02-16 Thread Alexandru Ardelean
r the one that are reserved (hopefully) for IIO Tested that mmap() works. Moved (artifically) valid buffer0 as buffer2 and the operation still works. Alexandru Ardelean (4): Documentation: iio: add doc for high-speed buffer API iio: buffer-dma: split iio_dma_buffer_fileio_free() function iio: b

Re: [PATCH v3 0/5] iio: core: Add mmap interface infrastructure

2021-02-16 Thread Alexandru Ardelean
On Tue, Feb 16, 2021 at 10:02 PM Jonathan Cameron wrote: > > On Mon, 15 Feb 2021 16:32:29 +0200 > Alexandru Ardelean wrote: > > > Hi Alex, > > I'm a little nervous about adding the userspace interface used in this > series, but it seems reasonable and as you say below

[PATCH] iio: dac: ad5686: Add support for AD5673R/AD5677R

2021-02-16 Thread Alexandru Ardelean
. Signed-off-by: Mircea Caprioru Signed-off-by: Alexandru Ardelean --- drivers/iio/dac/Kconfig | 5 +++-- drivers/iio/dac/ad5686.c | 12 drivers/iio/dac/ad5686.h | 2 ++ drivers/iio/dac/ad5696-i2c.c | 6 -- 4 files changed, 21 insertions(+), 4 deletions(-) diff

[PATCH v3 4/5] iio: buffer-dma: Add mmap support

2021-02-15 Thread Alexandru Ardelean
a significant overhead. In addition this interface allows more fine grained control over how many blocks are allocated and their size. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-buffer-dma.c | 279 +- .../buffer

[PATCH v3 5/5] tools: iio: add example for high-speed buffer support

2021-02-15 Thread Alexandru Ardelean
), to make sure that the mmap mode is used and not the fileio mode. Signed-off-by: Alexandru Ardelean --- tools/iio/iio_generic_buffer.c | 184 +++-- 1 file changed, 178 insertions(+), 6 deletions(-) diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio

[PATCH v3 3/5] iio: buffer-dma: split iio_dma_buffer_fileio_free() function

2021-02-15 Thread Alexandru Ardelean
A part of the logic in the iio_dma_buffer_exit() is required for the change to add mmap support to IIO buffers. This change splits the logic into a separate function, which will be re-used later. Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-buffer-dma.c | 45

[PATCH v3 2/5] Documentation: iio: add doc for high-speed buffer API

2021-02-15 Thread Alexandru Ardelean
This change takes the comment from the commit that introduces the IIO high-speed buffer API, and formats it into rst format. Signed-off-by: Alexandru Ardelean --- Documentation/iio/iio_high_speed_buffers.rst | 100 +++ Documentation/iio/index.rst | 2

[PATCH v3 1/5] iio: core: Add mmap interface infrastructure

2021-02-15 Thread Alexandru Ardelean
Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 158 ++ include/linux/iio/buffer-dma.h| 5 - include/linux/iio/buffer_impl.h | 23 + include/uapi/linux/iio/buffer.h | 44 + 4 files changed, 225 insertions(+), 5

[PATCH v3 0/5] iio: core: Add mmap interface infrastructure

2021-02-15 Thread Alexandru Ardelean
.c#L51 but will all the ioctl()s organized after the one that are reserved (hopefully) for IIO Tested that mmap() works. Moved (artifically) valid buffer0 as buffer2 and the operation still works. Alexandru Ardelean (3): Documentation: iio: add doc for high-speed buffer API iio: buffer-dma:

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

2021-02-15 Thread Alexandru Ardelean
On Mon, Feb 15, 2021 at 3:59 PM Jonathan Cameron wrote: > > On Mon, 15 Feb 2021 12:40:19 +0200 > Alexandru Ardelean wrote: > > Hi Alex, > > One thought on this that came up whilst reading through it again. > There are several uses for multiple buffers. > 1) input vs o

Re: [PATCH v2 3/3] tools: iio: add example for high-speed buffer support

2021-02-15 Thread Alexandru Ardelean
On Sun, Feb 14, 2021 at 5:58 PM Jonathan Cameron wrote: > > On Fri, 12 Feb 2021 12:11:43 +0200 > Alexandru Ardelean wrote: > > > Following a recent update to the IIO buffer infrastructure, this change > > adds a basic example on how to access an IIO buffer via the

[PATCH v6 24/24] tools: iio: convert iio_generic_buffer to use new IIO buffer API

2021-02-15 Thread Alexandru Ardelean
it Signed-off-by: Alexandru Ardelean --- tools/iio/Makefile | 1 + tools/iio/iio_generic_buffer.c | 122 ++--- tools/iio/iio_utils.c | 13 ++-- tools/iio/iio_utils.h | 4 +- 4 files changed, 107 insertions(+), 33 deletions(-) diff

[PATCH v6 23/24] tools: iio: privatize globals and functions in iio_generic_buffer.c file

2021-02-15 Thread Alexandru Ardelean
Mostly a tidy-up. But also helps to understand the limits of scope of these functions and globals. Signed-off-by: Alexandru Ardelean --- tools/iio/iio_generic_buffer.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/tools/iio

[PATCH v6 21/24] iio: core: rename 'dev' -> 'indio_dev' in iio_device_alloc()

2021-02-15 Thread Alexandru Ardelean
' type objects. It makes grepping a bit easier as well. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-core.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index

  1   2   3   4   5   6   7   8   9   10   >