]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: i2c: imx334: add modes for 720p and 480p resolutions
authorShravan Chippa <shravan.chippa@microchip.com>
Wed, 5 Mar 2025 05:14:42 +0000 (10:44 +0530)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 25 Apr 2025 08:15:13 +0000 (10:15 +0200)
Added support for 1280x720@30 and 640x480@30 resolutions

Signed-off-by: Shravan Chippa <shravan.chippa@microchip.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/imx334.c

index 5ba832591a9c95d4956692ba2302dc0d25a0fb17..84a2313d0c8d81d14f245110bdde5f81be4ddd9c 100644 (file)
@@ -314,6 +314,46 @@ static const struct imx334_reg common_mode_regs[] = {
        {0x3002, 0x00},
 };
 
+/* Sensor mode registers for 640x480@30fps */
+static const struct imx334_reg mode_640x480_regs[] = {
+       {0x302c, 0x70},
+       {0x302d, 0x06},
+       {0x302e, 0x80},
+       {0x302f, 0x02},
+       {0x3074, 0x48},
+       {0x3075, 0x07},
+       {0x308e, 0x49},
+       {0x308f, 0x07},
+       {0x3076, 0xe0},
+       {0x3077, 0x01},
+       {0x3090, 0xe0},
+       {0x3091, 0x01},
+       {0x3308, 0xe0},
+       {0x3309, 0x01},
+       {0x30d8, 0x30},
+       {0x30d9, 0x0b},
+};
+
+/* Sensor mode registers for 1280x720@30fps */
+static const struct imx334_reg mode_1280x720_regs[] = {
+       {0x302c, 0x30},
+       {0x302d, 0x05},
+       {0x302e, 0x00},
+       {0x302f, 0x05},
+       {0x3074, 0x84},
+       {0x3075, 0x03},
+       {0x308e, 0x85},
+       {0x308f, 0x03},
+       {0x3076, 0xd0},
+       {0x3077, 0x02},
+       {0x3090, 0xd0},
+       {0x3091, 0x02},
+       {0x3308, 0xd0},
+       {0x3309, 0x02},
+       {0x30d8, 0x30},
+       {0x30d9, 0x0b},
+};
+
 /* Sensor mode registers for 1920x1080@30fps */
 static const struct imx334_reg mode_1920x1080_regs[] = {
        {0x302c, 0xf0},
@@ -433,6 +473,32 @@ static const struct imx334_mode supported_modes[] = {
                        .num_of_regs = ARRAY_SIZE(mode_1920x1080_regs),
                        .regs = mode_1920x1080_regs,
                },
+       }, {
+               .width = 1280,
+               .height = 720,
+               .hblank = 2480,
+               .vblank = 1170,
+               .vblank_min = 45,
+               .vblank_max = 132840,
+               .pclk = 297000000,
+               .link_freq_idx = 1,
+               .reg_list = {
+                       .num_of_regs = ARRAY_SIZE(mode_1280x720_regs),
+                       .regs = mode_1280x720_regs,
+               },
+       }, {
+               .width = 640,
+               .height = 480,
+               .hblank = 2480,
+               .vblank = 1170,
+               .vblank_min = 45,
+               .vblank_max = 132840,
+               .pclk = 297000000,
+               .link_freq_idx = 1,
+               .reg_list = {
+                       .num_of_regs = ARRAY_SIZE(mode_640x480_regs),
+                       .regs = mode_640x480_regs,
+               },
        },
 };