1 From 4207b34a5b5831d5fea177a1a005eec692cc3722 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 31 Mar 2022 17:12:12 +0100
4 Subject: [PATCH] media: i2c: imx258: Issue reset before starting
7 Whilst not documented, register 0x0103 bit 0 is the soft
8 reset for the sensor, so send it before trying to configure
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
13 drivers/media/i2c/imx258.c | 10 ++++++++++
14 1 file changed, 10 insertions(+)
16 --- a/drivers/media/i2c/imx258.c
17 +++ b/drivers/media/i2c/imx258.c
19 #define IMX258_MODE_STANDBY 0x00
20 #define IMX258_MODE_STREAMING 0x01
22 +#define IMX258_REG_RESET 0x0103
25 #define IMX258_REG_CHIP_ID 0x0016
26 #define IMX258_CHIP_ID 0x0258
27 @@ -1319,6 +1321,14 @@ static int imx258_start_streaming(struct
28 const struct imx258_link_freq_config *link_freq_cfg;
29 int ret, link_freq_index;
31 + ret = imx258_write_reg(imx258, IMX258_REG_RESET, IMX258_REG_VALUE_08BIT,
34 + dev_err(&client->dev, "%s failed to reset sensor\n", __func__);
37 + usleep_range(10000, 15000);
40 link_freq_index = imx258->cur_mode->link_freq_index;
41 link_freq_cfg = &imx258->link_freq_configs[link_freq_index];