Re: [PATCH] staging: iio: addac: adt7316: document SPI interface switching sequence
From: Andy Shevchenko
Date: Sun May 10 2026 - 03:46:02 EST
On Sun, May 10, 2026 at 07:29:18AM +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.
...
> - /* switch from default I2C protocol to SPI protocol */
> + /*
> + * The device powers up in I2C mode. Switching to SPI mode
> + * requires sending a sequence of SPI writes as described in
> + * the datasheet.
Add a reference (Section number and title, and/or table / chart number
and its title).
> + * 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.
> + */
Otherwise it is indeed what we want to be here.
Perhaps also add a line closer to the code (that will be visible in the patch
in case someone ignores to read the comment)
*
* TL;DR: Do not change this!
*/
--
With Best Regards,
Andy Shevchenko