Re: [PATCH 4/4] bd79703: Support ROHM BD7971x DACs
From: Andy Shevchenko
Date: Thu Dec 03 2026 - 12:09:51 EST
On Wed, Dec 02, 2026 at 03:39:21PM +0200, Matti Vaittinen wrote:
> The BD7971x are logically similar to BD7970x. Main difference is the
> amount of bits in DAC-word. The BD7970x had 8-bit DAC whereas the
> BD7971x use 10-bit DAC word.
>
> The SPI data format differs. The BD7971x requires two least significant
> bits to be zeroes, and carries the DAC word in following 10 bits. The
> channel number is in highest 4 bits.
>
> Add support for the BD7971x family of DACs.
Subject went wrong (w/o required prefix).
...
> +/* The BD7971X uses 16-bit data transfers. Four high bits define the channel
> + * and following 10 bits define the DAC word. Two last bits must be zero.
> + *
> + * Let's try having the 4 channel-bits as an address and following bits as data
> + */
/*
* The multi-line comment style should follow this
* example. It's even inconsistent to the one used
* in the driver.
*/
...
> struct bd79703_data *data = iio_priv(idev);
> + unsigned int tmp = val;
This signed->unsigned trick begs for a comment. It's quite easy to miss and
someone might introduce some issues due to that.
--
With Best Regards,
Andy Shevchenko