summaryrefslogtreecommitdiff
path: root/drivers/iio
AgeCommit message (Collapse)Author
36 hoursMerge branch 'headers' of git://git.infradead.org/users/willy/pagecache.gitMark Brown
# Conflicts: # net/ceph/osd_client.c
36 hoursMerge branch 'togreg' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git # Conflicts: # drivers/iio/adc/ade9000.c
36 hoursMerge branch 'for-mfd-next' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
39 hoursMerge branch 'fixes-togreg' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
3 daysmfd: lm3533: Convert to use OF bindingsSvyatoslav Ryhel
Since there are no users of this driver via platform data, remove the platform data support and switch to using Device Tree bindings. Previously, all cell devices were linked to the parent device. This could cause problems further down the line because the LM3533 has multiple cells of the same type. Using a single phandle to the parent could cause confusion when attempting to reference or call the correct child node. Since this commit adds a dedicated node for every cell, remove linking of the cell to the parent node. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org> #for backlight Acked-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> #for-iio Link: https://patch.msgid.link/20260731113632.158440-9-clamor95@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
3 daysiio: light: lm3533-als: Remove redundant pdata helpersSvyatoslav Ryhel
The lm3533_als_set_input_mode() and lm3533_als_set_resistor() functions are used only in lm3533_als_setup(). Incorporate their code into lm3533_als_setup() directly to simplify driver readability. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Jonathan Cameron <jic23@kernel.org> Link: https://patch.msgid.link/20260731113632.158440-6-clamor95@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
3 daysmfd: lm3533: Pass only regmap and light sensor presence to child devicesSvyatoslav Ryhel
Instead of passing the entire lm3533 core data structure, only pass the regmap and the light sensor presence flag to child devices. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Acked-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> #for-iio Link: https://patch.msgid.link/20260731113632.158440-5-clamor95@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
3 daysmfd: lm3533: Remove driver specific regmap wrappersSvyatoslav Ryhel
Remove driver-specific regmap wrappers in favor of using regmap helpers directly. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Acked-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> Link: https://patch.msgid.link/20260731113632.158440-3-clamor95@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
3 daysiio: imu: adis16400: Check return value of spi_setup()Salah Triki
In adis16400_initial_setup(), the return value of spi_setup() was ignored. If SPI configuration fails, the driver would proceed with the initialization anyway, leading to undefined behavior or silent failures during device setup. Check the return value of spi_setup() and return the error code immediately if it fails. Fixes: cd888a17f95f ("staging:iio:adis16400: Use adis library") Signed-off-by: Salah Triki <salah.triki@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
3 daysiio: accel: kionix-kx022a: Fix IPOL macro nameMatti Vaittinen
The "interrupt polarity high"-macro for KX022A variant is defined as: "#define KX022A_MASK_IPOL KX022A_MASK_IPOL1" However, the KX022A_MASK_IPOL1 is not defined anywhere, so actually using the KX022A_IPOL_HIGH would produce a compile error. Fix the define by using correct mask. Fixes: 7c1d1677b322 ("iio: accel: Support Kionix/ROHM KX022A accelerometer") Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
3 daysiio: dac: Add AD5529R DAC driver supportJanani Sunil
Add support for AD5529R 16-channel, 12/16 bit Digital to Analog Converter from Analog Devices. The device communicates over SPI and supports per-channel output range configuration. An optional external 4.096V reference can be used in place of the internal reference. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad5529r.pdf Signed-off-by: Janani Sunil <janani.sunil@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
3 daysiio: imu: inv_icm42600: fix odr change not caught in certain casesJean-Baptiste Maneyrol
When using both accel and gyro with different frequencies, the ODR change flag in the FIFO header can be sometime in a packet with invalid data. Since we are ignoring these packets, we miss the ODR change and any further change are blocked until sensor is turned off. Fix this by moving the packet data validity check after the ODR change flag check. Fixes: ec74ae9fd37c ("iio: imu: inv_icm42600: add accurate timestamping") Cc: stable@vger.kernel.org Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
3 daysiio: dac: ad3530r: add support for AD5710R/AD5711RKim Seer Paller
Add support for the AD5710R/AD5711R, 8-channel 16-/12-bit configurable IDAC/VDAC parts. They share the AD3530R register map and access model, so fold them into this driver. Each channel is configured as voltage or current output from its DT channel@N node via adi,ch-func, building the iio_chan_spec dynamically. Voltage channels enable VMODE_EN and report the reference-derived scale, current channels report the 50 mA internal Iref scale. The powerdown mode is read-only and derived from the channel's configured type. Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
3 daysiio: dac: ad3530r: parameterize DAC resolutionKim Seer Paller
In preparation for adding the AD5710R/AD5711R, which support selectable 12-/16-bit resolution, add a per-chip resolution field and use it in the raw read/write and scale paths instead of assuming 16 bits. Drop AD3530R_REG_VAL_MASK and AD3530R_DAC_MAX_VAL, which hardcoded the 16-bit width and are now unused. Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
6 daysiio: proximity: vcnl3020: fix ISR bitmask check in IRQ handlerSalah Triki
The threaded IRQ handler contained multiple issues in handling interrupt events and clearing status flags: 1. ISR bit check: The handler incorrectly checked the Interrupt Status Register (VCNL_ISR) against VCNL_ICR_THRES_EN (BIT(1)), which is a bitmask meant for the Control Register (VCNL_PS_ICR). In VCNL_ISR, BIT(1) corresponds only to low-threshold interrupts. A high-threshold interrupt (VCNL_INT_TH_HI, BIT(0)) on its own was completely ignored and returned IRQ_NONE. 2. Event direction & channel index: The handler unconditionally pushed a RISING event code on channel index 1. The driver only registers a single proximity channel (index 0), and low-threshold interrupts should be reported with IIO_EV_DIR_FALLING. 3. ISR clearing: The write-back to acknowledge the interrupt only preserved BIT(1) instead of masking against both valid status bits. Fix this by checking both VCNL_INT_TH_HI and VCNL_INT_TH_LOW bits in VCNL_ISR, pushing separate IIO events with the correct direction and channel index (0), and properly clearing handled status bits. Fixes: 3363fbbe19e5 ("iio: proximity: vcnl3020: add periodic mode") Signed-off-by: Salah Triki <salah.triki@gmail.com> Reviewed-by: Ivan Mikhaylov <fr0st61te@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
6 daysiio: proximity: vl53l0x-i2c: claim direct mode for raw readsDonggeun Yoo
vl53l0x_read_raw() starts a single-shot ranging measurement and reads back the result. Once the triggered buffer is enabled the sensor runs in continuous mode and its data-ready interrupt is routed to the trigger, so a concurrent in_distance_raw read disturbs the streaming setup and never gets its completion, returning -ETIMEDOUT. The original submission claimed direct mode here, but it was dropped during review because the driver had no buffer support at the time [1]. Continuous (buffered) mode was later added without restoring the claim [2], reintroducing the conflict. Reject direct reads while buffered capture is active by claiming direct mode around the measurement, as the vl53l1x sibling already does. Fixes: 762186c6e7b1 ("iio: proximity: vl53l0x-i2c: Added continuous mode support") Link: https://lore.kernel.org/linux-iio/20180911160300.GA9212@himanshu-Vostro-3559/ [1] Link: https://lore.kernel.org/linux-iio/20240909101508.263085-3-abhashkumarjha123@gmail.com/ [2] Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
6 daysiio: dac: mcp47a1: Allow full-scale outputTuna Kılıç
The MCP47A1 has 64 resistors but exposes 65 wiper positions. The valid DAC codes are 0 through 64, and code 64 selects VREF. The driver currently advertises 0 through 63 and uses 64 as the length argument to in_range(), which also rejects 64. Therefore userspace cannot select full-scale output. Advertise code 64 and make validation cover all 65 codes. Keep 64 as the scale denominator because the output voltage is VREF multiplied by the code and divided by 64. Fixes: 350d1fb9204b ("iio: dac: mcp47a1: add support for new device") Signed-off-by: Tuna Kılıç <tuna@tunakilic.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Tested-by: Joshua Crofts <joshua.crofts1@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
6 daysiio: accel: kionix-kx022a: Prevent memory leak and fix stateMatti Vaittinen
The driver allocates memory for samples at buffer enable path. If regmap operation fails in the kx022a_fifo_enable() at the buffer enable path, the allocated memory is never freed. Furthermore, the state information and previous hardware configuration(s) aren't undone, potentially leaving WMI interrupts and buffers enabled, or driver state flags wrong. Free the memory and revert the hardware configuration and state flags on error path. Fixes: e7123a4dfcd7 ("iio: accel: kionix-kx022a: Refactor driver and add chip_info structure") Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
6 daysiio: light: rohm-bu27034: Fix infinite delay on errorMatti Vaittinen
When reading an integration-time fails, the code will use error code to compute the sleep time. Fix this by using the smallest integration time as a default if reading fails. Fixes: e52afbd61039 ("iio: light: ROHM BU27034 Ambient Light Sensor") Suggested-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
6 daysiio: adc: sun4i-gpadc-iio: clean up on thermal zone registration failureFelix Gu
If devm_thermal_of_zone_register() fails, probe returns without unregistering the IIO map array or disabling runtime PM. Jump to err_map to release them. Fixes: b0a242894f11 ("iio: adc: sun4i-gpadc-iio: register in the thermal after registering in pm") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
6 daysiio: adc: sun4i-gpadc-iio: drop underflowing pm_runtime_put() callsFelix Gu
Neither the error path in sun4i_gpadc_probe() nor sun4i_gpadc_remove() ever holds a runtime PM usage count. So the pm_runtime_put() in both places always triggers the "Runtime PM usage count underflow!" warning on every failed probe and every unbind. Drop both calls. Fixes: d1caa9905538 ("iio: adc: add support for Allwinner SoCs ADC") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daystreewide: refresh kmalloc_obj() conversionsKees Cook
This is another run of the Coccinelle script for converting kmalloc() family of allocations to kmalloc_obj() via the existing rules in scripts/coccinelle/api/kmalloc_objs.cocci This catches both the set of kmalloc() uses added since the first kmalloc_obj() conversions in v7.0 and adds a large group missed in the first pass due to Coccinelle not interacting well with the cleanup.h scoped_...() family of macros[1]. I worked around this with spatch's "--macro-file" argument to a file with all the scoped_...() macros mapped to Coccinelle's YACFE_ITERATOR[2] as that was the closest viable control flow indicator I could find. Build tested allmodconfig on x86, arm64, arm, loongarch, mips, powerpc, riscv, and s390 with no new warnings. Link: https://lore.kernel.org/lkml/202609021314.8A9C0B8@keescook/ [1] Link: https://github.com/coccinelle/coccinelle/blob/master/standard.h [2] Signed-off-by: Kees Cook <kees+treewide@kernel.org>
8 daysiio: fix typos in commentsHemanth Selam
Fix typos in comments, reported by scripts/checkpatch.pl using the misspelling list in scripts/spelling.txt. Only touches comments, no code changes. Assisted-by: LLM Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: adc: axp288: Add TS bias override for Haier HV103HVladyslav Ivashchenko
The Haier HV103H firmware configures the AXP288 TS pin bias current to 60 uA. This causes the battery temperature reading to cross the charging temperature threshold under load, incorrectly stopping battery charging. Setting the TS bias current to 80 uA fixes the temperature measurement and prevents charging from being incorrectly disabled. Add a DMI quirk to use the 80 uA TS bias current on the Haier HV103H. Fixes: 9bcf15f75cac ("iio: adc: axp288: Fix TS-pin handling") Fixes: 048058399f19 ("iio: adc: axp288: Override TS pin bias current for some models") # Add necessary infrastructure Signed-off-by: Vladyslav Ivashchenko <cactucatu4eckuu@gmail.com> Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: light: stk3310: support the Sensortek STK36C61Jorijn van der Graaf
The Sensortek STK36C61 is a 3-in-1 ambient light / proximity / RGB colour sensor. Its register interface is compatible with the feature set this driver uses. Add its chip ID to the known-ID list and the device table entries. Whenever the ALS engine runs, the chip also measures four colour channels: red, green, blue and clear, laid out directly after the ALS data as 16-bit big-endian values. R, G and B are gained by the same ALSCTRL gain field the illuminance channel uses, clear by its own gain field in the GAINCTRL register, and the whole colour block integrates over the ALS integration time. Expose the channels with per-channel scale and a shared integration time, as suggested by Jonathan Cameron for the green channel. The scales reuse the driver's existing gain-only table: green equals the ALS data, so its scale must read identically to the pre-existing in_illuminance_scale. Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: light: stk3310: add per-chip match dataJorijn van der Graaf
Introduce a chip_info structure carrying the device name and channel specification, attach it to every i2c, OF and ACPI table entry, and let probe take it from the match data, failing when there is none. Every firmware bind path carries match data, and with the id names in lower case a client instantiated through the sysfs new_device interface under the compatible's lower-case suffix receives it through the id table. The shared channel definitions move into macros. The ACPI table entries change to named initializers, matching the other id tables. This is a preparatory change for a variant that provides more channels than the existing parts. No functional change for firmware-described devices. A sysfs client under a name that binds without matching any id entry (the full compatible string) now fails probe with an error instead of probing as an stk3310. Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: light: stk3310: move the data registers into the channel addressJorijn van der Graaf
The RAW read selects its data register with a per-channel-type branch. Record each channel's data register in its .address field and read from there, so adding a channel does not grow the branch. Suggested-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: light: stk3310: lower-case the i2c device ID namesJorijn van der Graaf
The i2c device IDs were introduced in capitals, mirroring the ACPI _HID entries added by the same commit be9e6229d676 ("iio: light: Add support for Sensortek STK3310"); at that point the driver enumerated through ACPI only, with no OF table and no i2c module alias export. ACPI _HIDs have their own naming rules; i2c device names conventionally use the lower-case part name, matching the devicetree compatible suffix. The spelling is visible: a client instantiated through the i2c sysfs interface under the lower-case name taken from a compatible string binds through the OF table's name fallback, but has no firmware node, so i2c_match_id() is the only way for it to reach driver match data, and its string comparison is case-sensitive, so the capitals can never match. Lower-case the names so such clients match the id table, and receive the per-chip match data a subsequent change attaches to it. The module aliases follow the rename (i2c:STK3310 becomes i2c:stk3310), and a sysfs client instantiated under a capitals name no longer binds. Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: temperature: tsys02d: make headers conform to IWYUJoshua Crofts
Remove the catch-all kernel.h header, add missing headers and remove unused headers. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: temperature: tsys02d: reorder headersJoshua Crofts
Sort the headers alphabetically and group the IIO specific headers separately. No functional change. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: temperature: tsys01: make headers conform to IWYUJoshua Crofts
Remove the catch-all kernel.h header, add missing headers and remove unused headers. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: temperature: tsys01: reorder headersJoshua Crofts
Sort the headers alphabetically and group the IIO headers and vendor specific header separately. No functional change. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: temperature: tmp117: make headers conform to IWYUJoshua Crofts
Remove the catch-all kernel.h header and add the missing <linux/dev_printk.h> header to enforce IWYU. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: temperature: tmp117: sort headers alphabeticallyJoshua Crofts
Sort the headers alphabetically to improve readability. No functional change. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: temperature: mlx90635: make headers conform to IWYUJoshua Crofts
Remove the catch-all kernel.h header and add the missing headers to enforce IWYU. Additionally, sort the headers alphabetically. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: temperature: mlx90632: make headers conform to IWYUJoshua Crofts
Remove the catch-all kernel.h header and add the missing headers to enforce IWYU. Additionally, sort the entries alphabetically. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: temperature: ltc2983: make headers conform to IWYUJoshua Crofts
Remove the catch-all kernel.h header and add the missing headers to enforce IWYU (some standard headers are already include subheaders, i.e. errno.h is included by err.h). Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: temperature: ltc2983: reorder headersJoshua Crofts
Separate the IIO specific header and group unaligned.h with the other generic <linux/*> headers. No functional change. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: temperature: iqs620at-temp: make headers conform to IWYUJoshua Crofts
Remove the catch-all kernel.h header and add the missing headers to enforce IWYU. Additionally, separate the IIO specific header from the generic <linux/*> headers. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: adc: add MAX40080 current-sense amplifier driverStefan Popa
The MAX40080 is a bidirectional current-sense amplifier with an integrated 12-bit ADC and an I2C/SMBus interface. It measures the voltage across an external shunt resistor and the input bus voltage, storing the results in an internal FIFO. Add a direct-mode IIO driver exposing the current and voltage channels with raw, scale and oversampling ratio attributes, a configurable oversampling (digital averaging) ratio, and PEC-protected register access. The current scale is derived from the shunt resistor value described in the device tree. The driver operates in single-measurement mode: each raw read triggers an on-demand conversion via SMBus Quick Command and returns a matched current/voltage pair. This avoids the latency and complexity of the continuous FIFO mode while ensuring each read reflects the current state. The two selectable current-sense ranges are exposed through scale/scale_available. Continuous FIFO buffering, threshold events and the alert interrupt are intentionally left out of this initial submission and may be added later. Co-developed-by: Ciprian Hegbeli <ciprian.hegbeli@analog.com> Signed-off-by: Ciprian Hegbeli <ciprian.hegbeli@analog.com> Signed-off-by: Stefan Popa <stefan.popa@analog.com> Reviewed-by: Siratul Islam <siratul.islam@linux.dev> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: accel: adxl367: add support for INT2 interrupt pinAntoniu Miclaus
The ADXL367 provides two independent interrupt output pins, INT1 and INT2, each with its own event mapping register (INTMAP1_LOWER at 0x2A and INTMAP2_LOWER at 0x2B) sharing an identical bit layout. Until now the driver hardcoded INT1 for all interrupt mappings, so a board that routes only INT2 to the host could never receive activity, inactivity or FIFO watermark interrupts. Determine the connected pin from the interrupt-names device tree property using fwnode_irq_get_byname(), and route the interrupt mappings to the matching register. Use the interrupt number returned by the lookup for devm_request_threaded_irq() so the requested line always matches the routed INTMAP register, regardless of the order in which the interrupts are listed. When no interrupt-names are present, default to INT1 and the bus-provided interrupt to preserve the existing behaviour. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
8 daysiio: accel: adxl367: use regmap_assign_bits()Antoniu Miclaus
Several helpers set or clear a fixed set of bits based on a boolean using the regmap_update_bits(reg, mask, en ? mask : 0) idiom. Replace these with regmap_assign_bits(), which expresses the same intent more concisely. No functional change intended. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
9 daysiio: position: iqs624: use devm_blocking_notifier_chain_register()Eliav Farber
Replace the blocking_notifier_chain_register() + devm_add_action_or_reset() pattern with a single call to devm_blocking_notifier_chain_register(), removing the iqs624_pos_notifier_unregister() callback. Signed-off-by: Eliav Farber <farbere@amazon.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
9 daysiio: light: iqs621-als: use devm_blocking_notifier_chain_register()Eliav Farber
Replace the blocking_notifier_chain_register() + devm_add_action_or_reset() pattern with a single call to devm_blocking_notifier_chain_register(), removing the iqs621_als_notifier_unregister() callback. Signed-off-by: Eliav Farber <farbere@amazon.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
11 daysiio: light: vcnl4000: use sysfs_emit() for near_levelDonggeun Yoo
Use sysfs_emit() instead of sprintf() for writing to the sysfs output buffer. sysfs_emit() is aware of the buffer's PAGE_SIZE limit and is the preferred helper for sysfs callbacks. Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
12 daysiio: adc: rockchip_saradc: Add support for RV1106Vladislav Leonov
The Successive Approximation ADC (SARADC) in RV1106 uses the v2 controller and supports: - 10-bit resolution - Up to 1MS/s sampling rate - 2 single-ended input channels "dt-bindings: iio: adc: rockchip-saradc: Add RV1106 compatible" documents "rockchip,rv1106-saradc" as falling back to "rockchip,rk3588-saradc" (see Link below). The two IP blocks are not equivalent, though: per the RV1106 TRM v0.3, chapter 20 (SAR-ADC), RV1106 only has 2 channels at 10-bit resolution, versus 8 channels at 12-bit on RK3588. Without a dedicated match entry, the driver binds via the fallback compatible and uses the RK3588 channel table, which reports 8 channels instead of 2, and an in_voltage_scale that is off by exactly 4x (4096 vs 1024 full-scale). Add a dedicated compatible/data pair for RV1106 with the correct 2-channel, 10-bit layout. Tested on a custom RV1106-based board, with: &saradc { vref-supply = <&vcc_saradc>; /* 1.8V fixed regulator */ status = "okay"; }; Before this patch: # ls /sys/bus/iio/devices/iio:device0/in_voltage*_raw | wc -l 8 # cat /sys/bus/iio/devices/iio:device0/in_voltage_scale 0.439453125 After this patch: # ls /sys/bus/iio/devices/iio:device0/in_voltage*_raw | wc -l 2 # cat /sys/bus/iio/devices/iio:device0/in_voltage_scale 1.757812500 Link: https://lore.kernel.org/all/20260714131631.v2.1.0b846080833e4b836793c43fc26d1c6d817cf9b4@changeid/ Signed-off-by: Vladislav Leonov <vlad@zlab.su> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
12 daysiio: adc: ti-ads112c04: Add support for TI ADS112C04Kyle Hsieh
Add IIO driver support for the Texas Instruments ADS112C04 (16-bit) delta-sigma ADCs. The driver implements: - Single-shot conversions using the IIO raw read interface. - Dynamic parsing of single-ended and differential channels from device tree child nodes. - Hardware interrupt support via the DRDY pin, falling back to software polling if no IRQ is provided. - Per-channel reference source selection (internal 2.048V, external REFP/REFN, or AVDD) via the reference-sources device tree property. refn-supply is not yet supported. - Hardware reset via the reset controller framework, falling back to the RESET command when no reset controller is present. Signed-off-by: Kyle Hsieh <kylehsieh1995@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
13 daysiio: imu: inv_icm42600: do not read FIFO count for watermark itJean-Baptiste Maneyrol
Optimize data reading for high frequencies by not reading FIFO count in case of watermark interrupt. We cannot already read more than watermark samples because of the timestamping mechanism. It is required to not perturb the timing between the watermark interrupts. Since we also know there is at least watermark samples in the FIFO, let's just read these watermark FIFO samples directly without reading FIFO count in this case. Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
13 daysiio: imu: inv_icm42600: simplify watermark computation by using GCDJean-Baptiste Maneyrol
The watermark computation was in fact resulting in computing the GCD of the latencies when both sensors are on. GCD is required because of the IIO buffer watermark. Move to use gcd() and update documentation accordingly. Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
13 daysiio: imu: inv_icm42600: use 2 sensors fixed packet size of 16 bytesJean-Baptiste Maneyrol
Sometimes dynamic switch between 1 sensor frame to 2 sensors frame is not working when there are too much frames already in the FIFO. By moving accel/gyro on sleep before turning FIFO on, we are storing many FIFO frames before updating the frame format hitting the bug everytime. Fix that by always using the 2 sensors frame of 16 bytes. Also update the hwfifo max watermark reported. Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>