aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakari Ailus2020-11-13 16:07:28 +0100
committerMauro Carvalho Chehab2020-12-03 12:27:31 +0100
commit2dd4b57944cc49b0693e17e6169b6c6ca0166abd (patch)
treea158f99c075a7a7102458b5816cd985718f2b170
parent7389d01cc5d7cac6920f28e04afdf85c287e25a1 (diff)
media: ccs: Allow range in between I²C retries
Make the delay between I²C access retries a range between 1 and 2 ms. Also make the number of retries 10 instead of 5, in order not to reduce the total amount of time. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/media/i2c/ccs/ccs-reg-access.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/i2c/ccs/ccs-reg-access.c b/drivers/media/i2c/ccs/ccs-reg-access.c
index aad2727570ec..79efed5e0dad 100644
--- a/drivers/media/i2c/ccs/ccs-reg-access.c
+++ b/drivers/media/i2c/ccs/ccs-reg-access.c
@@ -256,7 +256,7 @@ int ccs_write_addr_no_quirk(struct ccs_sensor *sensor, u32 reg, u32 val)
put_unaligned_be16(CCS_REG_ADDR(reg), data);
put_unaligned_be32(val << (8 * (sizeof(val) - len)), data + 2);
- for (retries = 0; retries < 5; retries++) {
+ for (retries = 0; retries < 10; retries++) {
/*
* Due to unknown reason sensor stops responding. This
* loop is a temporaty solution until the root cause
@@ -271,7 +271,7 @@ int ccs_write_addr_no_quirk(struct ccs_sensor *sensor, u32 reg, u32 val)
return 0;
}
- usleep_range(2000, 2000);
+ usleep_range(1000, 2000);
}
dev_err(&client->dev,