Re: [PATCH v3] staging: iio: addac: adt7316: document SPI interface switching sequence

From: Jonathan Cameron

Date: Mon May 11 2026 - 09:54:34 EST


On Mon, 11 May 2026 13:19:21 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:

> On Mon, May 11, 2026 at 02:31:27AM +0000, Hungyu Lin wrote:
> > The device powers up in I2C mode. Switching to SPI mode
> > requires sending a sequence of SPI writes as described in
> > the datasheet.
> >
> > During this sequence, the device may still be in I2C mode,
> > so SPI transactions may not be recognized and can fail.
> > Such errors are expected and are ignored.
> >
> > Add a comment to clarify this behavior.
> >
> > Datasheet: https://www.analog.com/en/products/adt7316.html
> > Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
>
> Thanks, almost there!
> Please, address the below and feel free to add
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
> to your v4 of this patch.
>
> Also I think we don't need "staging" in the Subject, as we can deduce that,
> in any case it's up to Jonathan (and yes, I see the common use of the pattern
> in the Git history).

I think keeping staging is appropriate for a couple of reasons.

1) Affects who looks at it.
2) Aligns with the more general pattern for most of staging that goes
directly through Greg rather than via another tree like IIO.

>
> ...
>
> > Changes in v3:
> > - Add Datasheet tag
> > - Use datasheet name in code comment
>
> ...
>
> > + /*
> > + * The device powers up in I2C mode. Switching to SPI mode
> > + * requires sending a sequence of SPI writes as described in
> > + * the datasheet "ADT7316/ADT7317/ADT7318", Rev. B.
>
> Yeah, but you dropped the section title...
>
> * the datasheet "ADT7316/ADT7317/ADT7318", Rev. B in
> * the section "...".

Absolutely agree on this! Can be hard to find this stuff in the bigger
datasheets :(
>
> > + * During this sequence, the device may still be in I2C mode,
> > + * so SPI transactions may not be recognized and can fail.
> > + * Such errors are expected and are ignored.
> > + *
> > + * TL;DR: Do not change this!
> > + */
>