Re: [PATCH v2 2/2] iio: adc: Add TI ADS131M0x ADC driver

From: Oleksij Rempel

Date: Thu Nov 13 2025 - 09:12:30 EST


Hi Andy,

On Mon, Nov 10, 2025 at 10:46:02PM +0200, Andy Shevchenko wrote:

> > - Handles both input and output CRC; uses a non-reflected CCITT (0x1021)
> > implementation because the generic crc_ccitt helper is incompatible.

For the crc_ccitt() related part I wrote this comment ^^^ :) in the
commit message.

Anyways, after some more research, looks like crc_itu_t() should be used. It
seems to work.

> > +/* 24-bit resolution */
> > +#define ADS131M_RESOLUTION_BITS 24
> > +/* Divisor is 2^(Res - 1) for signed 2's complement */
> > +#define ADS131M_SCALE_DIVISOR (1UL << (ADS131M_RESOLUTION_BITS - 1))
>
> Why not BIT() here?

It's meant to signal an arithmetic calculation, BIT() is typically used
for a hardware bitmask or a flag. Should i still use BIT() here or there
is other way to describe it?

Best Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |