Re: [PATCH v3 9/9] iio: adc: ti-ads1262: support common mode supplies

From: Kurt Borja

Date: Sun Aug 09 2026 - 04:29:41 EST


On Sat Aug 8, 2026 at 1:40 PM -05, David Lechner wrote:
> On 8/7/26 10:58 PM, Kurt Borja wrote:
>> Enable common mode regulators. The usual configuration is to have our
>> own 'vbias' regulator connected internally as common mode voltage on the
>> AINCOM pin.
>>
>> Signed-off-by: Kurt Borja <kuurtb@xxxxxxxxx>
>> ---
>> drivers/iio/adc/ti-ads1262.c | 25 +++++++++++++++++++++++++
>> 1 file changed, 25 insertions(+)
>>
>> diff --git a/drivers/iio/adc/ti-ads1262.c b/drivers/iio/adc/ti-ads1262.c
>> index 533574169b04..238d803abc50 100644
>> --- a/drivers/iio/adc/ti-ads1262.c
>> +++ b/drivers/iio/adc/ti-ads1262.c
>> @@ -962,6 +962,27 @@ static irqreturn_t ads1262_irq_handler(int irq, void *dev_id)
>> return IRQ_HANDLED;
>> }
>>
>> +static int ads1262_common_mode_setup(struct ads1262 *st)
>> +{
>> + struct device *dev = &st->spi->dev;
>> + char name[sizeof("aincom")];
>> + int ret;
>> +
>> + for (unsigned int i = 0; i <= ADS1262_INPMUX_AINCOM; i++) {
>> + if (i < ADS1262_INPMUX_AINCOM)
>> + scnprintf(name, sizeof(name), "ain%u", i);
>> + else
>> + scnprintf(name, sizeof(name), "aincom");
>> +
>> + ret = devm_regulator_get_enable_optional(dev, name);
>
> We need to get the voltage which is then used to provide an offset
> (IIO_CHAN_INFO_OFFSET) for the channel.

Sure! I didn't think it was necessary but I can definitely add it.

--
Thanks,
~ Kurt