summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-12-04 13:39:45 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-12-13 13:21:20 +0100
commitefff0a80bc66dcba08e4810fc9eb91c78d5586cf (patch)
tree7c890c49c138b454fae93a9aa0b1af5dada16cb9 /drivers/media/i2c
parent0677a2d9b735c1d57410dd188eb93ce61635987c (diff)
downloadlinux-stable-efff0a80bc66dcba08e4810fc9eb91c78d5586cf.tar.gz
linux-stable-efff0a80bc66dcba08e4810fc9eb91c78d5586cf.tar.bz2
linux-stable-efff0a80bc66dcba08e4810fc9eb91c78d5586cf.zip
media: ov2740: Add a sleep after resetting the sensor
Split the resetting of the sensor out of the link_freq_config reg_list and add a delay after this. This hopefully fixes the stream sometimes not starting, this was taken from the ov2740 sensor driver in the out of tree IPU6 driver: https://github.com/intel/ipu6-drivers/ Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/ov2740.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c
index 3c58a6e0d7a0..552935ccb4a9 100644
--- a/drivers/media/i2c/ov2740.c
+++ b/drivers/media/i2c/ov2740.c
@@ -128,7 +128,6 @@ struct ov2740_mode {
};
static const struct ov2740_reg mipi_data_rate_720mbps[] = {
- {0x0103, 0x01},
{0x0302, 0x4b},
{0x030d, 0x4b},
{0x030e, 0x02},
@@ -137,7 +136,6 @@ static const struct ov2740_reg mipi_data_rate_720mbps[] = {
};
static const struct ov2740_reg mipi_data_rate_360mbps[] = {
- {0x0103, 0x01},
{0x0302, 0x4b},
{0x0303, 0x01},
{0x030d, 0x4b},
@@ -935,6 +933,15 @@ static int ov2740_start_streaming(struct ov2740 *ov2740)
if (ov2740->nvm)
ov2740_load_otp_data(ov2740->nvm);
+ /* Reset the sensor */
+ ret = ov2740_write_reg(ov2740, 0x0103, 1, 0x01);
+ if (ret) {
+ dev_err(&client->dev, "failed to reset\n");
+ return ret;
+ }
+
+ usleep_range(10000, 15000);
+
link_freq_index = ov2740->cur_mode->link_freq_index;
reg_list = &link_freq_configs[link_freq_index].reg_list;
ret = ov2740_write_reg_list(ov2740, reg_list);