aboutsummaryrefslogtreecommitdiff
path: root/drivers/iio
AgeCommit message (Collapse)AuthorFilesLines
30 hoursMerge tag 'mfd-next-7.4' of ↵Linus Torvalds1-99/+80
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Support & Features: - Cirrus Logic CS42L43: Add support for the CS42L44 variant - Khadas MCU: Add support for the VIM4 MCU variant along with per-variant fan duty-cycle levels and optional fan supply regulator support - Maxim MAX77705: Add support for the PASS2 hardware revision - MediaTek MT6397: Add AUXADC sub-device support for MT6397 - Motorola CPCAP: Support per-board sub-device compositions and add the Tegra20 Mot composition - ROHM BD73800: Add support for the BD73800 PMIC core, regulator, RTC, clock gate, and GPIO sub-devices - TI LM3533: Add VIN regulator supply support, configure initial backlight mapping mode from Device Tree, and implement the `backlight_scale` property - X-Powers AC200: Add support for the AC200 I2C mixed-signal companion IC Improvements & Fixes: - Cirrus Logic CS42L43: Synchronize SoundWire enumeration work in `remove()` before devres cleanup begins - Dialog DA903x: Manage IRQ work cancellation and sub-device removal via devres to prevent use-after-free during teardown - Dialog DA9150: Balance `enable_irq_wake()` with `disable_irq_wake()` during probe failure and driver removal - Intel LPSS: Add DMI quirks for Dell Latitude 5285 and 7275 to ignore ACPI resource conflicts on the I2C4 controller - Intel Quark I2C/GPIO: Manage the fixed-rate clock and its clkdev lookup with devres to fix a resource leak on unbind - Maxim MAX77705: Select `REGMAP_I2C` and `REGMAP_IRQ` in Kconfig to fix build errors - Qualcomm WCD934x: Initialize the parent DMA mask to suppress "DMA mask not set" warnings on child devices - Qualcomm WCD934x: Pass the valid device pointer to `dev_err_probe()` on IRQ lookup failure to avoid a NULL pointer dereference - Rockchip RK8xx: Register the poweroff handler in the atomic `SYS_OFF_MODE_POWER_OFF` phase so polling I2C transfers complete during shutdown - ST-Ericsson AB8500: Use `devm_mfd_add_devices()` to prevent leaking child devices on probe failure - TI BQ257xx: Mark self-modifying BQ25792 configuration registers as volatile - TI LM3533: Set `coherent_dma_mask` to zero to suppress "DMA mask not set" warnings - TI TPS65217: Check for errors during IRQ initialization and masking, and manage IRQ domain and wake teardown with devres - TI TWL: Unregister the auxiliary platform device via a devres action on probe failure and driver unbind Cleanups & Refactoring - Core: Convert drivers from deprecated `SIMPLE_DEV_PM_OPS()` to `DEFINE_SIMPLE_DEV_PM_OPS()` and `pm_sleep_ptr()` - Core: Fix spelling mistakes in comments across various MFD drivers and headers - Maintainers: Add ROHM BD73800 PMIC files under the ROHM PMIC entry - Maintainers: Specify the `for-mfd-next` branch for the MFD and Syscon git trees - Dialog DA9062: Use `DEFINE_RES_IRQ_NAMED()` for IRQ resource definitions - Intel LPSS: Simplify DebugFS handling by dropping redundant error checks and intermediate dentry variables, using octal permissions, and switching to `debugfs_remove()` - Khadas MCU: Convert MFD cell arrays to `const` and use `MFD_CELL_NAME()` - ST-Ericsson AB8500: Fix a spelling typo in a comment - TI LM3533: Convert from platform data to Device Tree bindings and pass only regmap and light sensor presence to child devices - TI LM3533: Remove driver-specific regmap wrappers, redundant pdata helpers, and unnecessary `extern` qualifiers, and use `dev_groups` for sysfs attributes - Wolfson WM831x: Fix a spelling typo in a comment Device Tree Binding Updates - HiSilicon Hi6421 SPMI: Fix the compatible string to match `hisilicon,hi6421-spmi` - MediaTek MT6357: Allow an `adc` child node - MediaTek MT6360: Allow two-cell interrupt specifiers with trigger flags - MediaTek MT6397: Document the `#sound-dai-cells` property - MediaTek MT6397: Document the battery-backed NVMEM layout under the RTC child node - MediaTek MT6397: Document the MT6323 PMIC EFUSE child node - Motorola CPCAP: Convert MFD and power button bindings to DT schema and document the Mapphone and Mot compositions - Qualcomm SPMI PMIC: Document the PM4125 audio codec compatible - Qualcomm SPMI PMIC: Document the PMAU0102 PMIC compatible - Qualcomm TCSR: Document the MSM8952 TCSR compatible - Rockchip RK805: Fold the pin controller binding into the RK805 PMIC DT schema - ROHM BD73800: Document the BD73800 PMIC and its regulators - ROHM PMIC: Factor out common pin properties into `rohm,pmic-pins.yaml` and reference them across BD71815, BD71828, and BD72720 bindings - ST-Ericsson AB8500: Document AB8500 and AB8505 buck converter regulators - ST-Ericsson AB8500: Document codec audio graph ports, sound DAI cells, and analog microphone wiring properties - ST-Ericsson DB8500 PRCMU: Deprecate the `db8500-prcmu-regulators` child node and make it optional - Syscon: Document the Ambarella CV75 secure scratchpad compatible - TI BQ25703A: Add the BQ25798 compatible with fallback to BQ25792 - TI Keystone: Convert Device State Control bindings to DT schema - TI LM3533: Document the LM3533 LED controller, backlight, and indicator LED bindings - TI LP3943: Convert MFD and PWM bindings to DT schema - TI TPS61050: Convert bindings to DT schema - TI TPS65086: Make the `regulators` child node optional - TI TPS65910: Document `wakeup-source` and GPIO hog child nodes - TI TWL6040: Convert bindings to DT schema and align property names with the driver - X-Powers AC200: Document the AC200 mixed-signal companion IC" * tag 'mfd-next-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (74 commits) dt-bindings: mfd: db8500-prcmu: Deprecate EPOD regulators dt-bindings: mfd: syscon: Add Ambarella CV75 secure scratchpad dt-bindings: mfd: rockchip,rk805: Convert pinctrl to DT schema mfd: intel-lpss: Add Dell Latitude 7275 to the resource conflict quirk mfd: intel-lpss: Add resource conflict quirk for Dell Latitude 5285 mfd: tps65217: Use devres for IRQ domain and wake teardown mfd: tps65217: Check return value when masking interrupt sources mfd: tps65217: Fix NULL pointer dereference on IRQ init failure dt-bindings: mfd: qcom,spmi-pmic: Add compatibles for pm4125-codec mfd: bq257xx: Mark self-modifying BQ25792 registers volatile dt-bindings: mfd: mediatek: mt6397: describe the RTC's nvmem layout mfd: mt6397-core: Add mt6397 AUXADC support mfd: max77705: Mark PASS2 revision as supported mfd: ab8500: Fix child device leaks on probe failure dt-bindings: mfd: Add MT6397 sound DAI cells dt-bindings: mfd: mediatek: mt6397: Add mt6323 PMIC EFUSE dt-bindings: mfd: hisilicon: Fix Hi6421 SPMI compatible dt-bindings: mfd: ti,bq25703a: Expand to include BQ25798 dt-bindings: mfd: Allow MT6360 interrupt flags dt-bindings: mfd: mediatek: Allow MT6357 ADC ...
10 daysMerge tag 'spmi-for-next' of ↵Greg Kroah-Hartman1-63/+53
ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi into char-misc-next Stephen writes: More than a handful of changes for SPMI. I'm bringing on Abel Vesa to help maintain SPMI so the tree may change in the future but we'll probably continue to send patches when the pile is small. The big change here is that we gained a new function spmi_subdevice_alloc_and_add() to support complex PMICs that have different devices spread throughout the SPMI address. We've grown subdevice drivers that use OF APIs directly to figure out some base address to add to all their register read/write operations which is tightly coupling our parent/child drivers. This change allows us to clean all those drivers up to use standard device APIs and their own regmap instead of relying on a parent SPMI driver to do all the heavy lifting. The series also updated drivers that could use the new API and I picked those all up because they were acked by maintainers. Beyond that we have some minor fixes to the Qualcomm and Mediatek SPMI drivers for bugs in software and hardware and a couple maintainer updates as stated earlier. * tag 'spmi-for-next' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi: MAINTAINERS: Add Abel as SPMI co-maintainer spmi: mtk-pmif: Fix clock reference leak in mtk_spmi_bus_probe() iio: adc: qcom-spmi-iadc: Remove regmap R/W wrapper functions iio: adc: qcom-spmi-iadc: Migrate to devm_spmi_subdevice_alloc_and_add() misc: qcom-coincell: Migrate to devm_spmi_subdevice_alloc_and_add() phy: qualcomm: eusb2-repeater: Migrate to devm_spmi_subdevice_alloc_and_add() power: reset: qcom-pon: Migrate to devm_spmi_subdevice_alloc_and_add() nvmem: qcom-spmi-sdam: Migrate to devm_spmi_subdevice_alloc_and_add() spmi: Add helper to get a parent SPMI device spmi: Implement spmi_subdevice_alloc_and_add() and devm variant spmi: Remove unneeded goto in spmi_device_add() error path spmi: Print error status with %pe format spmi: Remove redundant dev_name() print in spmi_device_add() spmi: Fix potential use-after-free by grabbing of_node reference spmi: mtk-pmif: Add workaround for FSM lockup/error in read operation MAINTAINERS: Add Qualcomm SPMI controller entry spmi: pmic-arb: return 0 in spmi_pmic_arb_register_buses() on success
13 daysiio: adc: qcom-spmi-iadc: Remove regmap R/W wrapper functionsAngeloGioacchino Del Regno1-56/+33
This driver doesn't need to add any register base address to any regmap call anymore since it was migrated to register as a SPMI subdevice with its own regmap reg_base, which makes the regmap API to automatically add such base address internally. Since the iadc_{read,write,read_result}() functions now only do call regmap_{read,write,bulk_read}() and nothing else, simplify the driver by removing them and by calling regmap APIs directly. Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
13 daysiio: adc: qcom-spmi-iadc: Migrate to devm_spmi_subdevice_alloc_and_add()AngeloGioacchino Del Regno1-10/+23
Some Qualcomm PMICs integrate an Current ADC device, reachable in a specific address range over SPMI. Instead of using the parent SPMI device (the main PMIC) as a kind of syscon in this driver, register a new SPMI sub-device and initialize its own regmap with this sub-device's specific base address, retrieved from the devicetree. This allows to stop manually adding the register base address to every R/W call in this driver, as this can be, and is now, handled by the regmap API instead. Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2026-10-05Merge 7.3-rc6 into char-misc-nextGreg Kroah-Hartman39-154/+323
This resolves a number of merge conflicts between the branches, and we pick up the fixes in 7.3-rc6 that we need for testing. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-09-30iio: adc: ad_sigma_delta: fix use-after-free on unbindFan Wu1-13/+18
ad_sd_buffer_postenable() allocates sigma_delta->samples_buf with devm_krealloc() at runtime, so its devres entry sits after all probe-time entries of the driver. devm resources are released in reverse allocation order, which means unbind frees samples_buf before iio_device_unregister() disables the buffers and detaches the trigger pollfunc. The data ready IRQ is still enabled at that point, so ad_sd_trigger_handler() can still run and memcpy() incoming samples into the freed samples_buf. Fix this by preallocating the buffer in devm_ad_sd_setup_buffer_and_trigger(), before the triggered buffer and the IRQ are set up, so it is freed only after iio_device_unregister() has drained the trigger handler via free_irq(). Size it for the worst case of all sequencer slots being active; ad_sd_validate_scan_mask() already caps the number of active channels at num_slots. This issue was found by an in-house static analysis tool. Fixes: 8bea9af887de ("iio: adc: ad_sigma_delta: Add sequencer support") Cc: stable@vger.kernel.org Co-developed-by: Song Li <songl@zju.edu.cn> Signed-off-by: Song Li <songl@zju.edu.cn> Signed-off-by: Fan Wu <fanwu01@zju.edu.cn> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-30iio: accel: kxcjk-1013: reject duplicate event disableJiale Yao1-1/+1
The IIO core does not filter duplicate writes to the event enable attribute. kxcjk1013_write_event_config() already ignores repeated enable requests, but a repeated disable request still calls kxcjk1013_set_power_state(data, false), dropping a runtime PM reference that was not acquired for this request. This can underflow the runtime PM usage count and trigger a "Runtime PM usage count underflow" warning. Return early when the requested state already matches ev_enable_state. Fixes: b4b491c0832e ("iio: accel: kxcjk-1013: Support thresholds") Signed-off-by: Jiale Yao <yaojiale02@163.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-30iio: buffer: serialize buffer teardown with mode claimsJinseob Kim1-0/+4
Buffer-mode claims hold mlock to guarantee that the device remains in buffer mode until the claim is released. Normal buffer updates take info_exist_lock followed by mlock in iio_update_buffers(). However, iio_device_unregister() disables and deactivates all buffers without taking mlock. This can invalidate buffer state, including active_scan_mask, while a buffer-mode claim is held. Take mlock in iio_disable_all_buffers() so that unregister honors the mode-claim lifetime guarantee. The info_exist_lock -> mlock ordering matches iio_update_buffers(). Fixes: 0a8565425afd ("iio: core: introduce iio_device_{claim|release}_buffer_mode() APIs") Suggested-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Jinseob Kim <kimjinseob88@gmail.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-30iio: cdc: ad7150: fix OF matching and publish module aliasesPengpeng Hou1-3/+5
The OF match entries use positional initializers, which initialize the name field rather than compatible. Consequently the advertised AD7150, AD7151 and AD7156 compatible strings do not describe OF compatible matches. The table is also not exported for module alias generation. Use designated compatible initializers and publish the OF table. Keep the existing I2C ID table and its device-variant selection unchanged. The issue was found by our static-analysis tool. Fixes: 89f2d5b080bc ("staging:iio:cdc:ad7150: Add of_match_table") Assisted-by: LLM Cc: stable@vger.kernel.org Signed-off-by: Pengpeng Hou <hppiscas@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-30iio: adc: ade9000: fix NULL pointer dereference in clkout registrationLinmao Li1-2/+3
ade9000_setup_clkout() passes NULL as the register address when registering a divider clock. During clock registration, the common clock framework calls clk_divider_recalc_rate(), which dereferences the address through readl(). As a result, probing an ADE9000 configured as a clock provider with an external input clock crashes. CLKOUT passes CLKIN through without changing its rate. Register it as a 1:1 fixed-factor clock, which does not require register access. This change does not affect the configuration using the internal clock, for which the driver does not register a clock provider. Fixes: 81de7b4619fc ("iio: adc: add ade9000 support") Cc: stable@vger.kernel.org Signed-off-by: Linmao Li <lilinmao@kylinos.cn> Reviewed-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-30iio: adc: ad4030: fix invalid oversampling_ratio validationSalah Triki1-2/+9
In ad4030_set_avg_frame_len(), the logarithm is calculated before input validation. Passing zero or negative values leads to an undefined result from ilog2(). Validate that the input is strictly positive prior to computing its logarithm. Fixes: 949abd1ca5a4 ("iio: adc: ad4030: add averaging support") Assisted-by: LLM Signed-off-by: Salah Triki <salah.triki@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-30iio: adc: ad7173: Fix digital filter configurationMarcelo Schmitt1-2/+2
Filter enable and filter type selection masks were swapped on data preparation for filter configuration register write. Use the correct masks to set each property of post filter configuration. Fixes: ff06b39be1a1 ("iio: adc: ad7173: support changing filter type") Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-30iio: adc: stm32-adc: fix possible division by zero in processed channelFabrice Gasnier1-2/+7
In case the conversion has failed or returned zero, processing *val can lead to a division by zero. Need to check for errors, or converted value is zero, before processing the data. In case the converted value is zero, e.g. the Vrefint channel, this should be considered as invalid in all cases. Fixes: 0e346b2cfa85 ("iio: adc: stm32-adc: add vrefint calibration support") Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://lore.kernel.org/all/20260911161555.244F31F000FF@smtp.kernel.org/ Cc: stable@vger.kernel.org Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-30iio: adc: stm32-adc: fix check on internal channel availabilityFabrice Gasnier1-15/+19
If an unsupported internal channel like vddgpu is requested, the driver prints a warning but falls through and assigns it a valid int_ch below. This causes a problem later during setup: stm32_adc_int_ch_enable() { ... case STM32_ADC_INT_CH_VDDGPU: stm32_adc_set_bits(adc, adc->cfg->regs->or_vddgpu.reg, adc->cfg->regs->or_vddgpu.mask); ... } Because the register offset is uninitialized (0), this performs a read-modify-write on offset 0, which corresponds to the ISR register. Fix this by returning before a valid int_ch is assigned. Choice is made to keep current driver behavior to warn about the channel name. Fixes: cf0fb80ae167 ("iio: adc: stm32-adc: add stm32mp13 support") Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://lore.kernel.org/all/20260911162602.D323F1F000FF@smtp.kernel.org/ Cc: stable@vger.kernel.org Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-30iio: proximity: isl29501: Fix return type of isl29501_register_writeSalah Triki1-1/+1
isl29501_register_write() was returning a u32 instead of an int. Since the function returns negative error codes (such as -ERANGE or return values from i2c_smbus_write_byte_data()), returning an unsigned integer type prevents callers from correctly checking for negative error conditions. Fix this by changing the function return type from u32 to int. This was found through manual code review. Fixes: 1c28799257bc ("iio: light: isl29501: Add support for the ISL29501 ToF sensor.") Signed-off-by: Salah Triki <salah.triki@gmail.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-30iio: imu: inv_icm42607: restore runtime PM on system resume errorsLinmao Li1-4/+19
pm_runtime_force_suspend() leaves runtime PM disabled after it succeeds and expects pm_runtime_force_resume() to restore runtime PM management during system resume. The resume callback returns early if enabling the vddio regulator or synchronizing the register cache fails, skipping the matching pm_runtime_force_resume() call. Runtime PM consequently remains disabled after the system has resumed, so runtime autosuspend can no longer turn off sensors enabled afterward. Call pm_runtime_force_resume() on both error paths. Keep the first error as the return value and report a runtime PM restore failure separately. Fixes: 3007c1530f96 ("iio: imu: inv_icm42607: Add PM support for icm42607") Signed-off-by: Linmao Li <lilinmao@kylinos.cn> Tested-by: Kanak Shilledar <kanak.shilledar@axis.com> Tested-by: Chris Morgan <macromorgan@hotmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-30iio: imu: inv_icm42607: propagate runtime suspend errorsLinmao Li1-5/+10
The runtime suspend callback returns success when updating PWR_MGMT0 fails. The PM core then marks the device suspended even though the shutdown outcome is unknown. If the write did not reach the sensor, the sensors remain running and draw power while the device is idle. The condition need not persist. If the bus error clears, a later sensor access either reads the current PWR_MGMT0 value from hardware or retries programming the requested enabled mode, allowing normal operation to resume. Return the underlying errno to the PM core. -EAGAIN and -EBUSY retain their transient-error semantics; other errors put runtime PM into an error state and cause later PM acquires to fail until the status is explicitly reset. In the normal idle case, a successful system suspend can perform that reset. This leaves the transient-versus-fatal classification to the PM core and matches the sibling ICM-42600 driver. Keep a void wrapper for the managed teardown action, where errors can only be logged. Fixes: 3007c1530f96 ("iio: imu: inv_icm42607: Add PM support for icm42607") Signed-off-by: Linmao Li <lilinmao@kylinos.cn> Tested-by: Kanak Shilledar <kanak.shilledar@axis.com> Tested-by: Chris Morgan <macromorgan@hotmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: dac: ad5758: Fix the offset calculationArka Mondal1-1/+2
The offset is a count of DAC codes, so the microamp or microvolt units of min and max cancel out and the final division by 1000 is wrong. For the +-20 mA range the driver reports -32 instead of -32768. For the +-5 V and +-10 V ranges min * (1 << 16) also overflows int, and the reported offset is 0. Drop the division and do the multiplication in 64 bits. Fixes: 28d1a7ac2a0d ("iio: dac: Add AD5758 support") Signed-off-by: Arka Mondal <arka@arkamondal.net> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: dac: ad5758: Reject out-of-range raw valuesArka Mondal1-0/+3
ad5758_write_raw() passes the value from userspace straight to ad5758_spi_reg_write(), which keeps only the low 16 bits. Writing -1 to the raw attribute gives full-scale output, and 65536 gives code 0. Return -EINVAL for values outside 0 to U16_MAX, as ad5755 does. Fixes: 28d1a7ac2a0d ("iio: dac: Add AD5758 support") Signed-off-by: Arka Mondal <arka@arkamondal.net> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: dac: ad5758: Fix alignment for DMA safetyArka Mondal1-1/+1
ad5758_spi_reg_read() reads into st->d32[2] with spi_sync_transfer(), but d32 is not marked __aligned(IIO_DMA_MINALIGN), so it can share a cacheline with the fields before it. When DMA is not cache coherent, the cache invalidation after the read can discard CPU writes to those fields. Mark d32 __aligned(IIO_DMA_MINALIGN). It is the last member of the struct, so nothing comes after it. Fixes: 28d1a7ac2a0d ("iio: dac: Add AD5758 support") Signed-off-by: Arka Mondal <arka@arkamondal.net> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: pressure: dps310: check the lock markings with context analysisRupesh Majhi1-0/+2
__must_hold() markings added earlier in this series are only documentation unless the file opts in, so switch the analysis on for dps310.o. Clean with clang 23.1.0 and CONFIG_WARN_CONTEXT_ANALYSIS=y. It does run: dropping the lock around dps310_fifo_drain() warns rather than going quietly. Assisted-by: LLM Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: pressure: dps310: add triggered buffer supportRupesh Majhi2-5/+149
Add a triggered buffer to capture continuously on both channels instead of one sysfs read at a time. Raw register value is not useful on its own, pressure has to go through the compensation polynomial and needs a temperature reading. Report raw in Pa with 1/1000 scale to keep full resolution in the buffer without changing what the existing processed attribute reports. Raw and processed reads return -EBUSY while buffer is on, so does any reconfiguration. Assisted-by: LLM Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: pressure: dps310: take the lock once per raw readRupesh Majhi1-66/+77
A processed pressure read takes the lock twice: once in the raw read, then again when dps310_calculate_pressure() trylocks to refresh the temperature. The refresh is skipped whenever the lock is busy. Split the raw reads into variants that expect the lock held and give each channel a helper that takes it once for the whole sequence, so the temperature refresh is unconditional. Buffered capture later in this series needs the same shape. Mark the functions that need the lock with __must_hold() rather than a comment, and include cleanup.h, which ACQUIRE() needs and was coming in transitively. Assisted-by: LLM Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: pressure: dps310: use get_unaligned_be24() for the 24-bit resultsRupesh Majhi1-6/+3
Pressure and temperature results are big-endian 24-bit values. Build them with get_unaligned_be24() instead of open-coded shifts. The coefficients are packed into the bytes rather than byte-aligned, so they stay as they are. Assisted-by: LLM Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: pressure: dps310: use a local device pointer in probeRupesh Majhi1-3/+4
probe() spells out &client->dev for every devm call. Take it into a local instead. Keeps lines short as more calls are added later in this series. No functional change. Assisted-by: LLM Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: pressure: dps310: fix CFG_REG bit definitionsRupesh Majhi1-3/+3
Driver defines them as BIT(4), BIT(5) and BIT(6). Per datasheet P_SHIFT is bit 2, FIFO_EN is bit 1 and SPI_MODE is bit 0. Only P_SHIFT has a user. dps310_set_pres_precision() sets it at oversampling 16 or above, so with wrong bit the result register is never shifted and stops matching the scale factor compensation divides by. in_pressure_input returns -ERANGE at oversampling 16, 32 and 64. FIFO_EN needed by FIFO support later in this series. Fixes: ba6ec48e76bc ("iio: Add driver for Infineon DPS310") Fixes: d711a3c7dc82 ("iio: dps310: Add pressure sensing capability") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: stm32: fix minimum sampling time valuesCheick Traore1-2/+2
- On stm32mp15: vddcpu and vddq_ddr are not connected to internal channel, so their sampling time shouldn't be set. - On stm32mp13: vddcpu and vddq_ddr are connected to internal channels and the value for vddcore was not correct. Values from the datasheet are 1us (e.g. 1000ns) for ts_vddcore, ts_vddcpu and ts_vddq_ddr. Fixes: 7cb2303dd024 ("iio: adc: stm32: manage min sampling time on all internal channels") Cc: stable@vger.kernel.org Signed-off-by: Cheick Traore <cheick.traore-ext@st.com> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: light: veml6031x00: Enable internal calibrationJavier Carrasco1-0/+6
Enable the device's factory internal calibration before entering normal operation to improve ambient light measurements. Set ALS_CAL during hardware initialization. Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: dac: add support for Microchip MCP48FEB02Ariana Lazar4-1/+170
This is the IIO driver for Microchip MCP48FxBy1/2/4/8 series of buffered voltage output Digital-to-Analog Converters with nonvolatile or volatile memory and an SPI Interface. The families support up to 8 output channels. The devices can be 8-bit, 10-bit and 12-bit. Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: dac: mcp47feb02: refactor MCP47FEB02 I2C driver into two modulesAriana Lazar5-303/+215
Prepare the driver for the bus-specific code by refactoring into separate files. The renamed file will contain the common DAC functionality shared by the MCP47FxBy1/2/4/8 I2C and MCP48FxBy1/2/4/8 SPI drivers. The MCP47FEB02 driver was refactored into two modules: mcp47feb02-core.c and mcp47feb02-i2c.c in order to prepare the support for SPI MCP48FxBy1/2/4/8 DAC family on top of the current implementation. Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: dac: mcp47feb02: protect EEPROM store sequence with mutexAriana Lazar1-2/+2
Move the mutex lock into store_eeprom_store() to prevent race conditions when reading volatile registers and writing them to the EEPROM. Fixes: bf394cc80369 ("iio: dac: adding support for Microchip MCP47FEB02") Closes: https://lore.kernel.org/all/20260819125128.970911F000E9@smtp.kernel.org/ Reported-by: Sashiko <sashiko-bot@kernel.org> Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: dac: mcp47feb02: Avoid unjustified probe error on missing labelAriana Lazar1-5/+9
Fix unjustified probe error on missing optional 'label' property by replacing dev_err_probe() with dev_warn_probe(). Correct %pfw usage by passing the child fwnode handle directly in the error message. Besides the probe warning a read error is returned at the attempt of reading a null label. Fixes: bf394cc80369 ("iio: dac: adding support for Microchip MCP47FEB02") Reported-by: sashiko-bot@kernel.org Closes: https://lore.kernel.org/all/20260804134616.1D8A21F00A3E@smtp.kernel.org/ Cc: stable@vger.kernel.org Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSUBiju Das1-0/+9
Add renesas,r9a08g046-adc1 compatible string and its hardware parameters for the ADC1 IP on RZ/G3L, which is dedicated to the on-chip TSU (thermal sensor unit). Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: rzg2l_adc: Rename num_channels to max_channelsBiju Das1-10/+10
Rename the num_channels member of struct rzg2l_adc_hw_params to max_channels, as it represents the maximum number of channels supported by the ADC hardware rather than a count of channels currently in use. No functional change intended. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: accel: sca3000: reject devices without match dataJiale Yao1-0/+2
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. sca3000_probe() immediately dereferences the returned chip information to set the IIO device name and channel layout, causing a NULL pointer dereference. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data before using the chip information. Fixes: d6ae9f202f61 ("iio: sca3000: simplify with spi_get_device_match_data()") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: accel: adxl380: reject devices without match dataJiale Yao1-0/+2
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. adxl380_spi_probe() passes the result to adxl380_probe(), which dereferences chip_info to set the IIO device name and operations, causing a NULL pointer dereference. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data in the SPI frontend. Fixes: df36de13677a ("iio: accel: add ADXL380 driver") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: accel: adxl372: reject devices without match dataJiale Yao1-0/+2
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. adxl372_spi_probe() passes the result to adxl372_probe(), which dereferences chip_info to set the IIO device name and capabilities, causing a NULL pointer dereference. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data in the SPI frontend. Fixes: 23d742859a2d ("iio: accel: adxl372: introduce chip_info structure") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: accel: adxl313: reject devices without match dataJiale Yao1-0/+2
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. adxl313_spi_probe() dereferences chip_data to select the regmap configuration, causing a NULL pointer dereference. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data before selecting the configuration. Fixes: d6e3ee74d16f ("iio: accel: adxl313: simplify with spi_get_device_match_data()") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: ti-ads7950: validate SPI match dataJiale Yao1-1/+3
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. ti_ads7950_probe() also obtains the IIO device name by dereferencing the result of spi_get_device_id(), which is NULL on the same override path. The probe can therefore crash before dereferencing the chip information. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data and use the always available SPI modalias for the IIO device name. Fixes: ff0843ceb1fb ("iio: adc: ti-ads7950: remove chip_info[]") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: ti-ads131m02: reject devices without match dataJiale Yao1-0/+2
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. ads131m_probe() immediately dereferences the returned configuration to initialize the IIO device, causing a NULL pointer dereference. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data before using the configuration. Fixes: 4aa91223fd6c ("iio: adc: Add TI ADS131M0x ADC driver") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: ti-ads1018: reject devices without match dataJiale Yao1-1/+5
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. ads1018_spi_probe() immediately dereferences the returned chip information to initialize the IIO device, causing a NULL pointer dereference. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data before allocating the IIO device. Fixes: bf0bba486b5b ("iio: adc: Add ti-ads1018 driver") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Reviewed-by: Kurt Borja <kuurtb@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: ti-adc128s052: validate SPI match dataJiale Yao1-3/+5
SPI driver_override allows a device to bind to this driver without matching either the firmware tables or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. adc128_probe() also obtains the IIO device name by dereferencing the result of spi_get_device_id(), which is NULL on the same override path. The probe can therefore crash before it reaches the match data access. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data and use the always available SPI modalias for the IIO device name. Fixes: d5f0da0c6972 ("iio: adc: ti-adc128s052: Switch to use spi_get_device_match_data()") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: mcp3911: reject devices without match dataJiale Yao1-0/+2
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. mcp3911_probe() stores the result and later calls through chip->config and accesses other chip-specific fields, causing a NULL pointer dereference. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data before continuing the probe. Fixes: 732ad34260d3 ("iio: adc: mcp3911: add support for the whole MCP39xx family") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: max11205: reject devices without match dataJiale Yao1-0/+2
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. max11205_probe() immediately dereferences the returned chip information to set the IIO device name, causing a NULL pointer dereference. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data before using the chip information. Fixes: bf3c855be801 ("iio: adc: max11205: simplify with spi_get_device_match_data()") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: ad7768-1: reject devices without match dataJiale Yao1-0/+3
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. ad7768_probe() later dereferences the returned chip information to initialize the IIO channels and device name, causing a NULL pointer dereference. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data before continuing the probe. Fixes: fa087f5babbc ("iio: adc: ad7768-1: introduce chip info for future multidevice support") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: ad7606: reject devices without match dataJiale Yao1-1/+5
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. ad7606_spi_probe() dereferences the returned bus information to pass the chip information and bus operations to the core, causing a NULL pointer dereference. Commit 572a00852635 ("iio: dac: ad5686: missing NULL check on match data") fixed the same driver_override issue in another SPI driver. Reject devices without match data before entering the core. Fixes: bc69e9fffde4 ("iio: adc: ad7606: Add compatibility to fw_nodes") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-09-28iio: adc: ad7192: reject devices without match dataJiale Yao1-0/+3
SPI driver_override allows a device to bind to this driver without matching either the OF or SPI device ID table. In that case, spi_get_device_match_data() returns NULL. ad7192_probe() immediately dereferences the returned chip information to initialize the IIO device, causing a NULL pointer dereference. Commit 572a00852635 ("iio: dac: ad5686: missing