[PATCH v2 1/8] iio: proximity: ping: pass reference to IIO device via call-stack

2020-05-14 Thread Alexandru Ardelean
to the change of iio_priv_to_dev(). Signed-off-by: Alexandru Ardelean --- drivers/iio/proximity/ping.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/proximity/ping.c b/drivers/iio/proximity/ping.c index 12b893c5b0ee..ddc43a5a2ef8 100644 --- a/drivers/iio/proximity

[PATCH v2 7/8] iio: core: simplify alloc alignment code

2020-05-14 Thread Alexandru Ardelean
to iio_dev_priv. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-core.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index a1b29e0f8fd6..7671d36efae7 100644 --- a/drivers/iio/industrialio

[PATCH v2 8/8] iio: core: move debugfs data on the private iio dev info

2020-05-14 Thread Alexandru Ardelean
This change moves all iio_dev debugfs fields to the iio_dev_priv object. It's not the biggest advantage yet (to the whole thing of abstractization) but it's a start. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-core.c | 40 ++--- include/linux/iio

[PATCH v2 6/8] iio: core: wrap IIO device into an iio_dev_opaque object

2020-05-14 Thread Alexandru Ardelean
via this header. Otherwise, only the IIO core files should include this file. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-core.c | 27 ++- include/linux/iio/iio-opaque.h | 17 + include/linux/iio/iio.h | 11 +-- 3 files changed,

[PATCH v2 4/8] iio: stm32-dfsdm-adc: pass iio device as arg for the interrupt handler

2020-05-14 Thread Alexandru Ardelean
will still be fast enough, as it will return a void pointer from the public IIO device structure. So it's better to switch the order. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/stm32-dfsdm-adc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/stm32

[PATCH v2 3/8] iio: at91_adc: pass ref to IIO device via param for int function

2020-05-14 Thread Alexandru Ardelean
to the change of iio_priv_to_dev(). The function gets called in an interrupt context. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/at91_adc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 0368b6dc6d60

[PATCH v2 0/8] iio: core: wrap IIO device into an iio_dev_opaque object

2020-05-14 Thread Alexandru Ardelean
h' header; it's still implemented with some pointer arithmetic; one idea was to do it via an 'indio_dev->opaque' field; that may still be an optionif there are some opinions in that direction Alexandru Ardelean (8): iio: proximity: ping: pass reference to IIO device via call-stack iio: at91

[PATCH v2 5/8] iio: stm32-adc: pass iio device as arg for the interrupt handler

2020-05-14 Thread Alexandru Ardelean
will still be fast enough, as it will return a void pointer from the public IIO device structure. So it's better to switch the order. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/stm32-adc.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/stm32

[PATCH v2 2/8] iio: at91-sama5d2_adc: pass ref to IIO device via param for int function

2020-05-14 Thread Alexandru Ardelean
making it immune to the change of iio_priv_to_dev(). The function gets called in an interrupt context. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/at91-sama5d2_adc.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio

[PATCH] iio: buffer: remove attrcount_orig var from sysfs creation

2020-05-11 Thread Alexandru Ardelean
The variable no longer does anything. It should have been removed with commit 2e036804d773e ("iio: buffer: remove 'scan_el_attrs' attribute group from buffer struct"). That was about the last time this was needed. Signed-off-by: Alexandru Ardelean --- If desired (and still possible

[PATCH 1/2] staging: iio: ad5933: attach life-cycle of kfifo buffer to parent device

2020-05-08 Thread Alexandru Ardelean
This change makes the use of devm_iio_kfifo_allocate() to attach the life-cycle of the kfifo buffer to the parent (client->dev) object. This removes the need to explicitly free 'indio_dev->buffer' via iio_kfifo_free(), which is the main intent. Signed-off-by: Alexandru Ardelean --- d

[PATCH 2/2] staging: iio: ad5933: convert probe init to use device managed callbacks

2020-05-08 Thread Alexandru Ardelean
This change moves the clock & regulator disable to use the devm_add_action_or_reset() callback and uses the devm_iio_device_register() to register the IIO device. With this, it should be now possible to get rid of the remove callback. Signed-off-by: Alexandru Ardelean --- .../staging

[PATCH 1/3] iio: core: wrap IIO device into a iio_dev_priv object

2020-05-08 Thread Alexandru Ardelean
thmetic will not match once things are moved. Signed-off-by: Alexandru Ardelean --- Just as a note here, I've been running this patchset without a problem for 2 weeks now in a work branch. But it's only been a setup, so no idea if some other thing may cause bigger issues. This small patchset is meant to ki

[PATCH 2/3] iio: core: simplify alloc alignment code

2020-05-08 Thread Alexandru Ardelean
to iio_dev_priv. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-core.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index f0888dd84d3d..b924197b5984 100644 --- a/drivers/iio/industrialio

[PATCH 3/3] iio: core: move debugfs data on the private iio dev info

2020-05-08 Thread Alexandru Ardelean
This change moves all iio_dev debugfs fields to the iio_dev_priv object. It's not the biggest advantage yet (to the whole thing of abstractization) but it's a start. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h | 10 + drivers/iio/industrialio-core.c | 40

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

2020-05-08 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/14] iio: buffer: split buffer sysfs creation to take buffer as primary arg

2020-05-08 Thread Alexandru Ardelean
Currently the iio_buffer_{alloc,free}_sysfs_and_mask() take 'indio_dev' as primary argument. This change converts to take an IIO buffer as a primary argument. That will allow the functions to get called for multiple buffers. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio

[RFC PATCH 10/14] iio: buffer: remove attrcount_orig var from sysfs creation

2020-05-08 Thread Alexandru Ardelean
The variable no longer does anything. It's around because of some older code that required it to keep track of certain attribute numbers. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio

[RFC PATCH 13/14] iio: unpack all iio buffer attributes correctly

2020-05-08 Thread Alexandru Ardelean
of iio_buffer_set_attrs() somehow. Or, to maybe allocate some wrapper device-attributes. With this change, IIO still needs (to work with the older ABI): - symlink the chardev of the first IIO buffer device to the IIO device Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/adxl372.c

[RFC PATCH 12/14] iio: buffer: symlink the scan_elements dir back into IIO device's dir

2020-05-08 Thread Alexandru Ardelean
to unpack to IIO buffers and not IIO devices - symlink the chardev of the first IIO buffer device to the IIO device Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 149 -- include/linux/iio/buffer_impl.h | 7 +- 2 files changed, 122

[RFC PATCH 14/14] iio: buffer: convert single buffer to list of buffers

2020-05-08 Thread Alexandru Ardelean
WIP Time to add support for multiple buffers. At this point it should be just managing a list. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-buffer.c | 74 ++- drivers/iio/industrialio-core.c | 1 + include/linux/iio/buffer_impl.h | 3

[RFC PATCH 11/14] iio: buffer: add underlying device object and convert buffers to devices

2020-05-08 Thread Alexandru Ardelean
to the IIO device - symlink the chardev of the first IIO buffer device to the IIO device Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h| 11 ++-- drivers/iio/industrialio-buffer.c | 98 --- drivers/iio/industrialio-core.c | 39

[RFC PATCH 05/14] iio: core: register chardev only if needed

2020-05-08 Thread Alexandru Ardelean
IDs for the chardev could outpace the IDs for IIO devices, so these should be decoupled. Signed-off-by: Alexandru Ardelean --- drivers/iio/industrialio-core.c | 58 + 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/

[RFC PATCH 08/14] iio: core: use new common ioctl() mechanism

2020-05-08 Thread Alexandru Ardelean
alls, and since each buffer will get it's own chardev, the buffer ioctl() handler will need a bit of tweaking for the first/legacy buffer (i.e. indio_dev->buffer). Also, those per-buffer ioctl() calls will not be registered with this mechanism. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio

[RFC PATCH 07/14] iio: core: add simple centralized mechanism for ioctl() handlers

2020-05-08 Thread Alexandru Ardelean
-by: Alexandru Ardelean --- drivers/iio/iio_core.h | 14 ++ drivers/iio/industrialio-core.c | 33 + include/linux/iio/iio.h | 2 ++ 3 files changed, 49 insertions(+) diff --git a/drivers/iio/iio_core.h b/drivers/iio/iio_core.h index

[RFC PATCH 02/14] iio: hw_consumer: use new scanmask functions

2020-05-08 Thread Alexandru Ardelean
From: Lars-Peter Clausen This change moves the handling of the scanmasks to the new wrapper functions that were added in a previous commit. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-hw-consumer.c | 19 ++- 1 file

[RFC PATCH 06/14] iio: buffer,event: duplicate chardev creation for buffers & events

2020-05-08 Thread Alexandru Ardelean
the core file. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h| 16 ++--- drivers/iio/industrialio-buffer.c | 90 +--- drivers/iio/industrialio-core.c | 99 +++ drivers/iio/industrialio

[RFC PATCH 01/14] iio: Move scan mask management to the core

2020-05-08 Thread Alexandru Ardelean
Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-buffer-cb.c | 16 - drivers/iio/industrialio-buffer.c | 36 +++-- drivers/iio/inkern.c| 15 + include/linux/iio/consumer.h| 10 ++ 4 files changed

[RFC PATCH 04/14] iio: core,buffer: wrap iio_buffer_put() call into iio_buffers_put()

2020-05-08 Thread Alexandru Ardelean
The name (and the wrapper) seems superfluous now, but when more buffers will be attached to the IIO device this will be a bit more useful. Signed-off-by: Alexandru Ardelean --- drivers/iio/iio_core.h| 4 drivers/iio/industrialio-buffer.c | 10 ++ drivers/iio

[RFC PATCH 00/14] iio: buffer: add support for multiple buffers

2020-05-08 Thread Alexandru Ardelean
ffer3:0' -> 'iio:device3/buffer0'? What else should I consider moving forward? What means forward? Where did I leave my beer? Well, if you've found my beer, it means you got this far :) Thanks for reading all of this [including this bit of quarantine humor]. Alexandru Ardelean (12): iio

[PATCH] iio: imu: adis16xxx: use helper to access iio core debugfs dir

2020-04-30 Thread Alexandru Ardelean
The IIO core provides a iio_get_debugfs_dentry() helper. It seems that the ADIS IMU drivers access that field directly. This change converts them to use iio_get_debugfs_dentry() instead. Signed-off-by: Alexandru Ardelean --- drivers/iio/gyro/adis16136.c | 10 -- drivers/iio/imu

[PATCH] iio: remove iio_get_debugfs_dentry() helper

2020-04-30 Thread Alexandru Ardelean
Not used anywhere. Looks like it was forgotten in iio.h Signed-off-by: Alexandru Ardelean --- include/linux/iio/iio.h | 16 1 file changed, 16 deletions(-) diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 38c4ea505394..1a1da52c55cf 100644 --- a/include

[RFC PATCH] iio: __iio_update_buffers: Update mode before preenable/after postdisable

2020-04-30 Thread Alexandru Ardelean
postdisable() enables us to have drivers which perform mode dependent actions in those callbacks. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- This patch is also a V2 of this older patch from a while ago: https://lore.kernel.org/linux-iio/1431525891-19285-5-git-send

[PATCH v2 1/2] iio: Move scan mask management to the core

2020-04-29 Thread Alexandru Ardelean
, this change abstracts scan-mask management away from buffer implementations. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- Changelog v1 -> v2: - split away from initial series; the `buffer->channel_mask` attribute requires a bit more dicussion; or may even be dropped

[PATCH v2 2/2] iio: hw_consumer: use new scanmask functions

2020-04-29 Thread Alexandru Ardelean
From: Lars-Peter Clausen This change moves the handling of the scanmasks to the new wrapper functions that were added in a previous commit. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/buffer/industrialio-hw-consumer.c | 19 ++- 1 file

[PATCH] staging: iio: ad2s1210: Fix SPI reading

2020-04-29 Thread Alexandru Ardelean
into 2 transfers with a single byte, and CS change in-between. Signed-off-by: Dragos Bogdan Signed-off-by: Alexandru Ardelean --- drivers/staging/iio/resolver/ad2s1210.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1210.c

[PATCH 2/3] iio: adc: ti_am335x_adc: alloc kfifo & IRQ via devm_ functions

2020-04-28 Thread Alexandru Ardelean
_kfifo_free(indio_dev->buffer);'. As we want to add support for multiple buffers per IIO device, having it exposed like this makes it tricky to consider a safe backwards compatible approach for it. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/ti_am335x_adc.c | 20 +--- 1 f

[PATCH 3/3] iio: adc: ti_am335x_adc: convert rest of probe to devm_ functions

2020-04-28 Thread Alexandru Ardelean
work the DMA channel is cleaned up manually inside the probe hook. This done (like this) because the remove hook has a peculiar cleanup that tries to restore a step-mask, and that only seems to happen on the remove hook, and not in any probe error-cleanup paths. Signed-off-by: Alexandru Arde

[PATCH 1/3] iio: adc: ti_am335x_adc: alloc channels via devm_kcalloc()

2020-04-28 Thread Alexandru Ardelean
This change attaches the life-cycle of the channels array to the parent device object that is attached to the IIO device. This way we can remove from the cleanup code, the explicit tiadc_channels_remove() which simply does a kfree() on the channels array. Signed-off-by: Alexandru Ardelean

[PATCH] staging: iio: ad5933: rework probe to use devm_ function variants

2020-04-28 Thread Alexandru Ardelean
This change cleans up the driver's probe function to use only devm_ function variants. This also gets rid of the remove function and moves the clock & regulator de-initializations to the 'ad5933_cleanup()' callback. Signed-off-by: Alexandru Ardelean --- .../staging/iio/impedance-analyzer/ad

[PATCH] iio: hdc100x: fix iio_triggered_buffer_{predisable,postenable} positions

2019-10-23 Thread Alexandru Ardelean
The iio_triggered_buffer_postenable() hook should be called first to attach the poll function and the iio_triggered_buffer_predisable() hook should be called last in the predisable hook. This change updates the driver to attach/detach the poll func in the correct order. Signed-off-by: Alexandru

[PATCH] iio: at91-sama5d2_adc: fix iio_triggered_buffer_{predisable,postenable} positions

2019-10-23 Thread Alexandru Ardelean
-off-by: Alexandru Ardelean --- drivers/iio/adc/at91-sama5d2_adc.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c index e1850f3d5cf3..ac3e5c4c9840 100644 --- a/drivers/iio/adc/

[PATCH] iio: dln2-adc: fix iio_triggered_buffer_postenable() position

2019-10-23 Thread Alexandru Ardelean
() on the error paths of the postenable hook. For the predisable hook, some code-paths have been changed to make sure that the iio_triggered_buffer_predisable() hook gets called in case there is an error before it. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/dln2-adc.c | 20 ++-- 1

[PATCH][RESEND] input: adp5589: Make keypad support optional

2019-10-23 Thread Alexandru Ardelean
From: Lars-Peter Clausen On some platforms the adp5589 is used in GPIO only mode. On these platforms we do not want to register a input device, so make that optional and only create the input device if a keymap is supplied. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean

[PATCH] spi: document CS setup, hold & inactive times in header

2019-10-23 Thread Alexandru Ardelean
This change documents the CS setup, host & inactive times. They were omitted when the fields were added, and were caught by one of the build bots. Fixes: 25093bdeb6bc ("spi: implement SW control for CS times") Reported-by: kbuild test robot Signed-off-by: Alexandru Ardelean ---

[PATCH v2] media: adv7604: extend deep color mode to ADV7611

2019-10-18 Thread Alexandru Ardelean
Signed-off-by: Alexandru Ardelean --- Changelog v1 -> v2: * address checkpatch complaints about 80 col limit and use of `unsigned` vs `unsigned int` drivers/media/i2c/adv7604.c | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/me

[PATCH] media: adv7604: extend deep color mode to ADV7611

2019-10-18 Thread Alexandru Ardelean
Signed-off-by: Alexandru Ardelean --- drivers/media/i2c/adv7604.c | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 28a84bf9f8a9..5384c40eed7d 100644 --- a/drivers/media/i2c

[PATCH] staging: rtl8188eu: make efuse_power_switch() function static

2019-10-16 Thread Alexandru Ardelean
. An alternative solution would have been to rename the function, but it doesn't look like it's being used outside of this driver, so just make it static. Signed-off-by: Alexandru Ardelean --- drivers/staging/rtl8188eu/core/rtw_efuse.c| 2 +- drivers/staging/rtl8188eu/include/rtw_efuse.h | 1

[PATCH v3][RESEND] adp5061: Add support for charging voltage limit enable

2019-10-11 Thread Alexandru Ardelean
was provided to examine and modify this attribute on the fly. Signed-off-by: Stefan Popa Signed-off-by: Alexandru Ardelean --- I could not find any traces about this patch being denied and why. So this is a RESEND to [re]trigger a discussion if needed. .../ABI/testing/sysfs-class-power

[PATCH v3][RESEND] adp5061: Add support for battery charging enable

2019-10-11 Thread Alexandru Ardelean
From: Stefan Popa This patch adds the option to enable/disable battery charging. This option is not configurable via the power_supply properties, therefore, access via sysfs was provided to examine and modify this attribute on the fly. Signed-off-by: Stefan Popa Signed-off-by: Alexandru

[PATCH v2] iio: imu: adis16480: make sure provided frequency is positive

2019-10-08 Thread Alexandru Ardelean
: imu: adis16480 switch sampling frequency attr to core support") Signed-off-by: Alexandru Ardelean --- Changelog v1 -> v2: * also check that val & val2 are not negative (in addition to checking if 't' is zero drivers/iio/imu/adis16480.c | 5 - 1 file changed, 4 insertions(+), 1 deleti

[PATCH][RESEND] input: adp5589: Make keypad support optional

2019-09-27 Thread Alexandru Ardelean
From: Lars-Peter Clausen On some platforms the adp5589 is used in GPIO only mode. On these platforms we do not want to register a input device, so make that optional and only create the input device if a keymap is supplied. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean

[PATCH 1/2][RESEND] ASoC: adau1761: Add PGA Slew time control

2019-09-26 Thread Alexandru Ardelean
control parts of the ALC (automatic level control) block. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- sound/soc/codecs/adau1761.c | 20 1 file changed, 20 insertions(+) diff --git a/sound/soc/codecs/adau1761.c b/sound/soc/codecs/adau1761.c index

[PATCH 2/2][RESEND] ASoC: adau1761: Add ALC controls

2019-09-26 Thread Alexandru Ardelean
From: Lars-Peter Clausen The adau1761 has a automatic level control block that can adjust the gain for the differential input PGA. This patch adds ALSA controls for enabling and changing the parameter settings for the ALC. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean

[PATCH 07/10] iio: imu: adis: group single conversion under a single state lock

2019-09-26 Thread Alexandru Ardelean
Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/adis.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c index 7468294d1776..5e28464ea05b 100644 --- a/drivers/iio/imu/adis.c +++ b/drivers/iio/imu/adis.c @@ -404,15

[PATCH 08/10] iio: imu: adis16400: rework locks using ADIS library's state lock

2019-09-26 Thread Alexandru Ardelean
ases where only one read/write is done, the functions that hold the state lock are used. Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/adis16400.c | 51 ++--- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/drivers/iio/imu/adis16400.c b/dri

[PATCH 05/10] iio: imu: adis: create an unlocked version of adis_reset()

2019-09-26 Thread Alexandru Ardelean
The reset routine may also be important to be protected by the state-lock and grouped with other operations, so create an unlocked version, so that this can be done. Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/adis.c | 8 include/linux/iio/imu/adis.h | 19

[PATCH 06/10] iio: imu: adis: protect initial startup routine with state lock

2019-09-26 Thread Alexandru Ardelean
. Behaviourally nothing should change, but this should make the library function a bit more robust. Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/adis.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c index

[PATCH 09/10] iio: gyro: adis16136: rework locks using ADIS library's state lock

2019-09-26 Thread Alexandru Ardelean
This replaces indio_dev's mlock with the state lock/mutex from the ADIS library. The __adis16136_get_freq() function has been prefixed to mark it as unlocked. The adis16136_{set,get}_filter() functions now hold the state lock for all the ops that they do. Signed-off-by: Alexandru Ardelean

[PATCH 10/10] iio: imu: adis16480: use state lock for filter freq set

2019-09-26 Thread Alexandru Ardelean
It's the only operation that does 2 operations (a read & a write), so the unlocked functions can be used under a single state lock. Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/adis16480.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH 00/10] iio: imu: adis: cleanup lock usage

2019-09-26 Thread Alexandru Ardelean
een consecutive read/write ops. As such, all users of the ADIS lib have been verified to have their usage of mlock checked. Some just needed the mlock usage removed (as done in other patches). Alexandru Ardelean (10): iio: imu: adis: rename txrx_lock -> state_lock iio: imu: adis: add unlocked read

[PATCH 04/10] iio: imu: adis: create an unlocked version of adis_check_status()

2019-09-26 Thread Alexandru Ardelean
This one also gets re-used in certain operations, so it makes sense to have an unlocked version of this to group it with other reads/writes/operations to have a single lock for the whole state change. Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/adis.c | 8 include

[PATCH 03/10] iio: imu: adis[16480]: group RW into a single lock in adis_enable_irq()

2019-09-26 Thread Alexandru Ardelean
The adis_enable_irq() does a read & a write. This change keeps a lock for the duration of both operations vs for each op. The change is also needed in adis16480, since that has it's own implementation for adis_enable_irq(). Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/adis.c

[PATCH 01/10] iio: imu: adis: rename txrx_lock -> state_lock

2019-09-26 Thread Alexandru Ardelean
patches, will be to add some unlocked versions for read/write_reg functions. Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/adis.c| 10 +- drivers/iio/imu/adis_buffer.c | 4 ++-- include/linux/iio/imu/adis.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git

[PATCH 02/10] iio: imu: adis: add unlocked read/write function versions

2019-09-26 Thread Alexandru Ardelean
ned-off-by: Alexandru Ardelean --- drivers/iio/imu/adis.c | 34 +-- include/linux/iio/imu/adis.h | 114 ++- 2 files changed, 128 insertions(+), 20 deletions(-) diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c index 3c2d896e3a96..4f3be011c898

[PATCH v4 04/19] spi: sprd: convert transfer word delay to spi_delay struct

2019-09-26 Thread Alexandru Ardelean
The Spreadtrum SPI driver is the only user of the `word_delay` field in the `spi_transfer` struct. This change converts the field to use the `spi_delay` struct. This also enforces the users to specify the delay unit to be `SPI_DELAY_UNIT_SCK`. Signed-off-by: Alexandru Ardelean --- drivers/spi

[PATCH v4 02/19] spi: introduce spi_delay struct as "value + unit" & spi_delay_exec()

2019-09-26 Thread Alexandru Ardelean
lay_exec()` function that processes a `spi_delay` object/struct to execute the delay. It's a copy of the `cs_change_delay` mechanism, but without the default for 10 uS. The clock-cycle delay unit is a bit special, as it needs to be bound to an `spi_transfer` object to execute. Signed-off-by: Alexandru

[PATCH v4 06/19] spi: spidev: use new `word_delay` field for spi transfers

2019-09-26 Thread Alexandru Ardelean
` to `SPI_DELAY_UNIT_USECS` This keeps the uapi for spidev un-changed. Changing it can be part of another changeset and discussion. Signed-off-by: Alexandru Ardelean --- drivers/spi/spidev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index

[PATCH v4 18/19] spi: bcm63xx: extend error condition to `delay` as well

2019-09-26 Thread Alexandru Ardelean
The driver errors out if `delay_usecs` is non-zero. This error condition should be extended to the new `delay` field, to account for when it will be used. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-bcm63xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH v4 17/19] spi: spi-falcon: extend warning to `delay` as well

2019-09-26 Thread Alexandru Ardelean
The WARN_ON macro prints a warning in syslog if `delay_usecs` is non-zero. However, with the new intermediate `delay`, the warning should also be printed. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-falcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH v4 19/19] spi: spi-axi: extend support for the `delay` field

2019-09-26 Thread Alexandru Ardelean
The AXI SPI engine driver uses the `delay_usecs` field from `spi_transfer` to configure delays, which the controller will execute. This change extends the logic to also include the `delay` value, in case it is used (instead if `delay_usecs`). Signed-off-by: Alexandru Ardelean --- drivers/spi

[PATCH v4 16/19] spi: spi-fsl-espi: convert transfer delay to `spi_delay` format

2019-09-26 Thread Alexandru Ardelean
The way the max delay is computed for this controller, it looks like it is searching for the max delay from an SPI message a using that. No idea if this is valid. But this change should support both `delay_usecs` and the new `delay` data which is of `spi_delay` type. Signed-off-by: Alexandru

[PATCH v4 13/19] spi: spidev: use new `delay` field for spi transfers

2019-09-26 Thread Alexandru Ardelean
for spidev un-changed. Changing it can be part of another changeset and discussion. Signed-off-by: Alexandru Ardelean --- drivers/spi/spidev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 495319c2fa11..6b6afd27f4a1 100644

[PATCH v4 05/19] spi: orion: use new `word_delay` field for SPI transfers

2019-09-26 Thread Alexandru Ardelean
-by: Alexandru Ardelean --- drivers/spi/spi-orion.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c index 6643ccdc2508..756c37e32dfe 100644 --- a/drivers/spi/spi-orion.c +++ b/drivers/spi/spi-orion.c @@ -467,8 +467,7

[PATCH v4 14/19] spi: tegra114: change format for `spi_set_cs_timing()` function

2019-09-26 Thread Alexandru Ardelean
longer to start transferring that after CS is asserted. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-tegra114.c | 22 -- drivers/spi/spi.c | 16 ++-- include/linux/spi/spi.h| 9 ++--- 3 files changed, 36 insertions(+), 11 deletions(-) diff

[PATCH v4 12/19] spi: spi-loopback-test: use new `delay` field

2019-09-26 Thread Alexandru Ardelean
This change replaces the use of the `delay_usecs` field with the new `delay` field. The code/test still uses micro-seconds, but they are now configured and used via the `struct spi_delay` format of the `delay` field. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-loopback-test.c | 12

[PATCH v4 15/19] spi: implement SW control for CS times

2019-09-26 Thread Alexandru Ardelean
call. Software-mode for CS control, implies that the `set_cs_timing()` hook has not been provided for the `spi_controller` object. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi.c | 45 - include/linux/spi/spi.h | 5 + 2 files changed, 49 insert

[PATCH v4 09/19] spi: use new `spi_transfer_delay_exec` helper where straightforward

2019-09-26 Thread Alexandru Ardelean
in all places (in the spi drivers) where this change is simple. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-atmel.c | 3 +-- drivers/spi/spi-bcm63xx-hsspi.c | 3 +-- drivers/spi/spi-cavium.c| 3 +-- drivers/spi/spi-fsl-dspi.c | 3 +-- drivers/spi/spi-fsl-

[PATCH v4 11/19] spi: tegra20-sflash: use to new `spi_transfer_delay_exec`

2019-09-26 Thread Alexandru Ardelean
compatibility with the old `delay_usecs` field. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-tegra20-sflash.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c index cd714a4f52c6..ff1933e55830 100644

[PATCH v4 10/19] spi: tegra114: use `spi_transfer_delay_exec` helper

2019-09-26 Thread Alexandru Ardelean
a mention in that commit message to suggest a specific need/use-case for having the 2 delay calls. For the most part, udelay() should be sufficient. This change replaces it with the new `spi_transfer_delay_exec()`, which should do the same thing. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-tegra

[PATCH v4 08/19] spi: introduce `delay` field for `spi_transfer` + spi_transfer_delay_exec()

2019-09-26 Thread Alexandru Ardelean
, which maintains backwards compatibility with `delay_usecs`, by assigning the value to `delay` if non-zero. This should maintain backwards compatibility with current users of `udelay_usecs`. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi.c | 6 +++--- include/linux/spi/spi.h | 18

[PATCH v4 00/19] spi: introduce `struct spi_delay` data-type

2019-09-26 Thread Alexandru Ardelean
e discussion and refinement. Alexandru Ardelean (19): spi: move `cs_change_delay` backwards compat logic outside switch spi: introduce spi_delay struct as "value + unit" & spi_delay_exec() spi: make `cs_change_delay` the first user of the `spi_delay` logic spi: sprd: convert tran

[PATCH v4 01/19] spi: move `cs_change_delay` backwards compat logic outside switch

2019-09-26 Thread Alexandru Ardelean
The `cs_change_delay` backwards compatibility value could be moved outside of the switch statement. The only reason to do it, is to make the next patches easier to diff. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions

[PATCH v4 03/19] spi: make `cs_change_delay` the first user of the `spi_delay` logic

2019-09-26 Thread Alexandru Ardelean
-by: Alexandru Ardelean --- drivers/iio/imu/adis.c | 24 drivers/spi/spi.c | 28 +++- include/linux/spi/spi.h | 4 +--- 3 files changed, 20 insertions(+), 36 deletions(-) diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c index 1631c255deab

[PATCH v4 07/19] spi: core,atmel: convert `word_delay_usecs` -> `word_delay` for spi_device

2019-09-26 Thread Alexandru Ardelean
eds that both delays be converted to a common unit (nano-seconds) for comparison. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi-atmel.c | 26 -- drivers/spi/spi.c | 24 ++-- include/linux/spi/spi.h | 7 ++- 3 files changed, 48 insertions(+)

[PATCH] dt-bindings: net: remove un-implemented property

2019-09-18 Thread Alexandru Ardelean
-Down for the `adin` PHY, so this device-tree is not needed. Fixes: 767078132ff9 ("dt-bindings: net: add bindings for ADIN PHY driver") Signed-off-by: Alexandru Ardelean --- Documentation/devicetree/bindings/net/adi,adin.yaml | 7 --- 1 file changed, 7 deletions(-) diff --git a/Doc

[PATCH] dt-bindings: net: dwmac: fix 'mac-mode' type

2019-09-17 Thread Alexandru Ardelean
as part of phylib or netdev. In any case, the 'mac-mode' field should be made an enum, and it also makes sense to just reference the 'phy-connection-type' from 'ethernet-controller.yaml'. That will also make it more future-proof for new modes. Signed-off-by: Alexandru Ardelean --- Documentation

[PATCH v5 2/2] net: phy: adin: implement Energy Detect Powerdown mode via phy-tunable

2019-09-16 Thread Alexandru Ardelean
be configured. That is why the acceptable values are 1, ETHTOOL_PHY_EDPD_DFLT_TX_MSECS and ETHTOOL_PHY_EDPD_NO_TX (which disables TX pulses). Reviewed-by: Florian Fainelli Signed-off-by: Alexandru Ardelean --- drivers/net/phy/adin.c | 61 ++ 1 file changed, 61

[PATCH v5 1/2] ethtool: implement Energy Detect Powerdown support via phy-tunable

2019-09-16 Thread Alexandru Ardelean
Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Alexandru Ardelean --- include/uapi/linux/ethtool.h | 22 ++ net/core/ethtool.c | 6 ++ 2 files changed, 28 insertions(+) diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool

[PATCH v5 0/2] ethtool: implement Energy Detect Powerdown support via phy-tunable

2019-09-16 Thread Alexandru Ardelean
resolved. Alexandru Ardelean (2): ethtool: implement Energy Detect Powerdown support via phy-tunable net: phy: adin: implement Energy Detect Powerdown mode via phy-tunable drivers/net/phy/adin.c | 61 include/uapi/linux/ethtool.h | 22 +

[PATCH v3 2/3] spi: introduce spi_delay struct as "value + unit" & spi_delay_exec()

2019-09-16 Thread Alexandru Ardelean
lay_exec()` function that processes a `spi_delay` object/struct to execute the delay. It's a copy of the `cs_change_delay` mechanism, but without the default for 10 uS. The clock-cycle delay unit is a bit special, as it needs to be bound to an `spi_transfer` object to execute. Signed-off-by: Alexandru

[PATCH v3 0/3] spi: introduce `struct spi_delay` data-type

2019-09-16 Thread Alexandru Ardelean
applies on Mark's `spi/for-next` branch. The reasons for choosing `cs_change_delay`, is: 1. this change introduces delay units 2. it is not yet widely used, meaning it can still be changed Some delays like `delay` from `spi_transfer` would require a longer update-time change & discussion. Alexa

[PATCH v3 3/3] spi: make `cs_change_delay` the first user of the `spi_delay` logic

2019-09-16 Thread Alexandru Ardelean
-by: Alexandru Ardelean --- drivers/iio/imu/adis.c | 24 drivers/spi/spi.c | 28 +++- include/linux/spi/spi.h | 4 +--- 3 files changed, 20 insertions(+), 36 deletions(-) diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c index 1631c255deab

[PATCH v3 1/3] spi: move `cs_change_delay` backwards compat logic outside switch

2019-09-16 Thread Alexandru Ardelean
The `cs_change_delay` backwards compatibility value could be moved outside of the switch statement. The only reason to do it, is to make the next patches easier to diff. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions

[PATCH v3] net: stmmac: socfpga: re-use the `interface` parameter from platform data

2019-09-16 Thread Alexandru Ardelean
()`). All that's needed now is to dig that information out, via some `dev_get_drvdata()` && `netdev_priv()` calls and re-use it. Signed-off-by: Alexandru Ardelean --- Changelog v2 -> v3: * drop `inline` keyword Changelog v1 -> v2: * initially, this patch was developed on a 4.14 kerne

[PATCH] dmaengine: axi-dmac: simple device_config operation implemented

2019-09-13 Thread Alexandru Ardelean
SAMPLE_BITS: 16 FRAME_BITS: 16 CHANNELS: 1 RATE: 48000 PERIOD_TIME: 125000 PERIOD_SIZE: 6000 PERIOD_BYTES: 12000 PERIODS: 4 BUFFER_TIME: 50 BUFFER_SIZE: 24000 BUFFER_BYTES: 48000 TICK_TIME: 0 Signed-off-by: Rodrigo Alencar Signed-off-by: Alexandru Ardelean --- Note: Fixes tag not added

[PATCH v2 4/4] iio: imu: adis: convert cs_change_delay to spi_delay struct

2019-09-13 Thread Alexandru Ardelean
The ADIS library is one of the few users of the new `cs_change_delay` parameter for an spi_transfer. The introduction of the `spi_delay` struct, requires that the users of of `cs_change_delay` get an update. This change updates the ADIS library. Signed-off-by: Alexandru Ardelean --- drivers

[PATCH v2 3/4] spi: make `cs_change_delay` the first user of the `spi_delay` logic

2019-09-13 Thread Alexandru Ardelean
handling needed to do that. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi.c | 28 +++- include/linux/spi/spi.h | 4 +--- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 1883de8ffa82..d0bf0ffca042 100644

[PATCH v2 1/4] spi: move `cs_change_delay` backwards compat logic outside switch

2019-09-13 Thread Alexandru Ardelean
The `cs_change_delay` backwards compatibility value could be moved outside of the switch statement. The only reason to do it, is to make the next patches easier to diff. Signed-off-by: Alexandru Ardelean --- drivers/spi/spi.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions

[PATCH v2 0/4] spi: introduce `struct spi_delay` data-type

2019-09-13 Thread Alexandru Ardelean
applies on Mark's `spi/for-next` branch. The reasons for choosing `cs_change_delay`, is: 1. this change introduces delay units 2. it is not yet widely used, meaning it can still be changed Some delays like `delay` from `spi_transfer` would require a longer update-time change & discussion. Alexa

<    3   4   5   6   7   8   9   10   >