Re: [PATCH v3 1/2] iio: adc: ti-ads112c14: add support for I2C CRC8
Jonathan Cameron <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <20260815023508.3c8df8d2@jic23-huawei> |
On Fri, 7 Aug 2026 16:18:40 -0500 David Lechner <[email protected]> wrote: > On 8/6/26 8:08 PM, Andy Shevchenko wrote: > > 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(). > > > > Good idea, but this series got picked up already. > Follow up is fine. DO_ONCE_SLEEPABLE() is a new one to me, and indeed looks rather useful for this sort of thing. Jonathan