Re: [PATCH v3 1/2] iio: adc: ti-ads112c14: add support for I2C CRC8
From: Andy Shevchenko
Date: Thu Aug 06 2026 - 21:10:33 EST
On Mon, Jul 27, 2026 at 09:09:50AM -0500, David Lechner (TI) wrote:
> Add support for I2C CRC8 to the TI ADS112C14 ADC driver. This verifies
> data integrity of all I2C transactions with the device.
>
> For now, it is always enabled, but it could be made optional in the
> future if needed (e.g. for higher-speed data acquisition).
...
> +static int ads112c14_i2c_add_driver(struct i2c_driver *driver)
> +{
> + crc8_populate_msb(ads112c14_crc8_table, ADS112C14_I2C_CRC8_POLYNOMIAL);
> +
> + return i2c_add_driver(driver);
> +}
> +
> static struct i2c_driver ads112c14_driver = {
> .driver = {
> .name = "ads112c14",
> @@ -1217,7 +1347,7 @@ static struct i2c_driver ads112c14_driver = {
> .probe = ads112c14_probe,
> .id_table = ads112c14_id,
> };
> -module_i2c_driver(ads112c14_driver);
> +module_driver(ads112c14_driver, ads112c14_i2c_add_driver, i2c_del_driver);
This is not needed if you call crc8_populate_msb() from the probe using
DO_ONCE_SLEEPABLE().
--
With Best Regards,
Andy Shevchenko