Re: [PATCH v2 2/2] iio: adc: Add support for TI ADS1120

From: Ajith Anandhan

Date: Mon Dec 15 2025 - 12:39:06 EST


On 12/15/25 10:30 PM, Andy Shevchenko wrote:
Thanks for the pointer.

I did look at reg_shift, but it doesn’t fit this device. With .reg_shift
= 2, regmap would send only (reg << 2) (e.g. 0x0c for reg 3).

The ADS1120 requires the command byte to be CMD | (reg << 2) (e.g. 0x20
| 0x0c = 0x2c for an RREG of reg 3).

Similarly,

.read_flag_mask would produce reg | mask (e.g. 0x03 | 0x20 = 0x23),
which is also not the required format.

Unless I’m missing a regmap configuration that can generate (reg << 2) |
CMD as a single byte,

a custom regmap bus seems necessary here. Please let me know if there is
a way to express this with standard regmap-spi.
So, and if you define both?

Hi Andy,

You're right! Using both reg_shift and the flag masks produces the correct format
Thank you for catching this! I will drop the custom regmap wrapper.

BR,

Ajith.