Skip to content

Commit 8163bee

Browse files
6by9pelwell
authored andcommitted
media: i2c: imx258: Issue reset before starting streaming
Whilst not documented, register 0x0103 bit 0 is the soft reset for the sensor, so send it before trying to configure the sensor. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent b0f8ef1 commit 8163bee

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/media/i2c/imx258.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#define IMX258_MODE_STANDBY 0x00
2121
#define IMX258_MODE_STREAMING 0x01
2222

23+
#define IMX258_REG_RESET 0x0103
24+
2325
/* Chip ID */
2426
#define IMX258_REG_CHIP_ID 0x0016
2527
#define IMX258_CHIP_ID 0x0258
@@ -1319,6 +1321,14 @@ static int imx258_start_streaming(struct imx258 *imx258)
13191321
const struct imx258_link_freq_config *link_freq_cfg;
13201322
int ret, link_freq_index;
13211323

1324+
ret = imx258_write_reg(imx258, IMX258_REG_RESET, IMX258_REG_VALUE_08BIT,
1325+
0x01);
1326+
if (ret) {
1327+
dev_err(&client->dev, "%s failed to reset sensor\n", __func__);
1328+
return ret;
1329+
}
1330+
usleep_range(10000, 15000);
1331+
13221332
/* Setup PLL */
13231333
link_freq_index = imx258->cur_mode->link_freq_index;
13241334
link_freq_cfg = &imx258->link_freq_configs[link_freq_index];

0 commit comments

Comments
 (0)