Re: [PATCH v3 1/2] iio: adc: ti-ads112c14: add support for I2C CRC8

Andy Shevchenko <[email protected]>
Newsgroups org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.