1 From d8b1f6de10d7bd64d73b1c3099ad5e69e6fd7d9b Mon Sep 17 00:00:00 2001
2 From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
3 Date: Tue, 10 Mar 2020 14:17:09 +0100
4 Subject: [PATCH] media: i2c: imx219: Add support for cropped 640x480
7 Commit 25130b8ad409d5532f3763bcf891af74f550a70d upstream.
9 This patch adds mode table entry for capturing cropped 640x480 resolution
11 Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
12 Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
13 Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
14 Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
16 drivers/media/i2c/imx219.c | 70 +++++++++++++++++++++++++++++++++++++-
17 1 file changed, 69 insertions(+), 1 deletion(-)
19 --- a/drivers/media/i2c/imx219.c
20 +++ b/drivers/media/i2c/imx219.c
22 #define IMX219_VTS_15FPS 0x0dc6
23 #define IMX219_VTS_30FPS_1080P 0x06e3
24 #define IMX219_VTS_30FPS_BINNED 0x06e3
25 +#define IMX219_VTS_30FPS_640x480 0x06e3
26 #define IMX219_VTS_MAX 0xffff
28 #define IMX219_VBLANK_MIN 4
29 @@ -138,7 +139,7 @@ struct imx219_mode {
31 * Register sets lifted off the i2C interface from the Raspberry Pi firmware
33 - * 3280x2464 = mode 2, 1920x1080 = mode 1, and 1640x1232 = mode 4.
34 + * 3280x2464 = mode 2, 1920x1080 = mode 1, 1640x1232 = mode 4, 640x480 = mode 7.
36 static const struct imx219_reg mode_3280x2464_regs[] = {
38 @@ -313,6 +314,63 @@ static const struct imx219_reg mode_1640
42 +static const struct imx219_reg mode_640_480_regs[] = {
99 static const struct imx219_reg raw8_framefmt_regs[] = {
102 @@ -431,6 +489,16 @@ static const struct imx219_mode supporte
103 .regs = mode_1640_1232_regs,
107 + /* 640x480 30fps mode */
110 + .vts_def = IMX219_VTS_30FPS_640x480,
112 + .num_of_regs = ARRAY_SIZE(mode_640_480_regs),
113 + .regs = mode_640_480_regs,