summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2024-10-15 10:28:42 +0300
committerHans Verkuil <hverkuil@xs4all.nl>2025-04-25 10:15:33 +0200
commit932518f6f8713d9a23b2ec3e0ebf5ab9e17af728 (patch)
tree60dacaf1cfc098a921c1bda2fa6e14be681c6645
parentbb468fc5a4d902c9202f32ed4ee1f0980c17fe52 (diff)
media: ccs: Remove I²C write retry hack
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>
-rw-r--r--drivers/media/i2c/ccs/ccs-reg-access.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/media/i2c/ccs/ccs-reg-access.c b/drivers/media/i2c/ccs/ccs-reg-access.c
index a696a0ec8ff5c..fd36889ccc1d3 100644
--- a/drivers/media/i2c/ccs/ccs-reg-access.c
+++ b/drivers/media/i2c/ccs/ccs-reg-access.c
@@ -210,7 +210,6 @@ int ccs_read_addr_noconv(struct ccs_sensor *sensor, u32 reg, u32 *val)
*/
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, &reg, &val);
@@ -219,13 +218,7 @@ int ccs_write_addr(struct ccs_sensor *sensor, u32 reg, u32 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