Re: [PATCH 2/2] iio: adc: ti-ads1298: add ADS1299 EEG ADC family support
From: Andy Shevchenko
Date: Wed Jul 01 2026 - 04:58:15 EST
On Tue, Jun 30, 2026 at 05:03:11PM +0300, Md Shofiqul Islam wrote:
> The ADS1299, ADS1299-4 and ADS1299-6 are 8/4/6-channel, 24-bit
> biopotential (EEG) ADCs from Texas Instruments. They share the same
> SPI interface, command set and register map as the ADS1298 ECG family,
> making it straightforward to support them in this driver.
>
> Key differences from the ADS1298:
> - PGA gain range is 1/2/4/6/8/12/24 (vs 6/1/2/3/4/8/12 for ADS1298)
> - Internal voltage reference is always 2.4V (no 4V option)
> - Channel count is encoded differently in the ID register: bits [4:3]
> identify the ADS1299 family (both bits set), bits [1:0] encode the
> channel count as (bits + 2) * 2
>
> Detect the chip family in ads1298_init() by checking bits [4:3] of
> the ID register. Store the result in the is_ads1299 flag and use it
> to select the correct PGA table in ads1298_get_scale() and to skip
> the 4V reference option in the CONFIG3 initialisation.
...
> -/* TI ADS1298 chip family driver
> +/* TI ADS1298/ADS1299 biopotential ADC driver
Consider updating Kconfig help text as well.
...
> struct ads1298_private {
> const struct ads1298_chip_info *chip_info;
> struct spi_device *spi;
> + bool is_ads1299;
> struct regulator *reg_avdd;
> struct regulator *reg_vref;
> struct clk *clk;
When add a new member or create a new data structure always consult with
`pahole` tool on the layout.
> }
...
> -MODULE_DESCRIPTION("TI ADS1298 ADC");
> +MODULE_DESCRIPTION("TI ADS1298/ADS1299 biopotential ADC");
This doesn't scale, rephrase here and in top comment in the file (and probably
in the Kconfig title) to make it stretchy. See the history of the last few
months of IIO subsystem development, you will find examples on how to achieve
that,
--
With Best Regards,
Andy Shevchenko