ef8eff6c00688b443ec1b8b75603d14d02a8d833
[openwrt/openwrt.git] /
1 From 942a240a1999aaf1b8d18a88c63f418991bf7d22 Mon Sep 17 00:00:00 2001
2 From: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
3 Date: Tue, 31 Mar 2020 20:06:30 +0200
4 Subject: [PATCH] media: i2c: imx219: Fix a bug in
5 imx219_enum_frame_size
6
7 https://patchwork.linuxtv.org/patch/62740/
8
9 When enumerating the frame sizes, the value sent to
10 imx219_get_format_code should be fse->code
11 (the code from the ioctl) and not imx219->fmt.code
12 which is the code set currently in the driver.
13
14 Fixes: 22da1d56e ("media: i2c: imx219: Add support for RAW8 bit bayer format")
15
16 Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
17 Reviewed-by: Helen Koike <helen.koike@collabora.com>
18 Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
19 Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
20 ---
21 drivers/media/i2c/imx219.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24 --- a/drivers/media/i2c/imx219.c
25 +++ b/drivers/media/i2c/imx219.c
26 @@ -781,7 +781,7 @@ static int imx219_enum_frame_size(struct
27 if (fse->index >= ARRAY_SIZE(supported_modes))
28 return -EINVAL;
29
30 - if (fse->code != imx219_get_format_code(imx219, imx219->fmt.code))
31 + if (fse->code != imx219_get_format_code(imx219, fse->code))
32 return -EINVAL;
33
34 fse->min_width = supported_modes[fse->index].width;