Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hans de Goede and committed by
Hans Verkuil
efff0a80 0677a2d9

+9 -2
+9 -2
drivers/media/i2c/ov2740.c
··· 128 128 }; 129 129 130 130 static const struct ov2740_reg mipi_data_rate_720mbps[] = { 131 - {0x0103, 0x01}, 132 131 {0x0302, 0x4b}, 133 132 {0x030d, 0x4b}, 134 133 {0x030e, 0x02}, ··· 136 137 }; 137 138 138 139 static const struct ov2740_reg mipi_data_rate_360mbps[] = { 139 - {0x0103, 0x01}, 140 140 {0x0302, 0x4b}, 141 141 {0x0303, 0x01}, 142 142 {0x030d, 0x4b}, ··· 932 934 933 935 if (ov2740->nvm) 934 936 ov2740_load_otp_data(ov2740->nvm); 937 + 938 + /* Reset the sensor */ 939 + ret = ov2740_write_reg(ov2740, 0x0103, 1, 0x01); 940 + if (ret) { 941 + dev_err(&client->dev, "failed to reset\n"); 942 + return ret; 943 + } 944 + 945 + usleep_range(10000, 15000); 935 946 936 947 link_freq_index = ov2740->cur_mode->link_freq_index; 937 948 reg_list = &link_freq_configs[link_freq_index].reg_list;