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

"Kurt Borja" <[email protected]>
Newsgroups org.kernel.vger.linux-gpio,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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 <[email protected]>
>> ---
>>  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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.