The I²C retry hack has been there in order to address transient I²C
register write access issues on a few very old sensors and possibly it has
addressed also first I²C access problems (device not responding until a
certain amount of time has passed) but that is now separately handled. The
retry hack has a good potential for introducing hard to debug problems in
updating sensor settings while streaming. Remove it and instead pass those
rare errors to the user space -- which is also what virtually all other
drivers do.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
*/
int ccs_write_addr(struct ccs_sensor *sensor, u32 reg, u32 val)
{
- unsigned int retries = 10;
int rval;
rval = ccs_call_quirk(sensor, reg_access, true, ®, &val);
if (rval < 0)
return rval;
- rval = 0;
- do {
- if (cci_write(sensor->regmap, reg, val, &rval))
- fsleep(1000);
- } while (rval && --retries);
-
- return rval;
+ return cci_write(sensor->regmap, reg, val, NULL);
}
#define MAX_WRITE_LEN 32U