Re: [PATCH v4 2/2] iio: magnetometer: si7210: add driver for Si7210

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 16, 2025 at 09:05:58PM +0100, Antoni Pokusinski wrote:
> On Thu, Jan 16, 2025 at 10:26:55AM +0200, Andy Shevchenko wrote:
> > On Wed, Jan 15, 2025 at 09:16:22PM +0100, Antoni Pokusinski wrote:

...

> > > +	/* Write the registers 0xCE - 0xD0 */
> > > +	ret = regmap_bulk_write(data->regmap, SI7210_REG_A3, &a_otp_values[3], 3);
> > > +	if (ret)
> > > +		return ret;
> > 
> > Just to be sure I understand the above. There are two of 24-bit values or there are
> > two sets of 3 byte arrays? How does datasheet refers to them? What does common sense
> > tell us here?
> 
> It's the second option: we have 2 arrays of 3 elements each (a0, a1, a2
> and a3, a4, a5). In the datasheet the names of the values correspond
> to the names I used in the driver, that is there are 6 values a0, ..., a5.
> 
> The point is that the their registers are separated by the 0xCD register.
> Therefore I had to call `regmap_bulk_write()` twice in order to
> write values a0 - a2 to the registers 0xCA - 0xCC and similarly the
> values a3 - a5 to the regs 0xCE - 0xD0.

Thanks for the explanation! Looks reasonable to me.

...

> > Overall LGTM, there is no need for resend as I believe the three things above
> > may be tweaked by Jonathan. The last one can go even if there are 2 24-bit
> > values, but ideally in that case we should use those as a such and apply
> > put_unaligned_be24/le24() whichever suits better.

FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux