[PATCH v2 00/11] iio: adc: drop platform data from some ADI ADC drivers

From: Nuno Sá

Date: Wed Dec 02 2026 - 12:06:18 EST


The ad7266, ad7887, ad7791 and ad7793 drivers can still only be
configured through platform data headers, and nothing in tree uses them
anymore. This series removes them.

The ad7266, ad7887 and ad7791 drivers already work without platform
data, so the headers are just dropped and the drivers keep the
configuration they use today when no platform data is given. The
ad7793 driver refuses to probe without platform data, so it gets a
binding and firmware properties instead.

Patch 1 fixes an issue in ad7887 found while looking at the driver: the
on-chip reference gets disabled exactly when the driver relies on it.

For ad7266 and ad7887, the code for the modes that could only be
selected through platform data (address GPIOs, other sample modes and
input range on ad7266, dual channel mode on ad7887) is kept, so that
someone needing it can easily add firmware properties for it. I'm likely
being optimistic and odds are it will be just dead code so I'm glad to
drop all of it if that's the feedback I get.

I also want to keep changes to a minimal to not end up with big
refactors.

This series was also prepared with the help of AI tools.

Changes in v2:
- Patch 1:
- Add Cc: stable tag.
- Patch 2:
- Drop the confusing platform data reference from the comment.
- Patch 3:
- Same comment change as in patch 2.
- Patch 4:
- Reflow the commit message.
- Patch 5:
- Reference bipolar from adc.yaml instead of redefining it.
- Rename adi,buffer-disable to adi,low-source-impedance, so that it
describes the hardware instead of a software action.
- Drop adi,burnout-currents-enable. Burnout currents are meant for
diagnostics, not normal operation.
- Place clocks before interrupts.
- Patches 6-11 (patch 6 in v1):
- Split into smaller patches as suggested by Andy and Jonathan.
- Patch 6 (new): get the chip info with spi_get_device_match_data(),
which does not rely on an SPI device id match and prepares for the
OF match table.
- Patch 7 (new): enable the AVDD and DVDD supplies on its own.
- Patch 10 (new): drop burnout current support. It can be exposed
later (e.g. via debugfs) if there's interest.
- Patch 11: follow the binding changes and allow longer lines where
it helps readability.
- Link to v1: https://patch.msgid.link/20261125-iio-adi-legacy-platdata-v1-0-54e4c8830b57@xxxxxxxxxx

---
Nuno Sá (11):
iio: adc: ad7887: fix on-chip reference enable logic
iio: adc: ad7887: drop platform data support
iio: adc: ad7266: drop platform data support
iio: adc: ad7791: drop platform data support
dt-bindings: iio: adc: add AD7793 and similar ADCs
iio: adc: ad7793: use spi_get_device_match_data()
iio: adc: ad7793: enable the AVDD and DVDD supplies
iio: adc: ad7793: move platform data definitions into the driver
iio: adc: ad7793: rename platform data to config
iio: adc: ad7793: drop burnout current support
iio: adc: ad7793: add firmware support

.../devicetree/bindings/iio/adc/adi,ad7793.yaml | 228 ++++++++++++++
MAINTAINERS | 9 +
drivers/iio/adc/ad7266.c | 57 +++-
drivers/iio/adc/ad7791.c | 26 +-
drivers/iio/adc/ad7793.c | 341 ++++++++++++++++++---
drivers/iio/adc/ad7887.c | 14 +-
include/linux/platform_data/ad7266.h | 50 ---
include/linux/platform_data/ad7791.h | 18 --
include/linux/platform_data/ad7793.h | 111 -------
include/linux/platform_data/ad7887.h | 21 --
10 files changed, 578 insertions(+), 297 deletions(-)
---
base-commit: fba506008a5b548ad2708bc2765a039cb00a47ab
change-id: 20261111-iio-adi-legacy-platdata-63eaa0e33063
--

Thanks!
- Nuno Sá