1 From e2d1526bc0029a25dc1aac46f63630cd876a978b Mon Sep 17 00:00:00 2001
2 From: Andrey Konovalov <andrey.konovalov@linaro.org>
3 Date: Fri, 12 Jun 2020 15:53:46 +0200
4 Subject: [PATCH] media: i2c: imx290: set the format before
5 VIDIOC_SUBDEV_G_FMT is called
7 Commit d46cfdc86c30d5ec768924f0b1e2683c8d20b671 upstream.
9 With the current driver 'media-ctl -p' issued right after the imx290 driver
14 The format value of zero is due to the current_format field of the imx290
15 struct not being initialized yet.
17 As imx290_entity_init_cfg() calls imx290_set_fmt(), the current_mode field
18 is also initialized, so the line which set current_mode to a default value
19 in driver's probe() function is no longer needed.
21 Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
22 Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
23 Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
24 Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
26 drivers/media/i2c/imx290.c | 3 +++
27 1 file changed, 3 insertions(+)
29 --- a/drivers/media/i2c/imx290.c
30 +++ b/drivers/media/i2c/imx290.c
31 @@ -1087,6 +1087,9 @@ static int imx290_probe(struct i2c_clien
35 + /* Initialize the frame format (this also sets imx290->current_mode) */
36 + imx290_entity_init_cfg(&imx290->sd, NULL);
38 ret = v4l2_async_register_subdev(&imx290->sd);
40 dev_err(dev, "Could not register v4l2 device\n");