summaryrefslogtreecommitdiff
path: root/drivers/iio
AgeCommit message (Collapse)AuthorFilesLines
4 daysmove asm/unaligned.h to linux/unaligned.hAl Viro82-82/+82
asm/unaligned.h is always an include of asm-generic/unaligned.h; might as well move that thing to linux/unaligned.h and include that - there's nothing arch-specific in that header. auto-generated by the following: for i in `git grep -l -w asm/unaligned.h`; do sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i done for i in `git grep -l -w asm-generic/unaligned.h`; do sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i done git mv include/asm-generic/unaligned.h include/linux/unaligned.h git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
2024-09-09Merge 6.11-rc7 into char-misc-nextGreg Kroah-Hartman10-59/+91
We need the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-09-07iio: adc: axp20x_adc: add support for AXP717 ADCChris Morgan1-0/+160
Add support for the AXP717 ADC. The AXP717 differs from other ADCs in this series by utilizing a 14 bit ADC for all channels (a full 16 bits with the first 2 digits reserved). It also differs by lacking a battery discharge current channel. Note that while the current charge channel itself is included in this driver for the AXP717 and listed in the datasheet, no scale or offset was given for this channel. For now no scale or offset is provided in this driver. Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Link: https://patch.msgid.link/20240821215456.962564-13-macroalpha82@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-07iio: adc: axp20x_adc: Add adc_en1 and adc_en2 to axp_dataChris Morgan1-7/+15
Add the register for adc_en1 and adc_en2 to the axp_data struct. This allows us to specify a different register to enable the adc channels for different devices such as the AXP717. Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240821215456.962564-2-macroalpha82@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-05iio: adc: standardize on formatting for id match tablesJonathan Cameron64-169/+169
This is a frequent minor comment in reviews, so start cleaning up existing drivers in the hope we get fewer cases of cut and paste. There are not kernel wide rules for these, but for IIO the style that I prefer (and hence most common) is: - Space after { and before } - No comma after terminator { } This may cause merge conflicts but they should be trivial to resolve hence I have not broken this into per driver patches. Link: https://patch.msgid.link/20240818180912.719399-1-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-05iio: proximity: aw96103: Add support for aw96103/aw96105 proximity sensorshuaijie wang3-0/+858
AW96103 is a low power consumption capacitive touch and proximity controller. Each channel can be independently config as sensor input, shield output. Channel Information: aw96103: 3-channel aw96105: 5-channel Signed-off-by: shuaijie wang <wangshuaijie@awinic.com> Link: https://patch.msgid.link/20240827080229.1431784-3-wangshuaijie@awinic.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: adc: sophgo-saradc: Add driver for Sophgo CV1800B SARADCThomas Bonnefille3-0/+238
This adds a driver for the Sophgo CV1800B SARADC. Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com> Link: https://patch.msgid.link/20240829-sg2002-adc-v5-2-aacb381e869b@bootlin.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: imu: st_lsm6dsx: Remove useless dev_fwnode() callsAndy Shevchenko1-17/+6
The device property APIs designed that way that they will return an error when there is no valid fwnode provided. Moreover, the check for NULL of dev_fwnode() is not fully correct as in some (currently rare) cases it may contain an error pointer. This is not a problem anyway (see keyword 'valid' above) that's why the code works properly even without this change. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://patch.msgid.link/20240826212344.866928-3-andy.shevchenko@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: imu: st_lsm6dsx: Use iio_read_acpi_mount_matrix() helperAndy Shevchenko1-69/+1
Replace the duplicate ACPI "ROTM" data parsing code with the new shared iio_read_acpi_mount_matrix() helper. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://patch.msgid.link/20240826212344.866928-2-andy.shevchenko@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: adc: mcp320x: Drop vendorless compatible stringsRob Herring (Arm)1-10/+0
The vendorless compatible strings are deprecated and weren't retained when the binding was converted to schema. As a result, they are listed as undocumented when running "make dt_compatible_check". Rather than add them back to the schema, let's just drop them as they are unnecessary. Furthermore, they are unnecessary as the SPI matching will strip the vendor prefix on compatible string and match that against the spi_device_id table. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20240826191728.1415189-1-robh@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: dac: ad5449: drop support for platform dataBartosz Golaszewski1-13/+2
There are no longer any users of the platform data struct. Remove support for it from the driver. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20240814092629.9862-1-brgl@bgdev.pl Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: adc: xilinx-ams: use device_* to iterate over device child nodesJavier Carrasco1-10/+5
Use `device_for_each_child_node_scoped()` in `ams_parse_firmware()` to explicitly state device child node access, and simplify the child node handling as it is not required outside the loop. Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Reviewed-by: Mike Leach <mike.leach@linaro.org> Link: https://patch.msgid.link/20240820-device_child_node_access-v3-1-1ee09bdedb9e@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: adc: ad4695: implement calibration supportDavid Lechner1-2/+156
The AD4695 has a calibration feature that allows the user to compensate for variations in the analog front end. This implements this feature in the driver using the standard `calibgain` and `calibbias` attributes. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240820-ad4695-gain-offset-v1-2-c8f6e3b47551@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: adc: ad4695: add 2nd regmap for 16-bit registersDavid Lechner1-15/+68
The AD4695 and similar chips have some multibyte registers that have to be read/written in a single operation. So we need to add a 2nd regmap for these registers. These registers are removed from the 8-bit regmap allowable ranges and AD4695_MAX_REG is dropped since it would be ambiguous now. debugfs register access is also updated to automatically use the correct regmap depending on the register address. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240820-ad4695-gain-offset-v1-1-c8f6e3b47551@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: bmi323: peripheral in lowest power state on suspendDenis Benato1-2/+159
The bmi323 is mounted on some devices that are powered by an internal battery: help in reducing system overall power drain while the system is in s2idle or the imu driver is not loaded by resetting it in its lowest power draining state. Signed-off-by: Denis Benato <benato.denis96@gmail.com> Link: https://patch.msgid.link/20240824141122.334620-2-benato.denis96@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: accel: bmc150: Improve bmc150_apply_bosc0200_acpi_orientation()Andy Shevchenko1-3/+3
By using ACPI_HANDLE() the handler argument can be retrieved directly. Replace ACPI_COMPANION() + dereference with ACPI_HANDLE(). Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://patch.msgid.link/20240823230107.745900-1-andy.shevchenko@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: accel: bmc150: use fwnode_irq_get_byname()Andy Shevchenko1-2/+2
Use the generic fwnode_irq_get_byname() in place of of_irq_get_byname() to get the IRQ number from the interrupt pin. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://patch.msgid.link/20240823230056.745872-1-andy.shevchenko@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: proximity: cros_ec_mkbp_proximity: Switch to including ↵Andy Shevchenko1-1/+1
mod_devicetable.h for struct of_device_id definition of.h was only included for this definition, so include the correct header instead. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://patch.msgid.link/20240823220718.743596-1-andy.shevchenko@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: magnetometer: ak8975: Add AK09118 supportDanila Tikhonov2-1/+38
Add additional AK09118 to the magnetometer driver which has the same register mapping and scaling as the AK09112 device. Signed-off-by: Danila Tikhonov <danila@jiaxyga.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org> Link: https://patch.msgid.link/20240819-ak09918-v4-4-f0734d14cfb9@mainlining.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: magnetometer: ak8975: Fix reading for ak099xx sensorsBarnabás Czémán1-16/+16
Move ST2 reading with overflow handling after measurement data reading. ST2 register read have to be read after read measurment data, because it means end of the reading and realease the lock on the data. Remove ST2 read skip on interrupt based waiting because ST2 required to be read out at and of the axis read. Fixes: 57e73a423b1e ("iio: ak8975: add ak09911 and ak09912 support") Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org> Link: https://patch.msgid.link/20240819-ak09918-v4-2-f0734d14cfb9@mainlining.org Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-09-03iio: magnetometer: ak8975: Relax failure on unknown idBarnabás Czémán1-3/+7
Relax failure when driver gets an unknown device id for allow probe for register compatible devices. Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org> Link: https://patch.msgid.link/20240819-ak09918-v4-1-f0734d14cfb9@mainlining.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-21drivers:iio:Fix the NULL vs IS_ERR() bug for debugfs_create_dir()Yang Ruibin1-1/+1
The debugfs_create_dir() function returns error pointers. It never returns NULL. So use IS_ERR() to check it. Signed-off-by: Yang Ruibin <11162571@vivo.com> Link: https://patch.msgid.link/20240821083911.3411-1-11162571@vivo.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-21iio: sgp40: retain documentation in driverAndreas Klinger1-3/+8
Retain documentation on how the voc index is actually calculated in driver code as it'll be removed in Documentation. This is a follow up on patch "[PATCH] iio: ABI: remove duplicate in_resistance_calibbias" from David. Signed-off-by: Andreas Klinger <ak@it-klinger.de> Link: https://patch.msgid.link/ZsWdFOIkDtEB9WGO@mail.your-server.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-17iio: light: ltr390: Calculate 'counts_per_uvi' dynamicallyAbhash Jha1-2/+12
counts_per_uvi depends on the current value of gain and resolution. Hence, we cannot use the hardcoded value 96. The `counts_per_uvi` function gives the count based on the current gain and resolution (integration time). Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com> Link: https://patch.msgid.link/20240814113135.14575-3-abhashkumarjha123@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-17iio: light: ltr390: Add ALS channel and support for gain and resolutionAbhash Jha1-15/+90
Add new ALS channel and allow reading lux and scale values. Also provide gain and resolution configuration for ALS channel. Add automatic mode switching between the UVS and ALS channel based on which channel is being accessed. The default mode in which the sensor start is ALS mode. Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com> Link: https://patch.msgid.link/20240814113135.14575-2-abhashkumarjha123@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-17iio: adc: ad4695: implement triggered bufferDavid Lechner1-3/+247
This implements buffered reads for the ad4695 driver using the typical triggered buffer implementation, including adding a soft timestamp channel. The chip has 4 different modes for doing conversions. The driver is using the advanced sequencer mode since that is the only mode that allows individual configuration of all aspects each channel (e.g. bipolar config currently and oversampling to be added in the future). Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240813-iio-adc-ad4695-buffered-read-v2-1-9bb19fc1924b@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-17iio: proximity: hx9023s: Fix error code in hx9023s_property_get()Dan Carpenter1-1/+2
If we're returning because "reg >= HX9023S_CH_NUM" then set the error code to -ENIVAL instead of success. Fixes: 60df548277b7 ("iio: proximity: Add driver support for TYHX's HX9023S capacitive proximity sensor") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/49b5a9bc-e5ca-43a7-a665-313eb06fbe27@stanley.mountain Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-17iio: light: noa1305: Fix up integration time look upMarek Vasut1-1/+1
The current code is always iterating over two fields in the noa1305_int_time_available array. Fix iteration limit, which has to be halved to avoid out of bounds access in case the value that is being looked up is not in the array. Fixes: 025f23cfebad ("iio: light: noa1305: Make integration time configurable") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Marek Vasut <marex@denx.de> Link: https://patch.msgid.link/20240814191946.81386-1-marex@denx.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-17iio: humidity: Add support for ENS210Joshua Felmeden3-0/+351
Add support for ENS210/ENS210A/ENS211/ENS212/ENS213A/ENS215. The ENS21x is a family of temperature and relative humidity sensors with accuracies tailored to the needs of specific applications. Signed-off-by: Joshua Felmeden <jfelmeden@thegoodpenguin.co.uk> Link: https://patch.msgid.link/20240805-ens21x-v6-2-5bb576ef26a6@thegoodpenguin.co.uk Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-17iio: imu: inv_mpu6050: fix interrupt status read for old buggy chipsJean-Baptiste Maneyrol1-2/+11
Interrupt status read seems to be broken on some old MPU-6050 like chips. Fix by reverting to previous driver behavior bypassing interrupt status read. This is working because these chips are not supporting WoM and data ready is the only interrupt source. Fixes: 5537f653d9be ("iio: imu: inv_mpu6050: add new interrupt handler for WoM events") Cc: stable@vger.kernel.org Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # LG P895 Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com> # LG P880 Link: https://patch.msgid.link/20240814143735.327302-1-inv.git-commit@tdk.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-17iio: adc: ad7173: fix GPIO device infoDumitru Ceclan1-3/+0
Models AD4114/5/6 have .higher_gpio_bits = true. This is not correct as the only models that have the GPIO bits to a higher position are AD4111/2. Fix by removing the higher_gpio_bits = true from the AD4114/5/6 models. Fixes: 13d12e3ad12d ("iio: adc: ad7173: Add support for AD411x devices") Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com> Link: https://patch.msgid.link/20240809134909.26829-1-dumitru.ceclan@analog.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: imu: adis16460: drop ifdef around CONFIG_DEBUG_FSNuno Sa1-14/+4
Use IS_ENABLED(CONFIG_DEBUG_FS) to return in case debugfs is not present. Since this is known at compile time, it allows the compiler to drop any unused code. Therefore no need to wrap the code with #ifdef. While at it make adis16460_debugfs_init() void as the return code is ignored. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240809-dev-adis-debugfs-improv-v1-4-d3adb6996518@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: imu: adis16400: drop ifdef around CONFIG_DEBUG_FSNuno Sa1-14/+4
Use IS_ENABLED(CONFIG_DEBUG_FS) to return in case debugfs is not present. Since this is known at compile time, it allows the compiler to drop any unused code. Therefore no need to wrap the code with #ifdef. While at it make adis16400_debugfs_init() void as the return code is ignored. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240809-dev-adis-debugfs-improv-v1-3-d3adb6996518@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: imu: adis16480: drop ifdef around CONFIG_DEBUG_FSNuno Sa1-14/+4
Use IS_ENABLED(CONFIG_DEBUG_FS) to return in case debugfs is not present. Since this is known at compile time, it allows the compiler to drop any unused code. Therefore no need to wrap the code with #ifdef. While at it make adis16480_debugfs_init() void as the return code is ignored. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240809-dev-adis-debugfs-improv-v1-2-d3adb6996518@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: imu: adis16475: drop ifdef around CONFIG_DEBUG_FSNuno Sa1-6/+3
Use IS_ENABLED(CONFIG_DEBUG_FS) to return early in case debugfs is not present. Since this is known at compile time, it allows the compiler to drop any unused code. Therefore no need to wrap the code with #ifdef. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240809-dev-adis-debugfs-improv-v1-1-d3adb6996518@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: adc: pac1921: add missing error return in probe()Dan Carpenter1-2/+2
This error path was intended to return, and not just print an error. The current code will lead to an error pointer dereference. Fixes: 371f778b83cd ("iio: adc: add support for pac1921") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Matteo Martelli <matteomartelli3@gmail.com> Link: https://patch.msgid.link/1fa4ab12-0939-477d-bc92-306fd32e4fd9@stanley.mountain Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: Fix spelling mistake "avaialable" -> "available"Colin Ian King1-1/+1
There is a spelling mistake in a dev_warn message. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://patch.msgid.link/20240807094745.4174785-1-colin.i.king@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: dac: ltc2664: Fix off by one in ltc2664_channel_config()Dan Carpenter1-1/+1
This comparison should be >= ARRAY_SIZE() instead of >. The "mspan" variable is later used as an array index into ltc2664_mspan_lut[] so this is an off by one bug. Fixes: 4cc2fc445d2e ("iio: dac: ltc2664: Add driver for LTC2664 and LTC2672") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/5727ab54-6280-466e-b107-1b6006e5ab29@stanley.mountain Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: bmi323: suspend and resume triggering on relevant pm operationsDenis Benato4-0/+26
Prevent triggers from stop working after the device has entered sleep: use iio_device_suspend_triggering and iio_device_resume_triggering helpers. Signed-off-by: Denis Benato <benato.denis96@gmail.com> Link: https://patch.msgid.link/20240807185619.7261-3-benato.denis96@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: trigger: allow devices to suspend/resume theirs associated triggerDenis Benato1-0/+27
When a machine enters a sleep state while a trigger is associated to an iio device that trigger is not resumed after exiting the sleep state: provide iio device drivers a way to suspend and resume the associated trigger to solve the aforementioned bug. Each iio driver supporting external triggers is expected to call iio_device_suspend_triggering before suspending, and iio_device_resume_triggering upon resuming. Signed-off-by: Denis Benato <benato.denis96@gmail.com> Link: https://patch.msgid.link/20240807185619.7261-2-benato.denis96@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: light: apds9960: Add proximity and gesture offset calibrationAbhash Jha1-1/+54
Proximity and gesture offset registers perform offset correction to improve cross-talk performance. Added `calibbias` to the proximity and gesture channels. Provided facility to set calibbias based on the channel number. Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com> Link: https://patch.msgid.link/20240804134212.51682-2-abhashkumarjha123@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: adc: stm32-dfsdm: add scaling support to dfsdmOlivier Moysan2-1/+105
Add scaling support to STM32 DFSDM. When used in an analog context, a DFSDM filter typically converts the data from a sigma delta modulator. The IIO device associated to the DFSDM filter provides these data as raw data. The IIO device can provide scaling information (voltage and offset) to allow conversion of raw data into physical values. With the new binding based on IIO backend framework, the sigma delta modulators are defined as backends providing scaling information. The scaling is not supported with legacy binding. Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Acked-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240730084640.1307938-10-olivier.moysan@foss.st.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: add iio backend support to sd modulatorOlivier Moysan2-1/+97
The legacy sd modulator driver registers the sigma delta modulator as an IIO channel provider. This implementation is not convenient when the SD modulator has to be cascaded with another IIO device. The scaling information is distributed across devices, which makes it difficult to report consistent scaling data on IIO devices. The solution is to expose these cascaded IIO devices as an aggregate device, which report global scaling information. Add IIO backend support to SD modulator to allow scaling information management. Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Link: https://patch.msgid.link/20240730084640.1307938-9-olivier.moysan@foss.st.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: adc: stm32-dfsdm: adopt generic channels bindingsOlivier Moysan1-36/+154
Move to generic channels binding to ease new backend framework adoption and prepare the convergence with MDF IP support on STM32MP2 SoC family. Legacy binding: DFSDM is an IIO channel consumer. SD modulator is an IIO channels provider. The channel phandles are provided in DT through io-channels property and channel indexes through st,adc-channels property. New binding: DFSDM is an IIO channel provider. The channel indexes are given by reg property in channel child node. This new binding is intended to be used with SD modulator IIO backends. It does not support SD modulator legacy IIO devices. The st,adc-channels property presence is used to discriminate between legacy and backend bindings. The support of the DFSDM legacy channels and SD modulator IIO devices is kept for backward compatibility. Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Link: https://patch.msgid.link/20240730084640.1307938-8-olivier.moysan@foss.st.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: add child nodes support in iio backend frameworkOlivier Moysan1-16/+41
Add an API to support IIO generic channels binding: http://devicetree.org/schemas/iio/adc/adc.yaml# This new API is needed, as generic channel DT node isn't populated as a device. Add devm_iio_backend_fwnode_get() to allow an IIO device backend consumer to reference backend phandles in its child nodes. Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240730084640.1307938-4-olivier.moysan@foss.st.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: add enable and disable services to iio backend frameworkOlivier Moysan1-1/+24
Add iio_backend_disable() and iio_backend_enable() APIs to allow IIO backend consumer to request backend disabling and enabling. Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240730084640.1307938-3-olivier.moysan@foss.st.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: add read scale and offset services to iio backend frameworkOlivier Moysan1-0/+19
Add iio_backend_read_scale() and iio_backend_read_offset() services to read channel scale and offset from an IIO backbend device. Also add a read_raw callback which replicates the read_raw callback of the IIO framework, and is intended to request miscellaneous channel attributes from the backend device. Both scale and offset helpers use this callback. Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240730084640.1307938-2-olivier.moysan@foss.st.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: magnetometer: ak8975: drop incorrect AK09116 compatibleKrzysztof Kozlowski1-1/+0
All compatibles in this binding without prefixes were deprecated, so adding a new deprecated one after some time is not allowed, because it defies the core logic of deprecating things. Drop the AK09916 vendorless compatible. Fixes: 76e28aa97fa0 ("iio: magnetometer: ak8975: add AK09116 support") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240806053016.6401-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: dac: ad9739a: add backend debugfs interfaceNuno Sa1-1/+7
Call iio_backend_debugfs_add() to add (if available) the backend debug interface. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240806-dev-backend-dac-direct-reg-access-v1-2-b84a6e8ee8a0@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-08-10iio: dac: adi-axi-dac: support debugfs direct_reg_accessNuno Sa1-0/+12
Make it possible to read/write registers on the backend using the debugfs interface for it. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240806-dev-backend-dac-direct-reg-access-v1-1-b84a6e8ee8a0@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>