summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'input-for-v6.2-rc0' of ↵Linus Torvalds2022-12-131-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - a new driver for Cypress Generation 5 touchscreens - a new driver for Hynitron cstxxx touchscreens - a new driver for Himax hx83112b touchscreen - I2C input devices have been converted to use i2c's probe_new() - a large number of input devices are now using DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr() and no longer use __maybe_unused annotations - improvements to msg2638 touchscreen driver to also support msg2138 - conversion of several input deevine bindings to yaml/DT schema - changes to select touch drivers to move handling of wake irqs to the PM core - other assorted fixes and improvements. * tag 'input-for-v6.2-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (165 commits) Input: elants_i2c - delay longer with reset asserted dt-bindings: input: Convert ti,drv260x to DT schema dt-bindings: input: gpio-beeper: Convert to yaml schema Input: pxspad - fix unused data warning when force feedback not enabled Input: lpc32xx - allow building with COMPILE_TEST Input: nomadik-ske-keypad - allow building with COMPILE_TEST Input: pxa27xx-keypad - allow build with COMPILE_TEST Input: spear-keyboard - improve build coverage using COMPILE_TEST Input: tegra-kbc - allow build with COMPILE_TEST Input: tegra-kbc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Input: tca6416-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Input: tc3589x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Input: st-keyscan - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Input: sh-keysc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Input: qt1070 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Input: pxa27x_keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Input: pmic8xxx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Input: nomadik-ske-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Input: mcs-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Input: max7359-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() ...
| * iio: adc: twl4030-madc: add missing of.h includeDmitry Torokhov2022-10-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The driver is using of_device_id/of_match_ptr() and therefore needs to include of.h header. We used to get this definition indirectly via inclusion of matrix_keypad.h from twl.h, but we are cleaning up matrix_keypad.h from unnecessary includes. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20220927154611.3330871-3-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* | iio: adc: aspeed: Remove the trim valid dts property.Billy Tsai2022-11-141-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dts property "aspeed,trim-data-valid" is currently used to determine whether to read trimming data from the OTP register. If this is set on a device without valid trimming data in the OTP the ADC will not function correctly. This patch drops the use of this property and instead uses the default (unprogrammed) OTP value of 0 to detect when a fallback value of 0x8 should be used rather then the value read from the OTP. Fixes: d0a4c17b4073 ("iio: adc: aspeed: Get and set trimming data.") Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20221114025057.10843-1-billy_tsai@aspeedtech.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger()Yang Yingliang2022-11-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | If iio_trigger_register() returns error, it should call iio_trigger_free() to give up the reference that hold in iio_trigger_alloc(), so that it can call iio_trig_release() to free memory when the refcount hit to 0. Fixes: 0e589d5fb317 ("ARM: AT91: IIO: Add AT91 ADC driver.") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20221024084511.815096-1-yangyingliang@huawei.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: mp2629: fix potential array out of bound accessSaravanan Sekar2022-11-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | Add sentinel at end of maps to avoid potential array out of bound access in iio core. Fixes: 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver") Signed-off-by: Saravanan Sekar <sravanhome@gmail.com> Link: https://lore.kernel.org/r/20221029093000.45451-4-sravanhome@gmail.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: mp2629: fix wrong comparison of channelSaravanan Sekar2022-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Input voltage channel enum is compared against iio address instead of the channel. Fixes: 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver") Signed-off-by: Saravanan Sekar <sravanhome@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20221029093000.45451-2-sravanhome@gmail.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: at91-sama5d2_adc: get rid of 5 degrees Celsius adjustmentClaudiu Beznea2022-10-241-4/+2
| | | | | | | | | | | | | | | | | | | | On SAMA7G5 final chip version there is no need for 5 degrees Celsius adjustment when computing junction temperature, thus, remove it. Fixes: 5ab38b81895c ("iio: adc: at91-sama5d2_adc: add support for temperature sensor") Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20221020102705.3639204-1-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: at91-sama5d2_adc: Fix unsafe buffer attributesMatti Vaittinen2022-10-171-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The iio_triggered_buffer_setup_ext() was changed by commit 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") to silently expect that all attributes given in buffer_attrs array are device-attributes. This expectation was not forced by the API - and some drivers did register attributes created by IIO_CONST_ATTR(). The added attribute "wrapping" does not copy the pointer to stored string constant and when the sysfs file is read the kernel will access to invalid location. Change the IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order to prevent the invalid memory access. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/be69775aa302159f088b8b91894e6ec449bca65b.1664782676.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: stm32-adc: fix channel sampling time initOlivier Moysan2022-10-171-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix channel init for ADC generic channel bindings. In generic channel initialization, stm32_adc_smpr_init() is called to initialize channel sampling time. The "st,min-sample-time-ns" property is an optional property. If it is not defined, stm32_adc_smpr_init() is currently skipped. However stm32_adc_smpr_init() must always be called, to force a minimum sampling time for the internal channels, as the minimum sampling time is known. Make stm32_adc_smpr_init() call unconditional. Fixes: 796e5d0b1e9b ("iio: adc: stm32-adc: use generic binding for sample-time") Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Link: https://lore.kernel.org/r/20221012142205.13041-2-olivier.moysan@foss.st.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: mcp3911: mask out device ID in debug printsMarcus Folkesson2022-10-171-2/+3
| | | | | | | | | | | | | | | | The Device ID should not be included when printing register. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Link: https://lore.kernel.org/r/20221010194654.676525-1-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: mcp3911: use correct id bitsMarcus Folkesson2022-10-171-2/+2
| | | | | | | | | | | | | | | | | | The device ID should be shifted 6 bits to left according to datasheet. Fixes: 3a89b289df5d ("iio: adc: add support for mcp3911") Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Link: https://lore.kernel.org/r/20221010194641.676484-1-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: mcp3911: return proper error code on failure to allocate triggerMarcus Folkesson2022-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | smatch warnings: drivers/iio/adc/mcp3911.c:441 mcp3911_probe() warn: passing zero to 'PTR_ERR' Fixes: 08a65f61db69 ("iio: adc: mcp3911: add support for interrupts") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Link: https://lore.kernel.org/r/20220927092537.94663-1-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: mcp3911: fix sizeof() vs ARRAY_SIZE() bugDan Carpenter2022-10-171-1/+1
|/ | | | | | | | | | | This code uses sizeof() instead of ARRAY_SIZE() so it reads beyond the end of the mcp3911_osr_table[] array. Fixes: 6d965885f4ea ("iio: adc: mcp3911: add support for oversampling ratio") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com> Link: https://lore.kernel.org/r/YzFsjY3xLHUQMjVr@kili Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Merge tag 'char-misc-6.1-rc1' of ↵Linus Torvalds2022-10-0831-903/+2126
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc and other driver updates from Greg KH: "Here is the large set of char/misc and other small driver subsystem changes for 6.1-rc1. Loads of different things in here: - IIO driver updates, additions, and changes. Probably the largest part of the diffstat - habanalabs driver update with support for new hardware and features, the second largest part of the diff. - fpga subsystem driver updates and additions - mhi subsystem updates - Coresight driver updates - gnss subsystem updates - extcon driver updates - icc subsystem updates - fsi subsystem updates - nvmem subsystem and driver updates - misc driver updates - speakup driver additions for new features - lots of tiny driver updates and cleanups All of these have been in the linux-next tree for a while with no reported issues" * tag 'char-misc-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (411 commits) w1: Split memcpy() of struct cn_msg flexible array spmi: pmic-arb: increase SPMI transaction timeout delay spmi: pmic-arb: block access for invalid PMIC arbiter v5 SPMI writes spmi: pmic-arb: correct duplicate APID to PPID mapping logic spmi: pmic-arb: add support to dispatch interrupt based on IRQ status spmi: pmic-arb: check apid against limits before calling irq handler spmi: pmic-arb: do not ack and clear peripheral interrupts in cleanup_irq spmi: pmic-arb: handle spurious interrupt spmi: pmic-arb: add a print in cleanup_irq drivers: spmi: Directly use ida_alloc()/free() MAINTAINERS: add TI ECAP driver info counter: ti-ecap-capture: capture driver support for ECAP Documentation: ABI: sysfs-bus-counter: add frequency & num_overflows items dt-bindings: counter: add ti,am62-ecap-capture.yaml counter: Introduce the COUNTER_COMP_ARRAY component type counter: Consolidate Counter extension sysfs attribute creation counter: Introduce the Count capture component counter: 104-quad-8: Add Signal polarity component counter: Introduce the Signal polarity component counter: interrupt-cnt: Implement watch_validate callback ...
| * iio: adc: mcp3911: add support for oversampling ratioMarcus Folkesson2022-09-211-0/+58
| | | | | | | | | | | | | | | | | | The chip supports oversampling ratio, so expose it to userspace. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220815061625.35568-9-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: adc: mcp3911: add support for interruptsMarcus Folkesson2022-09-211-0/+53
| | | | | | | | | | | | | | | | | | | | | | Make it possible to read values upon interrupts. Configure Data Ready Signal Output Pin to either HiZ or push-pull and use it as interrupt source. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220815061625.35568-7-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: adc: mcp3911: add support for buffersMarcus Folkesson2022-09-212-8/+97
| | | | | | | | | | | | | | | | | | Add support for buffers to make the driver fit for more use cases. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220815061625.35568-6-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: adc: mcp3911: use resource-managed version of iio_device_registerMarcus Folkesson2022-09-211-37/+14
| | | | | | | | | | | | | | | | | | Keep using managed resources as much as possible. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220815061625.35568-5-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: adc: ad7923: support extended rangeNuno Sá2022-09-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | By default the driver was always setting the RANGE bit which means that the analog input goes from 0 to VREF. However, we might want to have 0 to 2xVREF. This change adds a new Firmware property to allow for the extended range while keeping the default behavior if nothing is provided. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20220912081223.173584-3-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: adc: ad7923: fix channel readings for some variantsNuno Sá2022-09-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the supported devices have 4 or 2 LSB trailing bits that should not be taken into account. Hence we need to shift these bits out which fits perfectly on the scan type shift property. This change fixes both raw and buffered reads. Fixes: f2f7a449707e ("iio:adc:ad7923: Add support for the ad7904/ad7914/ad7924") Fixes: 851644a60d20 ("iio: adc: ad7923: Add support for the ad7908/ad7918/ad7928") Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20220912081223.173584-2-nuno.sa@analog.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: adc: stm32-adc: add id registers supportOlivier Moysan2022-09-212-3/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support of identification registers to STM32 ADC. By default the ADC hardware instance number is retrieved from the compatible configuration data. Get the available ADC number per ADC block, from hardware configuration register, when this register exists. Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Link: https://lore.kernel.org/r/20220915135452.1712453-1-olivier.moysan@foss.st.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * drivers: iio: adc: ltc2497: Rename the LTC2499 iio deviceCiprian Regus2022-09-214-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the iio device's name based on the chip used for the LTC2499 only. The most common way for IIO clients to interact with a device is to address it based on it's name. By using the dev_name() function, the name will be set based on a i2c_client's kobj name, which has the format i2c_instance-i2c_address (1-0076 for example). This is not ideal, since it makes a requirement for userspace to have knowledge about the hardware connections of the device. The name field is set to NULL for the LTC2497 and LTC2496, so that the old name can kept as it is, since changing it will result in an ABI breakage. Signed-off-by: Ciprian Regus <ciprian.regus@analog.com> Link: https://lore.kernel.org/r/20220916140922.2506248-6-ciprian.regus@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * drivers: iio: adc: ltc2497: LTC2499 supportCiprian Regus2022-09-214-7/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The LTC2499 is a 16-channel (eight differential), 24-bit, ADC with Easy Drive technology and a 2-wire, I2C interface. Implement support for the LTC2499 ADC by extending the LTC2497 driver. A new chip_info struct is added to differentiate between chip types and resolutions when reading data from the device. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/2499fe.pdf Signed-off-by: Ciprian Regus <ciprian.regus@analog.com> Link: https://lore.kernel.org/r/20220916140922.2506248-5-ciprian.regus@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: ltc2497: Fix reading conversion resultsUwe Kleine-König2022-09-211-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the result of the previous conversion is read the chip automatically starts a new conversion and doesn't accept new i2c transfers until this conversion is completed which makes the function return failure. So add an early return iff the programming of the new address isn't needed. Note this will not fix the problem in general, but all cases that are currently used. Once this changes we get the failure back, but this can be addressed when the need arises. Fixes: 69548b7c2c4f ("iio: adc: ltc2497: split protocol independent part in a separate module ") Reported-by: Meng Li <Meng.Li@windriver.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Tested-by: Denys Zagorui <dzagorui@cisco.com> Cc: <Stable@vger.kernel.org> Link: https://lore.kernel.org/r/20220815091647.1523532-1-dzagorui@cisco.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * Merge tag 'iio-for-6.1a' of ↵Greg Kroah-Hartman2022-09-2123-849/+1716
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: 1st set of IIO new device support, features and cleanup for 6.1 This includes Nuno Sa's work to move the IIO core over to generic firmware properties rather than having DT specific code paths. Combined with Andy Shevchenko's long term work on drivers, this leaves IIO in a good state for handling other firmware types. New device support - liteon,ltrf216a * New driver and dt bindings to support this Light sensor. - maxim,max11205 * New driver for this 16bit single channel ADC. - memsensing,msa311 * New driver for this accelerometer. Includes a string helper for read/write. - richtek,rtq6056 * New driver and dt binding to support this current monitor used to measure power usage. - yamaha,yas530 * Support the YAS537 variant (series includes several fixes for other parts and new driver features). Staging graduation - adi,ad7746 CDC. Cleanup conducted against set of roadtest tests using the posted RFC of that framework. Features - core * Large rework to make all the core IIO code use generic firmware properties. Includes switching some drivers over as well using newly provided generic interfaces and allowing removal of DT specific ones. * Support for gesture event types for single and double tap. Used in bosch,bma400. - atmel,at91-sama5d2 * Add support for temperature sensor which uses two muxed inputs to estimate the temperature. * Handle trackx bits of EMR register to improve temp sampling accuracy. * Runtime PM support. - liteon,ltrf216a * Add a _raw channel output to allow working around an issue with differing conversions equations that breaks some user space controls. - mexelis,mlx90632 * Support regulator control. - ti,tsc2046 * External reference voltage support. Clean up and minor fixes - Tree-wide * devm_clk_get_enabled() replacements of opencoded equivalent. * Remaining IIO_DMA_MINALIGN conversions (the staging/iio drivers). * Various minor warning and similar cleanup such as missing static markings. * strlcpy() to strscpy() for cases where return value not checked. * provide units.h entries for more HZ units and use them in drivers. - dt-bindings cleanup * Drop maintainers listss where the email address is bouncing. * Switch spi devices over to using spi-peripheral.yaml * Add some missing unevaluatedProperties / additionalProperties: false entries. - ABI docs * Add some missing channel type specific sampling frequency entries. * Add parameter names for callback parameters. - MAINTAINERS * Fix wrong ADI forum links. - core * lockdep class per device, to avoid an issue with nest when one IIO device is the consumer of another. * White space tweaks. - asc,dlhl60d * Use get_unaligned_be24 to avoid some unusual data manipulation and masking. - atmel,at91-sama5d2 * Fix wrong max value. * Improve error handling when measuring pressure and touch. * Add locks to remove races on updating oversampling / sampling freq. * Add missing calls in suspend and resume path to ensure state is correctly brought up if buffered capture was in use when suspend happened. * Error out of write_raw() callback if buffered capture enabled to avoid unpredictable behavior. * Handle different versions having different oversampling ratio support and drop excess error checking. * Cleanup magic value defines where the name is just the value and hence hurts readability. * Use read_avail() callback to provide info on possible oversampling ratios. * Correctly handle variable bit depth when doing oversampling on different supported parts. Also handle higher oversampling ratios. - fsl,imx8qxp * Don't ignore errors from regulator_get_voltage() so as to avoid some very surprising scaling. - invensense,icp10100 * Switch from UNIVERSAL to DEFINE_RUNTIME_DEV_PM_OPS. UNIVERSAL rarely made sense and is now deprecated. In this driver we just avoid double disabling in some paths. - maxim,max1363 * Drop consumer channel map provision by platform data. There have been better ways of doing this for years and there are no in tree users. - microchip,mcp3911 * Update status to maintained. - qcom,spmi-adc5 * Support measurement of LDO output voltage. - qcom,spmi-adc * Add missing channel available on SM6125 SoC. - st,stmpe * Drop requirement on node name in binding now that driver correctly doesn't enforce it. - stx104 * Move to more appropriate addac directory - ti,am335x * Document ti,am654-adc compatible already in use in tree. - ti,hmc5843 * Move dev_pm_ops out of header and use new pm macros to handle export. - yamaha,yas530 * Minor cleanups. * tag 'iio-for-6.1a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (142 commits) iio: pressure: icp10100: Switch from UNIVERSAL to DEFINE_RUNTIME_DEV_PM_OPS(). iio: adc: max1363: Drop provision to provide an IIO channel map via platform data iio: accel: bma400: Add support for single and double tap events iio: Add new event type gesture and use direction for single and double tap iio: Use per-device lockdep class for mlock iio: adc: add max11205 adc driver dt-bindings: iio: adc: Add max11205 documentation file iio: magnetometer: yamaha-yas530: Use dev_err_probe() iio: magnetometer: yamaha-yas530: Make strings const in chip info iio: magnetometer: yamaha-yas530: Use pointers as driver data iio: adc: tsc2046: silent spi_device_id warning iio: adc: tsc2046: add vref support dt-bindings: iio: adc: ti,tsc2046: add vref-supply property iio: light: ltrf216a: Add raw attribute dt-bindings: iio: Add missing (unevaluated|additional)Properties on child nodes MAINTAINERS: fix Analog Devices forum links iio/accel: fix repeated words in comments dt-bindings: iio: accel: add dt-binding schema for msa311 accel driver iio: add MEMSensing MSA311 3-axis accelerometer driver dt-bindings: vendor-prefixes: add MEMSensing Microsystems Co., Ltd. ...
| | * iio: adc: max1363: Drop provision to provide an IIO channel map via platform ↵Jonathan Cameron2022-09-051-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data Back in the days of board files, platform data was used to provide information on the mapping from ADC channel to an analog signal from another device. We've long since moved to doing this via device tree. Hence drop the support from the max1363 driver which is the only driver still providing this. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20220821161058.2207185-1-jic23@kernel.org
| | * iio: adc: add max11205 adc driverRamona Bolboaca2022-09-053-0/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding support for max11205 16-bit single-channel ultra-low power delta-sigma adc. The MAX11205 is compatible with the 2-wire interface and uses SCLK and RDY/DOUT for serial communications. In this mode, all controls are implemented by timing the high or low phase of the SCLK. The 2-wire serial interface only allows for data to be read out through the RDY/DOUT output. Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX11205.pdf Signed-off-by: Ramona Bolboaca <ramona.bolboaca@analog.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220831133021.215625-2-ramona.bolboaca@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: tsc2046: silent spi_device_id warningOleksij Rempel2022-09-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add spi_device_id to silent following kernel runtime warning: "SPI driver tsc2046 has no spi_device_id for ti,tsc2046e-adc". Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220904100203.3614502-3-o.rempel@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: tsc2046: add vref supportOleksij Rempel2022-09-041-2/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If VREF pin is attached, we should use external VREF source instead of the internal. Otherwise we will get wrong measurements on some of the channel types. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220904100203.3614502-2-o.rempel@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: stx104: Move to addac subdirectoryWilliam Breathitt Gray2022-08-203-419/+0
| | | | | | | | | | | | | | | | | | | | | | | | The stx104 driver supports both ADC and DAC functionality. Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Link: https://lore.kernel.org/r/20220815222921.138945-1-william.gray@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: qcom-spmi-adc5: add ADC5_VREF_VADC to rev2 ADC5Robert Marko2022-08-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for ADC5_VREF_VADC channel to rev2 ADC5 channel list. This channel measures the VADC reference LDO output. Signed-off-by: Robert Marko <robimarko@gmail.com> Link: https://lore.kernel.org/r/20220818221815.346233-3-robimarko@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: xilinx-xadc: Benefit from devm_clk_get_enabled() to simplifyUwe Kleine-König2022-08-151-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220808204740.307667-9-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: xilinx-ams: Benefit from devm_clk_get_enabled() to simplifyUwe Kleine-König2022-08-151-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220808204740.307667-8-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: ti-ads131e08: Benefit from devm_clk_get_enabled() to simplifyUwe Kleine-König2022-08-151-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220808204740.307667-7-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: lpc18xx: Benefit from devm_clk_get_enabled() to simplifyUwe Kleine-König2022-08-151-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220808204740.307667-5-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: ingenic-adc: Benefit from devm_clk_get_prepared() to simplifyUwe Kleine-König2022-08-151-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of devm_clk_get_prepared() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220808204740.307667-4-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: ad9467: Benefit from devm_clk_get_enabled() to simplifyUwe Kleine-König2022-08-151-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220808204740.307667-3-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: ad7768-1: Benefit from devm_clk_get_enabled() to simplifyUwe Kleine-König2022-08-151-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220808204740.307667-2-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: ad7124: Benefit from devm_clk_get_enabled() to simplifyUwe Kleine-König2022-08-151-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of devm_clk_get_enabled() to replace some code that effectively open codes this new function. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220808204740.307667-1-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: mt6360: Drop an incorrect __maybe_unused marking.Jonathan Cameron2022-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the struct platform_driver has one of it's elements assigned to point to the of_device_id table, it is never going to be unused. Drop the marking. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Gene Chen <gene_chen@richtek.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220807162121.862894-1-jic23@kernel.org
| | * iio: adc: stm32-adc: convert to device propertiesNuno Sá2022-08-151-55/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Tested-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Link: https://lore.kernel.org/r/20220715122903.332535-14-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: qcom-spmi-adc5: convert to device propertiesNuno Sá2022-08-151-33/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220715122903.332535-13-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: qcom-spmi-vadc: convert to device propertiesNuno Sá2022-08-151-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220715122903.332535-12-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: qcom-pm8xxx-xoadc: convert to device propertiesNuno Sá2022-08-151-30/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220715122903.332535-11-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: at91-sama5d2_adc: convert to device propertiesNuno Sá2022-08-151-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220715122903.332535-10-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: ab8500-gpadc: convert to device propertiesNuno Sá2022-08-151-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the conversion to firmware agnostic device properties. As part of the conversion the IIO inkern interface 'of_xlate()' is also converted to 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF dependencies from IIO. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220715122903.332535-9-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: ingenic-adc: convert to IIO fwnode interfaceNuno Sá2022-08-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move from 'of_xlate()' to 'fwnode_xlate()'. The end goal is to completely drop OF from the IIO inkernel interface. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220715122903.332535-8-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: qcom-spmi-adc5: Add missing VCOIN/GPIO[134] channelsMarijn Suijten2022-08-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These channels are specified in downstream kernels [1] and actively used by e.g. the Sony Seine platform on the SM6125 SoC. Note that GPIO2 isn't used on this platform and, while the definition downstream is identical to the other GPIOx_100K_PU definitions, has been omitted for lack of proper testing. [1]: https://source.codeaurora.org/quic/la/kernel/msm-4.14/tree/drivers/iio/adc/qcom-spmi-adc5.c?h=LA.UM.7.11.r1-05200-NICOBAR.0#n688 Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Link: https://lore.kernel.org/r/20220805135729.1037079-3-marijn.suijten@somainline.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: at91-sama5d2_adc: add runtime pm supportClaudiu Beznea2022-08-151-42/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add runtime PM support by disabling/enabling ADC's peripheral clock. On simple conversion the ADC's clock is kept enabled just while the conversion is in progress. This includes also temperature conversion. For triggered buffers and touch conversions the ADC clock is kept enabled while the triggered buffers or touch are enabled. Along with it removed the __maybe_unused on suspend() and resume() ops as the dev_pm_ops object members are now filled with SYSTEM_SLEEP_PM_OPS(). Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220803102855.2191070-20-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| | * iio: adc: at91-sama5d2_adc: add empty line after functionsClaudiu Beznea2022-08-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add empty line after function. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220803102855.2191070-19-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>