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

2021-02-14 Thread Alexandru Ardelean
On Sun, Feb 14, 2021 at 3:21 PM Jonathan Cameron wrote: > > On Thu, 11 Feb 2021 14:24:47 +0200 > Alexandru Ardelean wrote: > > > With this change, calling iio_device_attach_buffer() will actually attach > > more buffers. > > Right now this doesn't do an

[PATCH 0/5] iio: kfifo: define a devm_iio_kfifo_buffer_setup helper

2021-02-14 Thread Alexandru Ardelean
hat still needs a bit of work to cleanup the IIO dummy buffer. Related to patchset: https://lore.kernel.org/linux-iio/20201203095005.72252-1-alexandru.ardel...@analog.com/ The IIO dummy driver seems to be one of those blockers in cleaning up some IIO API. Alexandru Ardelean (5): iio: adc: ti_am

[PATCH 4/5] iio: accel: sca3000: use devm_iio_kfifo_buffer_setup() helper

2021-02-14 Thread Alexandru Ardelean
change) it shouldn't be a problem. Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/sca3000.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c index 194738660523..467b5fcb81db 100644 --- a/dr

[PATCH 3/5] iio: make use of devm_iio_kfifo_buffer_setup() helper

2021-02-14 Thread Alexandru Ardelean
setup(). Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/ssp_accel_sensor.c | 14 --- drivers/iio/adc/ina2xx-adc.c | 14 +-- drivers/iio/adc/ti_am335x_adc.c | 18 --- .../cros_ec_sensors/cros_ec_sensors_core.c| 13 --

[PATCH 5/5] iio: kfifo: un-export devm_iio_kfifo_allocate() function

2021-02-14 Thread Alexandru Ardelean
devm_iio_kfifo_buffer_setup() or devm_iio_triggered_buffer_setup() to create a kfifo buffer. Signed-off-by: Alexandru Ardelean --- Documentation/driver-api/driver-model/devres.rst | 1 - drivers/iio/buffer/kfifo_buf.c | 3 +-- include/linux/iio/kfifo_buf.h| 2 -- 3 files

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

2021-02-14 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 --- d

[PATCH 2/5] iio: kfifo: add devm_iio_kfifo_buffer_setup() helper

2021-02-14 Thread Alexandru Ardelean
. So, this should have a more familiar ring to what it is. Signed-off-by: Alexandru Ardelean --- .../driver-api/driver-model/devres.rst| 1 + drivers/iio/buffer/kfifo_buf.c| 39 +++ include/linux/iio/kfifo_buf.h | 7 3 files changed

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

2021-02-14 Thread Alexandru Ardelean
On Sun, Feb 14, 2021 at 4:02 PM Alexandru Ardelean wrote: > > On Sun, Feb 14, 2021 at 3:21 PM Jonathan Cameron wrote: > > > > On Thu, 11 Feb 2021 14:24:47 +0200 > > Alexandru Ardelean wrote: > > > > > With this change, calling iio_device_attach_buffer()

[PATCH] iio: buffer-dma,adi-axi-adc: introduce devm_iio_dmaengine_buffer_setup()

2021-02-14 Thread Alexandru Ardelean
). Since the only user of the devm_iio_dmaengine_buffer_alloc() was the adi-axi-adc driver, this change does the replacement in a single go in the driver. Signed-off-by: Alexandru Ardelean --- Related to https://lore.kernel.org/linux-iio/20210214143313.67202-2-alexandru.ardel...@analog.com/T

Re: [PATCH 0/5] iio: kfifo: define a devm_iio_kfifo_buffer_setup helper

2021-02-14 Thread Alexandru Ardelean
On Sun, Feb 14, 2021 at 5:06 PM Jonathan Cameron wrote: > > On Sun, 14 Feb 2021 16:33:08 +0200 > Alexandru Ardelean wrote: > > > This is a re-spin of an older set [1]: > > > > https://patchwork.kernel.org/project/linux-iio/patch/20200401125936.6398-1

Re: [PATCH 0/5] iio: kfifo: define a devm_iio_kfifo_buffer_setup helper

2021-02-14 Thread Alexandru Ardelean
On Sun, Feb 14, 2021 at 5:06 PM Jonathan Cameron wrote: > > On Sun, 14 Feb 2021 16:33:08 +0200 > Alexandru Ardelean wrote: > > > This is a re-spin of an older set [1]: > > > > https://patchwork.kernel.org/project/linux-iio/patch/20200401125936.6398-1

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

2021-02-15 Thread Alexandru Ardelean
On Sun, Feb 14, 2021 at 4:38 PM Jonathan Cameron wrote: > > On Thu, 11 Feb 2021 14:24:48 +0200 > Alexandru Ardelean wrote: > > > With this change, an ioctl() call is added to open a character device for a > > buffer. The ioctl() number is 'i' 0x91, which foll

[PATCH v6 01/24] iio: adc: ti_am335x_adc: remove omitted iio_kfifo_free()

2021-02-15 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 --- d

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

2021-02-15 Thread Alexandru Ardelean
. So, this should have a more familiar ring to what it is. Signed-off-by: Alexandru Ardelean --- .../driver-api/driver-model/devres.rst| 1 + drivers/iio/buffer/kfifo_buf.c| 39 +++ include/linux/iio/kfifo_buf.h | 7 3 files changed

[PATCH v6 03/24] iio: make use of devm_iio_kfifo_buffer_setup() helper

2021-02-15 Thread Alexandru Ardelean
setup(). Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/ssp_accel_sensor.c | 14 --- drivers/iio/adc/ina2xx-adc.c | 14 +-- drivers/iio/adc/ti_am335x_adc.c | 18 --- .../cros_ec_sensors/cros_ec_sensors_core.c| 13 --

[PATCH v6 04/24] iio: accel: sca3000: use devm_iio_kfifo_buffer_setup() helper

2021-02-15 Thread Alexandru Ardelean
change) it shouldn't be a problem. Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/sca3000.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c index 194738660523..467b5fcb81db 100644 --- a/dr

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

2021-02-15 Thread Alexandru Ardelean
- removed kfree(old) in iio_device_attach_buffer() - made iio_device_attach_buffer() an int return; this means that some follow up patches are needed to make this return value be used; * 'iio: buffer: add ioctl() to support opening extra buffers for IIO device' - tested ioctl() w

[PATCH v6 05/24] iio: kfifo: un-export devm_iio_kfifo_allocate() function

2021-02-15 Thread Alexandru Ardelean
devm_iio_kfifo_buffer_setup() or devm_iio_triggered_buffer_setup() to create a kfifo buffer. Signed-off-by: Alexandru Ardelean --- Documentation/driver-api/driver-model/devres.rst | 1 - drivers/iio/buffer/kfifo_buf.c | 3 +-- include/linux/iio/kfifo_buf.h| 2 -- 3 files

[PATCH v6 06/24] iio: buffer-dma,adi-axi-adc: introduce devm_iio_dmaengine_buffer_setup()

2021-02-15 Thread Alexandru Ardelean
). Since the only user of the devm_iio_dmaengine_buffer_alloc() was the adi-axi-adc driver, this change does the replacement in a single go in the driver. Signed-off-by: Alexandru Ardelean --- .../driver-api/driver-model/devres.rst| 1 + drivers/iio/adc/adi-axi-adc.c | 12

[PATCH v6 08/24] iio: core: register chardev only if needed

2021-02-15 Thread Alexandru Ardelean
ase that reverting this is required, it should be easy enough to do it. 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/industr

[PATCH v6 10/24] iio: core: rework iio device group creation

2021-02-15 Thread Alexandru Ardelean
IIO device. But that would probably annoy a few people since that would make the system less configurable. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h | 3 +++ drivers/iio/industrialio-buffer.c | 12 ++-- drivers/iio/industrialio-core.c| 30

[PATCH v6 09/24] iio: core-trigger: make iio_device_register_trigger_consumer() an int return

2021-02-15 Thread Alexandru Ardelean
Oddly enough the noop function is an int-return. This one seems to be void. This change converts it to int, because we want to change how groups are registered. With that change this function could error out with -ENOMEM. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core_trigger.h

[PATCH v6 07/24] docs: ioctl-number.rst: reserve IIO subsystem ioctl() space

2021-02-15 Thread Alexandru Ardelean
e the 'i' 0x90-0x9F space is reserved for IIO ioctl() calls. Signed-off-by: Alexandru Ardelean --- Documentation/userspace-api/ioctl/ioctl-number.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspa

[PATCH v6 11/24] iio: buffer: group attr count and attr alloc

2021-02-15 Thread Alexandru Ardelean
roups (for buffer/ and scan_elements/), and also a /sys/bus/iio/iio:devicesX/buffer0 attribute group. For buffer1 and above, just a single attribute group will be allocated (the merged one). Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 71 -

[PATCH v6 12/24] iio: core: merge buffer/ & scan_elements/ attributes

2021-02-15 Thread Alexandru Ardelean
paque IIO device object. This way the IIO buffer can have just a single attribute_group object, saving a bit of memory when adding multiple IIO buffers. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 115 +++--- include/linux/iio/buffer_impl.

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

2021-02-15 Thread Alexandru Ardelean
', effectively merging (or finalizing the merge) of the buffer/ & scan_elements/ attributes internally. Accessing these new buffer attributes can now be done via 'to_iio_dev_attr(attr)->buffer' inside the show/store handlers. Signed-off-by: Alexandru Ardel

[PATCH v6 15/24] iio: buffer: dmaengine: obtain buffer object from attribute

2021-02-15 Thread Alexandru Ardelean
The reference to the IIO buffer object is stored on the attribute object. So we need to unwind it to obtain it. Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-buffer-dmaengine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/buffer

[PATCH v6 13/24] iio: add reference to iio buffer on iio_dev_attr

2021-02-15 Thread Alexandru Ardelean
devattr() grows by 1. This looks like it could do with a bit of a re-think. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h| 2 ++ drivers/iio/industrialio-buffer.c | 4 drivers/iio/industrialio-core.c | 6 ++ drivers/iio/industrialio-event.c | 1 + include/li

[PATCH v6 16/24] iio: core: wrap iio device & buffer into struct for character devices

2021-02-15 Thread Alexandru Ardelean
d 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_

[PATCH v6 17/24] iio: buffer: move __iio_buffer_free_sysfs_and_mask() before alloc

2021-02-15 Thread Alexandru Ardelean
in this patch to make the patch that adds multiple buffers per IIO device a bit cleaner. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio

[PATCH v6 18/24] iio: dummy: iio_simple_dummy_buffer: use triggered buffer core calls

2021-02-15 Thread Alexandru Ardelean
this driver as well. One minor drawback is that the pollfunc name may not be 100% identical with the one in the original code, but since it's an example, it should be a big problem. This change does a minor re-arranging of the included iio headers, as a minor tidy-up. Signed-off-by: Alexandr

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

2021-02-15 Thread Alexandru Ardelean
alls. At this point, no driver should call iio_device_attach_buffer() directly, it should call one of the {devm_}iio_triggered_buffer_setup() or devm_iio_kfifo_buffer_setup() or devm_iio_dmaengine_buffer_setup() functions. This makes iio_device_attach_buffer() a bit easier to handle. Signed-off-by

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

2021-02-15 Thread Alexandru Ardelean
--- iio:device0 has some fake kfifo buffers attached to an IIO device. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h| 12 +-- drivers/iio/industrialio-buffer.c | 144 -- include/linux/iio/buffer_impl.h

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

2021-02-15 Thread Alexandru Ardelean
name used around IIO for 'struct iio_dev' 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/industria

[PATCH v6 22/24] tools: iio: make iioutils_get_type() private in iio_utils

2021-02-15 Thread Alexandru Ardelean
#x27;unsigned int' in the iioutils_get_type() function definition. Signed-off-by: Alexandru Ardelean --- tools/iio/iio_utils.c | 9 + tools/iio/iio_utils.h | 4 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c index 7399eb7f1378..a9600

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

2021-02-15 Thread Alexandru Ardelean
data comes from 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 del

[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

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

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

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

2021-02-15 Thread Alexandru Ardelean
https://github.com/analogdevicesinc/libiio/blob/master/local.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): Documen

[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
Peter 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(

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

2021-02-15 Thread Alexandru Ardelean
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 4/5] iio: buffer-dma: Add mmap support

2021-02-15 Thread Alexandru Ardelean
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] 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

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

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

2021-02-16 Thread Alexandru Ardelean
https://github.com/analogdevicesinc/libiio/blob/master/local.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 (4): Documentat

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

2021-02-16 Thread Alexandru Ardelean
Peter 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(

[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 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 4/6] iio: buffer-dma: reduce the type of block.size to u32

2021-02-16 Thread Alexandru Ardelean
should 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 deletion

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

2021-02-16 Thread Alexandru Ardelean
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
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][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

Re: [PATCH v4 0/9] staging: iio: ad7780: move out of staging

2019-03-03 Thread Alexandru Ardelean
On Sun, Mar 3, 2019 at 3:52 PM Renato Lui Geh wrote: > > Hi Alexandru, > > Thanks for the review. Some questions inline. > > Thanks, > Renato > > On 03/01, Ardelean, Alexandru wrote: > >On Thu, 2019-02-28 at 11:23 -0300, Renato Lui Geh wrote: > >> > > > >The patch-series is a bit big. > >I guess t

Re: [PATCH v2] iio: adc: ad7766: Change alignment to match paranthesis

2019-04-24 Thread Alexandru Ardelean
On Tue, Apr 23, 2019 at 11:04 PM Camylla Gonçalves Cantanheide wrote: > > This commit align broken line to match upper line parenthesis, > in lines 80, 130, 237, 242, 255, 264 and 293. Solves the checkpatch.pl's > message: > > CHECK: Alignment should match open parenthesis > >In lines 130, 255, 2

Re: [PATCH] Wqiio: adc: ad7766: Change alignment to match paranthesis

2019-04-24 Thread Alexandru Ardelean
On Tue, Apr 23, 2019 at 11:01 PM Camylla Gonçalves Cantanheide wrote: > > This commit align broken line to match upper line parenthesis, > in lines 80, 130, 237, 242, 255, 264 and 293. Solves the checkpatch.pl's > message: > > CHECK: Alignment should match open parenthesis > > In lines 130, 255,

Re: [PATCH v2] iio: adc: ad7766: Change alignment to match paranthesis

2019-04-24 Thread Alexandru Ardelean
tch with just the ad7766 driver changes. Thanks Alex > Best regards, > Camylla Cantanheide > > Em qua, 24 de abr de 2019 às 04:43, Alexandru Ardelean > escreveu: >> >> On Tue, Apr 23, 2019 at 11:04 PM Camylla Gonçalves Cantanheide >> wrote: >> > >&g

Re: [PATCH 1/2] lib: add __sysfs_match_string_with_gaps() helper

2019-04-26 Thread Alexandru Ardelean
, Greg KH wrote: > > > > > > > > > > > > On Mon, Apr 22, 2019 at 11:32:56AM +0300, Alexandru Ardelean wrote: > > > > > This helper is similar to __sysfs_match_string() with the exception > > > > > that it > > > > >

Re: [PATCH v3 5/7] staging: iio: ad5933: add ABI documentation

2019-03-13 Thread Alexandru Ardelean
On Tue, Mar 12, 2019 at 7:31 PM Marcelo Schmitt wrote: > > On 03/11, Alexandru Ardelean wrote: > > On Sun, Mar 10, 2019 at 7:47 PM Marcelo Schmitt > > wrote: > > > > > > Add an ABI documentation for the ad5933 driver. > > > > There's

Re: [PATCH] staging:iio:ad7152: Rename misspelled RESEVERD -> RESERVED

2019-01-27 Thread Alexandru Ardelean
On Sat, Jan 26, 2019 at 8:09 PM Jonathan Cameron wrote: > > On Fri, 25 Jan 2019 10:19:54 +0200 > Alexandru Ardelean wrote: > > > On Thu, Jan 24, 2019 at 9:35 PM Rodrigo Ribeiro > > wrote: > > > > > > Remove the checkpatch.pl check: > > >

Re: [PATCH v2] iio: adc: ad7476: Add support for ADS786X ADCs

2019-01-27 Thread Alexandru Ardelean
On Sat, Jan 26, 2019 at 8:21 PM Jonathan Cameron wrote: > > On Fri, 25 Jan 2019 11:04:51 +0100 > Ricardo Ribalda Delgado wrote: > > > Add support for ADS7866, ADS7867 and ADS7868 8/10/12 bit Single channel > > ADC. > > I don't want this reply be offensive or anything. But since I've seen this pr

Re: [PATCH v2] iio: adc: ad7476: Add support for ADS786X ADCs

2019-01-27 Thread Alexandru Ardelean
On Mon, Jan 28, 2019 at 9:43 AM Ricardo Ribalda Delgado wrote: > > HI Alexandru > > On Mon, Jan 28, 2019 at 8:38 AM Alexandru Ardelean > wrote: > > > > On Sat, Jan 26, 2019 at 8:21 PM Jonathan Cameron wrote: > > > > > > On Fri, 25 Jan 2019 11:04:

Re: [PATCH v3] iio: adc: ad7476: Add support for TI ADS786X ADCs

2019-01-28 Thread Alexandru Ardelean
On Mon, Jan 28, 2019 at 11:49 AM Ricardo Ribalda Delgado wrote: > > Add support for Texas Instruments ADS7866, ADS7867 and ADS7868 > 8/10/12 bit Single channel ADC. > > Datasheet: http://www.ti.com/lit/ds/symlink/ads7868.pdf > > Cc: Alexandru Ardelean > Signed-off-by:

Re: [PATCH 4/4] staging: iio: ad9832: add devicetree documentation

2019-04-01 Thread Alexandru Ardelean
On Mon, Apr 1, 2019 at 5:38 PM Marcelo Schmitt wrote: > > Add a devicetree documentation for the ad9832 direct digital > synthesizer, waveform generator. > > Signed-off-by: Marcelo Schmitt > --- > .../bindings/iio/frequency/ad9832.txt | 26 +++ > 1 file changed, 26 insert

Re: Work on iio: stating: frequency: ad9832

2019-04-02 Thread Alexandru Ardelean
On Mon, Apr 1, 2019 at 7:13 PM Jonathan Cameron wrote: > > On Mon, 1 Apr 2019 11:25:29 -0300 > Marcelo Schmitt wrote: > > > Hello, > > > > I was looking for some work on staging: iio: ad9832 and made some > > observations while reading the driver. > > > > Apparently it had no devicetree documenta

Re: linux-next: manual merge of the staging tree with the staging.current tree

2019-04-09 Thread Alexandru Ardelean
On Tue, Apr 9, 2019 at 6:40 PM Andy Shevchenko wrote: > > On Mon, Apr 08, 2019 at 01:01:51PM +0100, Jonathan Cameron wrote: > > On Mon, 8 Apr 2019 13:34:37 +0300 > > Andy Shevchenko wrote: > > > On Mon, Apr 08, 2019 at 11:14:39AM +0100, Jonathan Cameron wrote: > > > > On Mon, 8 Apr 2019 13:01:21

[PATCH] lib/scatterlist: introduce sg_nents_for_dma() helper

2019-02-27 Thread Alexandru Ardelean
From: Andy Shevchenko Sometimes the user needs to split each entry on the mapped scatter list due to DMA length constrains. This helper returns a number of entities assuming that each of them is not bigger than supplied maximum length. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandru

[PATCH v2 0/3] iio: core,buffer-dma: add mmap support

2021-02-12 Thread Alexandru Ardelean
libiio: https://github.com/analogdevicesinc/libiio/blob/master/local.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 (1): tools: iio

[PATCH v2 1/3] iio: core: Add mmap interface infrastructure

2021-02-12 Thread Alexandru Ardelean
Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 157 ++ include/linux/iio/buffer-dma.h| 5 - include/linux/iio/buffer_impl.h | 23 + include/uapi/linux/iio/buffer.h | 26 + 4 files changed, 206 insertions(

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

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

[PATCH v2 2/3] iio: buffer-dma: Add mmap support

2021-02-12 Thread Alexandru Ardelean
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 | 314 -- .../buffer

[RFC PATCH 0/5] iio: buffer: add output buffer and cyclic mode

2021-02-12 Thread Alexandru Ardelean
Largely, an adaptation of Lars' work, applied on the IIO multi-buffer support + high-speed/mmap support [1]. Found here: https://github.com/larsclausen/linux/commits/iio-high-speed-5.10 But this isn't tested. [1] Requires that these sets be applied (in this order): * https://lore.kernel.org/lin

[RFC PATCH 1/5] iio: Add output buffer support

2021-02-12 Thread Alexandru Ardelean
after allocating and before registering it. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 110 -- include/linux/iio/buffer.h| 7 ++ include/linux/iio/buffer_impl.h | 11 +++ 3 files changed

[RFC PATCH 3/5] iio: buffer-dma: Allow to provide custom buffer ops

2021-02-12 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

[RFC PATCH 5/5] iio: buffer-dma: add support for cyclic DMA transfers

2021-02-12 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

[RFC PATCH 2/5] iio: kfifo-buffer: Add output buffer support

2021-02-12 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

[RFC PATCH 4/5] iio: buffer-dma: Add output buffer support

2021-02-12 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

Re: [PATCH v2 1/3] iio: core: Add mmap interface infrastructure

2021-02-12 Thread Alexandru Ardelean
On Fri, Feb 12, 2021 at 12:12 PM Alexandru Ardelean wrote: > > From: Lars-Peter Clausen > > Add the necessary infrastructure to the IIO core to support an mmap based > interface to access the capture data. > > The advantage of the mmap based interface compared to the read()

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. &g

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_devattr_l

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

2021-02-22 Thread Alexandru Ardelean
cify 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 deleti

[PATCH v4 01/17] docs: ioctl-number.rst: reserve IIO subsystem ioctl() space

2021-02-10 Thread Alexandru Ardelean
e the 'i' 0x90-0x9F space is reserved for IIO ioctl() calls. Signed-off-by: Alexandru Ardelean --- Documentation/userspace-api/ioctl/ioctl-number.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspa

[PATCH v4 07/17] iio: add reference to iio buffer on iio_dev_attr

2021-02-10 Thread Alexandru Ardelean
devattr() grows by 1. This looks like it could do with a bit of a re-think. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h| 2 ++ drivers/iio/industrialio-buffer.c | 4 drivers/iio/industrialio-core.c | 6 ++ drivers/iio/industrialio-event.c | 1 + include/li

[PATCH v4 02/17] iio: core: register chardev only if needed

2021-02-10 Thread Alexandru Ardelean
ase that reverting this is required, it should be easy enough to do it. 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/industr

[PATCH v4 03/17] iio: core-trigger: make iio_device_register_trigger_consumer() an int return

2021-02-10 Thread Alexandru Ardelean
Oddly enough the noop function is an int-return. This one seems to be void. This change converts it to int, because we want to change how groups are registered. With that change this function could error out with -ENOMEM. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core_trigger.h

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

2021-02-10 Thread Alexandru Ardelean
te' * add tools/iio patches for new multibuffer logic tools: iio: make iioutils_get_type() private in iio_utils tools: iio: privatize globals and functions in iio_generic_buffer.c file tools: iio: convert iio_generic_buffer to use new IIO buffer API Alexandru Ardelean (17): docs: i

[PATCH v4 04/17] iio: core: rework iio device group creation

2021-02-10 Thread Alexandru Ardelean
IIO device. But that would probably annoy a few people since that would make the system less configurable. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h | 3 +++ drivers/iio/industrialio-buffer.c | 12 ++-- drivers/iio/industrialio-core.c| 30

[PATCH v4 08/17] iio: buffer: wrap all buffer attributes into iio_dev_attr

2021-02-10 Thread Alexandru Ardelean
', effectively merging (or finalizing the merge) of the buffer/ & scan_elements/ attributes internally. Accessing these new buffer attributes can now be done via 'to_iio_dev_attr(attr)->buffer' inside the show/store handlers. Signed-off-by: Alexandru Ardel

[PATCH v4 11/17] iio: buffer: move __iio_buffer_free_sysfs_and_mask() before alloc

2021-02-10 Thread Alexandru Ardelean
in this patch to make the patch that adds multiple buffers per IIO device a bit cleaner. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio

[PATCH v4 14/17] iio: core: rename 'dev' -> 'indio_dev' in iio_device_alloc()

2021-02-10 Thread Alexandru Ardelean
name used around IIO for 'struct iio_dev' 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/industria

[PATCH v4 15/17] tools: iio: make iioutils_get_type() private in iio_utils

2021-02-10 Thread Alexandru Ardelean
#x27;unsigned int' in the iioutils_get_type() function definition. Signed-off-by: Alexandru Ardelean --- tools/iio/iio_utils.c | 9 + tools/iio/iio_utils.h | 4 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c index 7399eb7f1378..a9600

[PATCH v4 16/17] tools: iio: privatize globals and functions in iio_generic_buffer.c file

2021-02-10 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 v4 17/17] tools: iio: convert iio_generic_buffer to use new IIO buffer API

2021-02-10 Thread Alexandru Ardelean
s: 1. Tested buffer0 works with ioctl() 2. Tested that buffer0 can't be opened via /dev/iio:deviceX after ioctl() 3. Moved valid buffer0 to be buffer1, and tested that data comes from it Signed-off-by: Alexandru Ardelean --- tools/iio/Makefile | 1 + tools/iio/iio_generic_buff

[PATCH v4 13/17] iio: buffer: add ioctl() to support opening extra buffers for IIO device

2021-02-10 Thread Alexandru Ardelean
--- iio:device0 has some fake kfifo buffers attached to an IIO device. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h| 12 +-- drivers/iio/industrialio-buffer.c | 137 -- drivers/iio/industrialio-core.c

[PATCH v4 09/17] iio: buffer: dmaengine: obtain buffer object from attribute

2021-02-10 Thread Alexandru Ardelean
The reference to the IIO buffer object is stored on the attribute object. So we need to unwind it to obtain it. Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-buffer-dmaengine.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/buffer

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

2021-02-10 Thread Alexandru Ardelean
d 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_

[PATCH v4 12/17] iio: buffer: introduce support for attaching more IIO buffers

2021-02-10 Thread Alexandru Ardelean
be realloc-ed for more buffers. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h| 2 + drivers/iio/industrialio-buffer.c | 96 +-- drivers/iio/industrialio-core.c | 6 +- include/linux/iio/buffer.h| 4 +- include/linux/iio/buffer_imp

[PATCH v4 06/17] iio: core: merge buffer/ & scan_elements/ attributes

2021-02-10 Thread Alexandru Ardelean
paque IIO device object. This way the IIO buffer can have just a single attribute_group object, saving a bit of memory when adding multiple IIO buffers. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 115 +++--- include/linux/iio/buffer_impl.

  1   2   3   4   5   6   7   8   9   10   >