From: Kurt Borja <kuurtb@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Tobias Sperling <tobias.sperling@softing.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
"Kurt Borja" <kuurtb@gmail.com>
Subject: [PATCH v3 0/2] iio: Add support for TI ADS1X18 ADCs
Date: Fri, 28 Nov 2025 22:47:11 -0500 [thread overview]
Message-ID: <20251128-ads1x18-v3-0-a6ebab815b2d@gmail.com> (raw)
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@gmail.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
---
v3:
- [Patch 1]:
- Use unevaluatedProperties: false
- Drop #address-cells and #size-cells
- [Patch 2:]
- Add kernel-doc to internal API
- Drop bits.h and bitops.h includes
- Add types.h include
- Use unsigned type for data_rate_mode_to_hz
- Rename __ads1018_read_raw() -> ads1018_read_raw_unlocked()
- Rename __ads1018_write_raw() -> ads1018_write_raw_unlocked()
- Rename ads1018_read_locked -> ads1018_read_unlocked() for
consistency
- Let ads1018_read_unlocked() take NULL cnv pointers
- Add ads1018_set_trigger_{enable,disable}()
- Refactor ads1018_write_raw_unlocked() loop matching
- Invert ads1018_trigger_handler() logic to follow traditional error
handling pattern
- Refactor ads1018_trigger_setup() cleaner
- Make ADS1018_FSR_TO_SCALE() calculation be 32-bit compatible
- Some additionall minor cleanups
- Link to v2: https://lore.kernel.org/r/20251127-ads1x18-v2-0-2ebfd780b633@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 | 82 +++
MAINTAINERS | 7 +
drivers/iio/adc/Kconfig | 12 +
drivers/iio/adc/Makefile | 1 +
drivers/iio/adc/ti-ads1018.c | 811 +++++++++++++++++++++
5 files changed, 913 insertions(+)
---
base-commit: f9e05791642810a0cf6237d39fafd6fec5e0b4bb
change-id: 20251012-ads1x18-0d0779d06690
--
~ Kurt
next reply other threads:[~2025-11-29 3:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-29 3:47 Kurt Borja [this message]
2025-11-29 3:47 ` [PATCH v3 1/2] dt-bindings: iio: adc: Add TI ADS1018/ADS1118 Kurt Borja
2025-11-29 9:25 ` Krzysztof Kozlowski
2025-11-30 3:32 ` Kurt Borja
2025-11-29 3:47 ` [PATCH v3 2/2] iio: adc: Add ti-ads1018 driver Kurt Borja
2025-11-29 14:21 ` Andy Shevchenko
2025-11-29 14:23 ` Andy Shevchenko
2025-11-30 3:31 ` Kurt Borja
2025-11-30 16:45 ` Andy Shevchenko
2025-12-01 16:07 ` David Lechner
2025-12-01 19:47 ` Kurt Borja
2025-12-01 21:53 ` David Lechner
2025-12-02 14:46 ` Kurt Borja
2025-12-06 19:27 ` Jonathan Cameron
2025-12-07 16:01 ` Kurt Borja
2025-11-29 17:08 ` kernel test robot
2025-12-01 23:09 ` David Lechner
2025-12-02 14:39 ` Kurt Borja
2025-12-02 14:59 ` Andy Shevchenko
2025-12-02 17:49 ` Kurt Borja
2025-12-02 18:04 ` Andy Shevchenko
2025-12-02 16:52 ` Kurt Borja
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251128-ads1x18-v3-0-a6ebab815b2d@gmail.com \
--to=kuurtb@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
--cc=tobias.sperling@softing.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).