Re: [PATCH v3 6/6] iio: adc: ad4851: add ad485x driver
From: David Lechner
Date: Mon Oct 14 2024 - 18:08:58 EST
On 10/14/24 8:14 AM, Andy Shevchenko wrote:
> On Mon, Oct 14, 2024 at 12:40:40PM +0300, 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.
>
...
>> + return regmap_update_bits(st->regmap, AD4851_REG_PACKET,
>> + AD4851_PACKET_FORMAT_MASK, (osr == 1) ? 0 : 1);
>
> I would do it with a conditional
>
> if (osr ...)
> return regmap_update_bits(st->regmap, AD4851_REG_PACKET,
> AD4851_PACKET_FORMAT_MASK, 0);
>
> return regmap_update_bits(st->regmap, AD4851_REG_PACKET,
> AD4851_PACKET_FORMAT_MASK, 1);
>
If we do this, regmap_set_bits() and regmap_clear_bits() would
be even better.