[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251127-ads1x18-v2-0-2ebfd780b633@gmail.com>
Date: Thu, 27 Nov 2025 22:37:09 -0500
From: Kurt Borja <kuurtb@...il.com>
To: Jonathan Cameron <jic23@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Tobias Sperling <tobias.sperling@...ting.com>
Cc: David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Kurt Borja <kuurtb@...il.com>
Subject: [PATCH v2 0/2] iio: Add support for TI ADS1X18 ADCs
Hi,
This series adds a new driver for TI ADS1X18 SPI devices.
This is my first time contributing to the IIO subsystem and making
dt-bindings documentation, so (don't) go easy on me :p.
As explained in Patch 2 changelog, the DRDY interrupt line is shared
with the MOSI pin. This awkward quirk is also found on some Analog
Devices sigma-delta SPI ADCs, so the interrupt and trigger design is
inspired by those.
@ David:
I didn't move enable_irq() and spi_bus_lock() out of .set_trigger_state.
I explained some of my reasoning in v1 and I expanded patch 2 changelog
on that. If you disagree with this, let me know!
Thank you in advance for your reviews.
Signed-off-by: Kurt Borja <kuurtb@...il.com>
---
v2:
- [Patch 1]:
- Move MAINTAINERS change here
- Use generic node names: ads1118@0 -> adc@0
- Rename file to ti,ads1118.yaml -> ti,ads1018.yaml
- Drop ti,gain and ti,datarate
- Add spi-cpha and spi-max-frecuency properties as they are fixed in
all models
- Add vdd-supply
- Make interrupts and drdy-gpios optional properties
- [Patch 2]:
- Update probe based on dt-bindings changes
- Rename file to ti-ads1x18.c -> ti-ads1018.c
- Rework ads1018_oneshot(), instead of waiting for IRQ wait an
appropriate delay before reading again
- Only alloc and register a trigger if we have an IRQ line
- Drop ads1x18->msg_lock in favor of IIO API locks
- Read conver before enabling and after disabling IRQ to ensure CS
state is correct
- Add ads1018_read_locked() which takes an additional argument
`hold_cs` to explicitly control CS state in trigger and buffer
- Fix ADS1X18_CHANNELS_MAX limit 9 -> 10
- Call iio_trigger_notify_done() in all IRQ handler paths
- Drop unused includes
- Drop BIT_U16 and GENMASK_U16 macros
- Drop unnecessary named defines
- Use u8 types in ads1018_chan_data
- Rename some struct members for clarity
- Move tx_buf and rx_buf to the end of struct ads1018
- Rework channel handling to just make everything visible and add
ADS1018_VOLT_DIFF_CHAN
- Use .scan_index instead of .address in IIO channels
- v1: https://lore.kernel.org/r/20251121-ads1x18-v1-0-86db080fc9a4@gmail.com
---
Kurt Borja (2):
dt-bindings: iio: adc: Add TI ADS1018/ADS1118
iio: adc: Add ti-ads1018 driver
.../devicetree/bindings/iio/adc/ti,ads1018.yaml | 93 +++
MAINTAINERS | 7 +
drivers/iio/adc/Kconfig | 12 +
drivers/iio/adc/Makefile | 1 +
drivers/iio/adc/ti-ads1018.c | 716 +++++++++++++++++++++
5 files changed, 829 insertions(+)
---
base-commit: f9e05791642810a0cf6237d39fafd6fec5e0b4bb
change-id: 20251012-ads1x18-0d0779d06690
--
~ Kurt
Powered by blists - more mailing lists