Re: [PATCH v3] iio: adc: spear_adc: mask SPEAR_ADC_STATUS channel and avg sample before setting register

From: Rodrigo Gobbi
Date: Sun Jul 27 2025 - 20:45:45 EST


On 7/19/25 09:10, Jonathan Cameron wrote:
> On Thu, 17 Jul 2025 19:13:49 -0300
> Rodrigo Gobbi <rodrigo.gobbi.7@xxxxxxxxx> wrote:
>
>> avg sample info is a bit field coded inside the following
>> bits: 5,6,7 and 8 of a device status register.
>>
>> channel num info the same, but over bits: 1, 2 and 3.
>>
>> mask both values in order to avoid touching other register bits,
>> since the first info (avg sample), came from dt.
>>
> I read this as meaning this is a hardening change against bad DT rather
> than a bug fix?
>
> As such applied for next cycle to the testing branch of iio.git.
>
> Thanks,
>
> Jonathan

Sorry for the late response, yes, that’s correct — this is a hardening change.

On 7/24/25 09:47, Jonathan Cameron wrote:
> On Wed, 23 Jul 2025 16:49:24 +0300
> Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
>
>> On Thu, Jul 17, 2025 at 07:13:49PM -0300, Rodrigo Gobbi wrote:
>> > avg sample info is a bit field coded inside the following
>> > bits: 5,6,7 and 8 of a device status register.
>> >
>> > channel num info the same, but over bits: 1, 2 and 3.
>> >
>> > mask both values in order to avoid touching other register bits,
>> > since the first info (avg sample), came from dt.
>>
>> Is there any issue with a Shift key?
> Sprinkled some capitals.
>>

I'll make sure to pay more attention to that in future patches.
Tks for adjusting it, @Jonathan.
Best regards to all!