On Thu, Apr 29, 2021 at 3:28 PM Sean Nyekjaer <sean@xxxxxxxxxx> wrote: > > When flushing the hw fifo there is a bug in the I2C that prevents burst > reads of more than one sample pair. ... > - ret = regmap_raw_read(data->regmap, FXLS8962AF_BUF_X_LSB, buffer, > - total_length); > + if (i2c_verify_client(dev)) { > + /* > + * Due to errata bug: > + * E3: FIFO burst read operation error using I2C interface > + * We have to avoid burst reads on I2C.. > + */ > + for (i = 0; i < samples; i++) { > + ret = regmap_raw_read(data->regmap, FXLS8962AF_BUF_X_LSB, > + &buffer[i], > + sample_length); > + if (ret < 0) > + goto out; > + } Can you rather create a separate function called fxls8962af_i2c_raw_read_errata3() and use it here by simply if (i2c) ret = fxls8962af_i2c_raw_read_errata3(); else ret = regmap_raw_read(); ? > + } else { > + ret = regmap_raw_read(data->regmap, FXLS8962AF_BUF_X_LSB, buffer, > + total_length); > + } -- With Best Regards, Andy Shevchenko