summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-03-25iio:magnetometer: Add Support for ST IIS2MDCLI Qingwu4-0/+12
Add support for ST magnetometer IIS2MDC, an I2C/SPI interface 3-axis magnetometer. The patch was tested on the instrument with IIS2MDC via I2C interface. Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn> Link: https://lore.kernel.org/r/20210317063902.19300-3-Qing-wu.Li@leica-geosystems.com.cn Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25dt-bindings: iio: st,st-sensors add IIS2MDC.LI Qingwu1-0/+1
Add support for ST magnetometer IIS2MDC, an I2C/SPI interface 3-axis magnetometer sensor. The patch was tested on the instrument with IIS2MDC via I2C interface. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn> Link: https://lore.kernel.org/r/20210317063902.19300-2-Qing-wu.Li@leica-geosystems.com.cn Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25staging: iio: ad9832: kernel-doc fixesMugilraj Dhavachelvan1-2/+2
Fixes a W=1 warning. -Added ``:`` to lock parameter in 'ad9832_state' description. -It's a reference comment so removed /** Signed-off-by: Mugilraj Dhavachelvan <dmugil2000@gmail.com> Link: https://lore.kernel.org/r/20210315133711.26860-1-dmugil2000@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio:dac:max517.c: Use devm_iio_device_register()Mugilraj Dhavachelvan1-9/+1
Use devm_iio_device_register() to avoid remove function and drop explicit call to iio_device_unregister(). Signed-off-by: Mugilraj Dhavachelvan <dmugil2000@gmail.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20210314175709.34301-1-dmugil2000@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio:cros_ec_sensors: Fix a wrong function name in kernel doc.Jonathan Cameron1-1/+1
cros_ec_sensors_read_data_unsafe() had wrong function name in kernel-doc This shows up with W=1 builds. No fixes tag because I don't want to waste time on this being backported. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Guenter Roeck <groeck@chromium.org> Cc: Douglas Anderson <dianders@chromium.org> Cc: Gwendal Grignou <gwendal@chromium.org> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com> Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Link: https://lore.kernel.org/r/20210313145341.116088-1-jic23@kernel.org
2021-03-25iio: buffer: kfifo_buf: kernel-doc, typo in function name.Jonathan Cameron1-1/+1
Should have been _kfifo_ and was _fifo_ Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Alexandru Ardelean <ardeleanalex@gmail.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20210314164655.408461-9-jic23@kernel.org
2021-03-25iio: accel: sca3000: kernel-doc fixes. Missing - and wrong function names.Jonathan Cameron1-4/+4
All extremely obvious so nothing to add to patch title. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20210314164655.408461-8-jic23@kernel.org
2021-03-25iio: adc: adi-axi-adc: Drop false marking for kernel-docJonathan Cameron1-1/+1
This comment block isn't in kernel-doc format so drop the /** marking. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210314164655.408461-7-jic23@kernel.org
2021-03-25iio: adc: cpcap-adc: kernel-doc fix - that should be _ in structure nameJonathan Cameron1-1/+1
Fixes a W=1 warning. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20210314164655.408461-6-jic23@kernel.org
2021-03-25iio: dac: ad5504: fix wrong part number in kernel-doc structure name.Jonathan Cameron1-1/+1
Probably a bit of cut and paste where someone forgot to change the part number. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20210314164655.408461-5-jic23@kernel.org
2021-03-25iio: dac: ad5770r: kernel-doc fix case of letter R wrong in structure nameJonathan Cameron1-1/+1
Nothing useful to add beyond this causing a warning with W=1 Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/20210314164655.408461-4-jic23@kernel.org
2021-03-25iio: adc: ti-adc084s021: kernel-doc fixes, missing function namesJonathan Cameron1-2/+2
The documentation in this driver was nearly kernel-doc and was marked as such. Unfortunately the format was wrong and function names were missing. This patch puts them in with minor edits to keep the resulting line short. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Gwendal Grignou <gwendal@chromium.org> Cc: Mårten Lindahl <martenli@axis.com> Link: https://lore.kernel.org/r/20210314164655.408461-3-jic23@kernel.org
2021-03-25iio: pressure: zpa2326: kernel-doc fixesJonathan Cameron1-2/+2
Two comment blocks had wrong naming for function/structures that they referred to. Results in warnings when doing a W=1 build. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20210314164655.408461-2-jic23@kernel.org
2021-03-25counter: add IRQ or GPIO based counterOleksij Rempel4-0/+262
Add simple IRQ or GPIO base counter. This device is used to measure rotation speed of some agricultural devices, so no high frequency on the counter pin is expected. The maximal measurement frequency depends on the CPU and system load. On the idle iMX6S I was able to measure up to 20kHz without count drops. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Reviewed-by: William Breathitt Gray <vilhelm.gray@gmail.com> Link: https://lore.kernel.org/r/20210301080401.22190-3-o.rempel@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25dt-bindings: counter: add interrupt-counter bindingOleksij Rempel1-0/+62
Add binding for the interrupt counter node Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210301080401.22190-2-o.rempel@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25staging: iio: ad9834: convert to device-managed functions in probeAlexandru Ardelean1-36/+31
This change converts the driver to use device-managed functions in the probe function. For the clock and regulator disable, some devm_add_action_or_reset() calls are required, and then devm_iio_device_register() function can be used register the IIO device. The final aim here would be for IIO 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 <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210310095131.47476-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: temperature: tmp007: use device-managed functions in probeAlexandru Ardelean1-21/+15
This change converts the driver to use device-managed functions in the probe function. The power-down call is handled now via a devm_add_action_or_reset() hook, and then devm_iio_device_register() can be used to register the IIO device. The final aim here would be for IIO 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 <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210310093800.45822-1-aardelean@deviqon.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: buffer: fix use-after-free for attached_buffers arrayAlexandru Ardelean3-7/+8
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 place right before the IIO device data is free'd. The free of this array will be handled by calling iio_device_free(). The iio_buffers_put() function is renamed to iio_device_detach_buffers() since the role of this function changes a bit. It looks like this issue was ocurring on the error path of iio_buffers_alloc_sysfs_and_mask() and in iio_buffers_free_sysfs_and_mask() Added 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: ee708e6baacd ("iio: buffer: introduce support for attaching more IIO buffers") Reported-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/20210307185444.32924-1-ardeleanalex@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25hwmon: (ntc_thermistor): try reading processedLinus Walleij1-9/+18
Before trying the custom method of reading the sensor as raw and then converting, we want to use iio_read_channel_processed_scale() which first tries to see if the ADC can provide a processed value directly, else reads raw and applies scaling inside of IIO using the scale attributes of the ADC. We need to multiply the scaled value with 1000 to get to microvolts from millivolts which is what processed IIO channels returns. Keep the code that assumes 12bit ADC around as a fallback. This gives correct readings on the AB8500 thermistor inputs used in the Ux500 HREFP520 platform for reading battery and board temperature. Cc: Peter Rosin <peda@axentia.se> Cc: Chris Lesiak <chris.lesiak@licor.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: linux-iio@vger.kernel.org Link: https://lore.kernel.org/linux-iio/20201224011607.1059534-1-linus.walleij@linaro.org/ Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Chris Lesiak <chris.lesiak@licor.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210308100219.2732156-2-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: Provide iio_read_channel_processed_scale() APILinus Walleij2-2/+29
Since the old iio_read_channel_processed() would lose precision if we fall back to reading raw and scaling, we introduce a new API that will pass in a scale factor when reading a processed channel: iio_read_channel_processed_scale(). Refactor iio_read_channel_processed() as a special case with scale factor 1. Cc: Peter Rosin <peda@axentia.se> Cc: Chris Lesiak <chris.lesiak@licor.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: linux-iio@vger.kernel.org Link: https://lore.kernel.org/linux-iio/20201224011607.1059534-1-linus.walleij@linaro.org/ Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210308100219.2732156-1-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: xilinx-xadc: Remove code to set trigger parentGwendal Grignou1-1/+0
iio_trigger_set_drvdata() sets the trigger device parent to first argument of viio_trigger_alloc(), no need to do it again in the driver code. In xadc_alloc_trigger, given dev is indio_dev->dev.parent, and we call devm_iio_trigger_alloc wit dev as argument, we do not have to set data->trig->dev.parent to indio_dev->dev.parent anymore. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210309193620.2176163-9-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: as3935: Remove code to set trigger parentGwendal Grignou1-1/+0
iio_trigger_set_drvdata() sets the trigger device parent to first argument of viio_trigger_alloc(), no need to do it again in the driver code. Given we call devm_iio_trigger_alloc() and devm_iio_device_alloc() with dev as parent, we do not have to set data->trig->dev.parent to indio_dev->dev.parent anymore. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com> Link: https://lore.kernel.org/r/20210309193620.2176163-8-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: chemical: atlas: Remove code to set trigger parentGwendal Grignou1-1/+0
iio_trigger_set_drvdata() sets the trigger device parent to first argument of viio_trigger_alloc(), no need to do it again in the driver code. Given we call devm_iio_trigger_alloc() and devm_iio_device_alloc() with &client->dev as parent, we do not have to set data->trig->dev.parent to indio_dev->dev.parent anymore. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com> Link: https://lore.kernel.org/r/20210309193620.2176163-7-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: lmp91000: Remove code to set trigger parentGwendal Grignou1-2/+1
iio_trigger_set_drvdata() sets the trigger device parent to first argument of viio_trigger_alloc(), no need to do it again in the driver code. Given data->dev is dev, and we call devm_iio_trigger_alloc with dev instead of data->dev, we do not have to set data->trig->dev.parent to dev anymore. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com> Link: https://lore.kernel.org/r/20210309193620.2176163-6-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: gp2ap020a00f: Remove code to set trigger parentGwendal Grignou1-1/+0
iio_trigger_set_drvdata() sets the trigger device parent to first argument of viio_trigger_alloc(), no need to do it again in the driver code. Given data->client is client, and we call devm_iio_trigger_alloc() with &client->dev, we do not have to set data->trig->dev.parent to &data->client->dev anymore. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210309193620.2176163-5-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: adis_trigger: Remove code to set trigger parentGwendal Grignou1-8/+2
iio_trigger_set_drvdata() sets the trigger device parent to first argument of viio_trigger_alloc(), no need to do it again in the driver code. Remove adis_trigger_setup() to match other drivers where setting the trigger is usually done in the probe() routine. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210309193620.2176163-4-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: fix devm_iio_trigger_alloc with parent.cocciGwendal Grignou30-33/+0
Use cocci semantic patch: @@ expression trigger, P; @@ trigger = devm_iio_trigger_alloc(P, ...); ... - trigger->dev.parent = P; To remove trigger->dev.parent, since it is set by default. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210309193620.2176163-3-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: set default trig->dev.parentGwendal Grignou13-31/+40
When allocated with [devm_]iio_trigger_alloc(), set trig device parent to the device the trigger is allocated for by default. It can always be reassigned in the probe routine. Change iio_trigger_alloc() API to add the device pointer to be coherent with devm_iio_trigger_alloc, using similar interface to iio_device_alloc(). Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210309193620.2176163-2-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: adc: ad7124: allow more than 8 channelsAlexandru Tachici1-158/+301
Currently AD7124-8 driver cannot use more than 8 IIO channels because it was assigning the channel configurations bijectively to channels specified in the device-tree. This is not possible to do when using more than 8 channels as AD7124-8 has only 8 configuration registers. To allow the user to use all channels at once the driver will keep in memory configurations for all channels but will program only 8 of them at a time on the device. If multiple channels have the same configuration, only one configuration register will be used. If there are more configurations than available registers only the last 8 used configurations will be allowed to exist on the device in a LRU fashion. Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com> Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20210311091154.47785-2-alexandru.tachici@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: light: gp2ap002: Drop unneeded explicit castingAndy Shevchenko1-2/+1
The unnecessary explicit casting is being used. Drop it for good. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210312134903.4296-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: imu: st_lsm6dsx: Drop unneeded explicit castingsAndy Shevchenko3-6/+3
In a few places the unnecessary explicit castings are being used. Drop them for good. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210312134743.4055-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: imu: fxos8700: Drop unneeded explicit castingsAndy Shevchenko2-4/+2
In a few places the unnecessary explicit castings are being used. Drop them for good. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210312134538.3759-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: chemical: bmp680: Drop unneeded explicit castingsAndy Shevchenko2-4/+2
In few places the unnecessary explicit castings are being used. Drop them for good. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210312134349.3472-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: proximity: Add a ChromeOS EC MKBP proximity driverStephen Boyd3-0/+283
Add support for a ChromeOS EC proximity driver that exposes a "front" proximity sensor via the IIO subsystem. The EC decides when front proximity is near and sets an MKBP switch 'EC_MKBP_FRONT_PROXIMITY' to notify the kernel of proximity. Similarly, when proximity detects something far away it sets the switch bit to 0. For now this driver exposes a single sensor, but it could be expanded in the future via more MKBP bits if desired. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Benson Leung <bleung@chromium.org> Cc: Guenter Roeck <groeck@chromium.org> Cc: Douglas Anderson <dianders@chromium.org> Cc: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Link: https://lore.kernel.org/r/20210211024601.1963379-4-swboyd@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25dt-bindings: iio: Add cros ec proximity yaml docStephen Boyd2-0/+44
Some cros ECs support a front proximity MKBP event via 'EC_MKBP_FRONT_PROXIMITY'. Add a DT binding to document this feature via a node that is a child of the main cros_ec device node. Devices that have this ability will describe this in firmware. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Benson Leung <bleung@chromium.org> Cc: Guenter Roeck <groeck@chromium.org> Cc: Douglas Anderson <dianders@chromium.org> Cc: Gwendal Grignou <gwendal@chromium.org> Cc: <devicetree@vger.kernel.org> Reviewed-by: Rob Herring <robh@kernel.org> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20210211024601.1963379-3-swboyd@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25platform/chrome: cros_ec: Add SW_FRONT_PROXIMITY MKBP defineStephen Boyd1-0/+1
Some cros ECs support a front proximity MKBP event via 'EC_MKBP_FRONT_PROXIMITY'. Add this define so it can be used in a future patch. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Benson Leung <bleung@chromium.org> Cc: Guenter Roeck <groeck@chromium.org> Cc: Douglas Anderson <dianders@chromium.org> Cc: Gwendal Grignou <gwendal@chromium.org> Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20210211024601.1963379-2-swboyd@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: Remove kernel-doc keyword in file header commentGwendal Grignou13-13/+13
Remove kernel-doc keyword from function header comment. It fixes issues spotted by scripts/kernel-doc like: drivers/iio/<driver>.c:3: info: Scanning doc for function <component name> drivers/iio/<driver>.c:X: warning: expecting prototype for <component name>. Prototype was for <function>() instead To reproduce the errors: scripts/kernel-doc -v -none $(find drivers/iio/ -name \*.c \ -exec head -2 {} \+ | grep -B2 -e '\*\*' | grep '==' | cut -d ' ' -f 2) After, confirm these errors are gone with: scripts/kernel-doc -v -none $(git show --name-only | grep -e "^driver") Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Link: https://lore.kernel.org/r/20210309234314.2208256-1-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: kfifo: mask flags without zero-check in devm_iio_kfifo_buffer_setup()Alexandru Ardelean1-3/+2
As pointed by Lars, this doesn't require a zero-check. Also, while looking at this a little closer at it (again), the masking can be done later, as there is a zero-check for 'mode_flags' anyway, which returns -EINVAL. And we only need the 'mode_flags' later in the logic. This change is more of a tweak. Fixes: e36db6a06937 ("iio: kfifo: add devm_iio_kfifo_buffer_setup() helper") Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/20210306162834.7339-1-ardeleanalex@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: hrtimer: Allow sub Hz granularityGwendal Grignou2-10/+24
Allow setting frequency below 1Hz or sub 1Hz precision. Useful for slow sensors like ALS. Test frequency is set properly: modprobe iio-trig-hrtimer && \ mkdir /sys/kernel/config/iio/triggers/hrtimer/t1 && \ cd /sys/bus/iio/devices/triggerX ; for i in 1 .1 .01 .001 ; do echo $i > sampling_frequency cat sampling_frequency done Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210226014733.2108544-1-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25staging: iio: remove mention of defunct listBaruch Siach1-4/+0
The ADI device-drivers-devel list no longer exists. Cc: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Link: https://lore.kernel.org/r/69b3e45e7666a1dd74a83df0b84ef8a63bf090ea.1614082343.git.baruch@tkos.co.il Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: accel: mma8452: fix indentationSean Nyekjaer1-23/+23
Improve readability by fixing indentation. Signed-off-by: Sean Nyekjaer <sean@geanix.com> Link: https://lore.kernel.org/r/20210301080029.1974797-1-sean@geanix.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: proximity: vcnl3020: add proximity rateIvan Mikhaylov1-1/+96
Add the proximity rate optional option and handling of it for vishay vcnl3020. Signed-off-by: Ivan Mikhaylov <i.mikhaylov@yadro.com> Link: https://lore.kernel.org/r/20210225201444.12983-2-i.mikhaylov@yadro.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: adc: npcm_adc: Replace indio_dev->mlock with own device lockSergiu Cuciurean1-2/+13
As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. This is part of a bigger cleanup. Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/ Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com> Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com> Link: https://lore.kernel.org/r/20200928131333.36646-3-mircea.caprioru@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: adc: palmas_gpadc: Replace indio_dev->mlock with own device lockSergiu Cuciurean1-3/+13
As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. This is part of a bigger cleanup. Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/ Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com> Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com> Link: https://lore.kernel.org/r/20200928131333.36646-2-mircea.caprioru@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: adc: spear_adc: Replace indio_dev->mlock with own device lockSergiu Cuciurean1-4/+16
As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. This is part of a bigger cleanup. Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/ Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com> Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com> Link: https://lore.kernel.org/r/20200928131333.36646-1-mircea.caprioru@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio:ABI docs: Combine the two instances of docs for sensor_sensitivityJonathan Cameron3-17/+14
This control on the gain of a measurement used for time of flight sensing is standard but the expected values for different enviroments may not be. As we cannot have the same ABI element documented in two files, add a generic version to sysfs-bus-iio-proximity and a note on the expected value vs measuring environment for the as3935. Fixes $ scripts/get_abi.pl validate Warning: /sys/bus/iio/devices/iio:deviceX/sensor_sensitivity is defined 2 times: ./Documentation/ABI/testing/sysfs-bus-iio-distance-srf08:0 ./Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935:8 Cc: Matt Ranostay <matt.ranostay@konsulko.com> Reported-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com> Link: https://lore.kernel.org/r/20210117153816.696693-7-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio:ABI docs: Combine sysfs-bus-iio-humidity-hdc2010/hdc100x into one fileJonathan Cameron2-10/+2
These contain only one entry for out_current_heater_raw (_available). Document this in a new sysfs-bus-iio-humidity file, and make it a little more generic by allowing for non 0/1 values. Fixes $ scripts/get_abi.pl validate Warning: /sys/bus/iio/devices/iio:deviceX/out_current_heater_raw is defined 2 times: ./Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc2010:0 ./Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc100x:0 Warning: /sys/bus/iio/devices/iio:deviceX/out_current_heater_raw_available is defined 2 times: ./Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc2010:1 ./Documentation/ABI/testing/sysfs-bus-iio-humidity-hdc100x:1 Cc: Eugene Zaikonnikov <ez@norphonic.com> Cc: Matt Ranostay <matt.ranostay@konsulko.com> Reported-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com> Link: https://lore.kernel.org/r/20210117153816.696693-6-jic23@kernel.org
2021-03-11iio: adc: mt6360: Include right headerLinus Walleij1-1/+2
To get access to the big endian byte order parsing helpers drivers need to include <asm/unaligned.h> and nothing else. Cc: Gene Chen <gene_chen@richtek.com> Suggested-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210215153447.48457-1-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-11iio: adis: add helpers for lockingNuno Sa4-25/+32
Add some helpers to lock and unlock the device. As this is such a simple change, we update all the users that were using the lock already in this patch. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210218114039.216091-5-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-11dt-bindings: adis16475: remove propertyNuno Sá1-9/+0
`adi,scaled-output-hz` is no longer used by the driver. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210218114039.216091-4-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>