[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d0253e41-3cab-4263-91b2-81682529f9a0@baylibre.com>
Date: Sat, 18 Jan 2025 11:37:16 -0600
From: David Lechner <dlechner@...libre.com>
To: Nuno Sá <noname.nuno@...il.com>,
Antoniu Miclaus <antoniu.miclaus@...log.com>, jic23@...nel.org,
robh@...nel.org, conor+dt@...nel.org, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pwm@...r.kernel.org
Subject: Re: [PATCH v10 8/8] iio: adc: ad4851: add ad485x driver
On 1/18/25 9:10 AM, Nuno Sá wrote:
> On Fri, 2025-01-17 at 15:07 +0200, Antoniu Miclaus wrote:
>> Add support for the AD485X a fully buffered, 8-channel simultaneous
>> sampling, 16/20-bit, 1 MSPS data acquisition system (DAS) with
>> differential, wide common-mode range inputs.
>>
>> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@...log.com>
>> ---
...
> ...
>
>> +static int ad4851_read_raw(struct iio_dev *indio_dev,
>> + const struct iio_chan_spec *chan,
>> + int *val, int *val2, long info)
>> +{
>> + struct ad4851_state *st = iio_priv(indio_dev);
>> +
>> + switch (info) {
>> + case IIO_CHAN_INFO_SAMP_FREQ:
>> + *val = st->cnv_trigger_rate_hz / st->osr;
>> + return IIO_VAL_FRACTIONAL;
>> + case IIO_CHAN_INFO_CALIBSCALE:
>> + return ad4851_get_calibscale(st, chan->channel, val, val2);
>> + case IIO_CHAN_INFO_SCALE:
>> + return ad4851_get_scale(indio_dev, chan, val, val2);
>
> Maybe this was discussed already and I missed it but I'm a bit puzzled. Don't we
> still need OFFSET for differential channels? How do you express negative voltages?
>
> - Nuno Sá
>
>
It was discussed in early revisions of the series. :-)
There was an OFFSET back then, but we removed it because chip uses twos
complement encoding for bipolar single-ended and (bipolar) differential. We
have 's' and 'u' set in the scan_type.sign in those cases. The current
implementation looks correct to me in this regard.
Powered by blists - more mailing lists