media: i2c: imx477: Add full res but cropped 16:9 mode

For 4k30 recording we want 16:9 output, so add a cropped mode
to achieve this.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
Dave Stevenson
2025-09-18 18:09:20 +01:00
committed by Dom Cobley
parent a4a49b4470
commit 12c597f6d2

View File

@@ -674,6 +674,70 @@ static const struct cci_reg_sequence mode_4056x3040_regs[] = {
{CCI_REG8(0x3f57), 0xae},
};
/* 12 mpix cropped to 16:9 10fps */
static const struct cci_reg_sequence mode_4056x2160_regs[] = {
{CCI_REG8(0x0344), 0x00},
{CCI_REG8(0x0345), 0x00},
{CCI_REG8(0x0346), 0x01},
{CCI_REG8(0x0347), 0xb8},
{CCI_REG8(0x0348), 0x0f},
{CCI_REG8(0x0349), 0xd7},
{CCI_REG8(0x034a), 0x0a},
{CCI_REG8(0x034b), 0x27},
{CCI_REG8(0x00e3), 0x00},
{CCI_REG8(0x00e4), 0x00},
{CCI_REG8(0x00fc), 0x0a},
{CCI_REG8(0x00fd), 0x0a},
{CCI_REG8(0x00fe), 0x0a},
{CCI_REG8(0x00ff), 0x0a},
{CCI_REG8(0x0900), 0x00},
{CCI_REG8(0x0901), 0x11},
{CCI_REG8(0x3c01), 0x03},
{CCI_REG8(0x3c02), 0xa2},
{CCI_REG8(0x3f0d), 0x01},
{CCI_REG8(0x5748), 0x07},
{CCI_REG8(0x5749), 0xff},
{CCI_REG8(0x574a), 0x00},
{CCI_REG8(0x574b), 0x00},
{CCI_REG8(0x7b75), 0x0a},
{CCI_REG8(0x7b76), 0x0c},
{CCI_REG8(0x7b77), 0x07},
{CCI_REG8(0x7b78), 0x06},
{CCI_REG8(0x7b79), 0x3c},
{CCI_REG8(0x7b53), 0x01},
{CCI_REG8(0x9369), 0x5a},
{CCI_REG8(0x936b), 0x55},
{CCI_REG8(0x936d), 0x28},
{CCI_REG8(0x9304), 0x00},
{CCI_REG8(0x9305), 0x00},
{CCI_REG8(0xa2a9), 0x60},
{CCI_REG8(0xa2b7), 0x00},
{CCI_REG8(0x0401), 0x00},
{CCI_REG8(0x0404), 0x00},
{CCI_REG8(0x0405), 0x10},
{CCI_REG8(0x0408), 0x00},
{CCI_REG8(0x0409), 0x00},
{CCI_REG8(0x040a), 0x00},
{CCI_REG8(0x040b), 0x00},
{CCI_REG8(0x040c), 0x0f},
{CCI_REG8(0x040d), 0xd8},
{CCI_REG8(0x040e), 0x08},
{CCI_REG8(0x040f), 0x70},
{CCI_REG8(0x034c), 0x0f},
{CCI_REG8(0x034d), 0xd8},
{CCI_REG8(0x034e), 0x08},
{CCI_REG8(0x034f), 0x70},
{CCI_REG8(0x0305), 0x04},
{CCI_REG8(0x0306), 0x01},
{CCI_REG8(0x0307), 0x5e},
{CCI_REG8(0xe04c), 0x00},
{CCI_REG8(0xe04d), 0x7f},
{CCI_REG8(0xe04e), 0x00},
{CCI_REG8(0xe04f), 0x1f},
{CCI_REG8(0x3f56), 0x02},
{CCI_REG8(0x3f57), 0xae},
};
/* 2x2 binned. 40fps */
static const struct cci_reg_sequence mode_2028x1520_regs[] = {
{CCI_REG8(0x0344), 0x00},
@@ -893,6 +957,23 @@ static const struct imx477_mode supported_modes_12bit[] = {
.regs = mode_4056x3040_regs,
},
},
{
/* 12MPix cropped 16:9 mode */
.width = 4056,
.height = 2160,
.line_length_pix = 24000,
.crop = {
.left = IMX477_PIXEL_ARRAY_LEFT,
.top = IMX477_PIXEL_ARRAY_TOP + 440,
.width = 4056,
.height = 3040,
},
.frm_length_default = 10,
.reg_list = {
.num_of_regs = ARRAY_SIZE(mode_4056x2160_regs),
.regs = mode_4056x2160_regs,
},
},
{
/* 2x2 binned 40fps mode */
.width = 2028,