6acd7f34b40579fa94daa4f4624b7e366b9a8e59
[openwrt/staging/blogic.git] /
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
6
7 Commit d46cfdc86c30d5ec768924f0b1e2683c8d20b671 upstream.
8
9 With the current driver 'media-ctl -p' issued right after the imx290 driver
10 is loaded prints:
11 pad0: Source
12 [fmt:unknown/0x0]
13
14 The format value of zero is due to the current_format field of the imx290
15 struct not being initialized yet.
16
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.
20
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>
25 ---
26 drivers/media/i2c/imx290.c | 3 +++
27 1 file changed, 3 insertions(+)
28
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
32 goto free_ctrl;
33 }
34
35 + /* Initialize the frame format (this also sets imx290->current_mode) */
36 + imx290_entity_init_cfg(&imx290->sd, NULL);
37 +
38 ret = v4l2_async_register_subdev(&imx290->sd);
39 if (ret < 0) {
40 dev_err(dev, "Could not register v4l2 device\n");