Skip to content

Commit a87cd54

Browse files
6by9popcornmix
authored andcommitted
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 <[email protected]>
1 parent c937e12 commit a87cd54

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

drivers/media/i2c/imx477.c

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,70 @@ static const struct cci_reg_sequence mode_4056x3040_regs[] = {
674674
{CCI_REG8(0x3f57), 0xae},
675675
};
676676

677+
/* 12 mpix cropped to 16:9 10fps */
678+
static const struct cci_reg_sequence mode_4056x2160_regs[] = {
679+
{CCI_REG8(0x0344), 0x00},
680+
{CCI_REG8(0x0345), 0x00},
681+
{CCI_REG8(0x0346), 0x01},
682+
{CCI_REG8(0x0347), 0xb8},
683+
{CCI_REG8(0x0348), 0x0f},
684+
{CCI_REG8(0x0349), 0xd7},
685+
{CCI_REG8(0x034a), 0x0a},
686+
{CCI_REG8(0x034b), 0x27},
687+
{CCI_REG8(0x00e3), 0x00},
688+
{CCI_REG8(0x00e4), 0x00},
689+
{CCI_REG8(0x00fc), 0x0a},
690+
{CCI_REG8(0x00fd), 0x0a},
691+
{CCI_REG8(0x00fe), 0x0a},
692+
{CCI_REG8(0x00ff), 0x0a},
693+
{CCI_REG8(0x0900), 0x00},
694+
{CCI_REG8(0x0901), 0x11},
695+
{CCI_REG8(0x3c01), 0x03},
696+
{CCI_REG8(0x3c02), 0xa2},
697+
{CCI_REG8(0x3f0d), 0x01},
698+
{CCI_REG8(0x5748), 0x07},
699+
{CCI_REG8(0x5749), 0xff},
700+
{CCI_REG8(0x574a), 0x00},
701+
{CCI_REG8(0x574b), 0x00},
702+
{CCI_REG8(0x7b75), 0x0a},
703+
{CCI_REG8(0x7b76), 0x0c},
704+
{CCI_REG8(0x7b77), 0x07},
705+
{CCI_REG8(0x7b78), 0x06},
706+
{CCI_REG8(0x7b79), 0x3c},
707+
{CCI_REG8(0x7b53), 0x01},
708+
{CCI_REG8(0x9369), 0x5a},
709+
{CCI_REG8(0x936b), 0x55},
710+
{CCI_REG8(0x936d), 0x28},
711+
{CCI_REG8(0x9304), 0x00},
712+
{CCI_REG8(0x9305), 0x00},
713+
{CCI_REG8(0xa2a9), 0x60},
714+
{CCI_REG8(0xa2b7), 0x00},
715+
{CCI_REG8(0x0401), 0x00},
716+
{CCI_REG8(0x0404), 0x00},
717+
{CCI_REG8(0x0405), 0x10},
718+
{CCI_REG8(0x0408), 0x00},
719+
{CCI_REG8(0x0409), 0x00},
720+
{CCI_REG8(0x040a), 0x00},
721+
{CCI_REG8(0x040b), 0x00},
722+
{CCI_REG8(0x040c), 0x0f},
723+
{CCI_REG8(0x040d), 0xd8},
724+
{CCI_REG8(0x040e), 0x08},
725+
{CCI_REG8(0x040f), 0x70},
726+
{CCI_REG8(0x034c), 0x0f},
727+
{CCI_REG8(0x034d), 0xd8},
728+
{CCI_REG8(0x034e), 0x08},
729+
{CCI_REG8(0x034f), 0x70},
730+
{CCI_REG8(0x0305), 0x04},
731+
{CCI_REG8(0x0306), 0x01},
732+
{CCI_REG8(0x0307), 0x5e},
733+
{CCI_REG8(0xe04c), 0x00},
734+
{CCI_REG8(0xe04d), 0x7f},
735+
{CCI_REG8(0xe04e), 0x00},
736+
{CCI_REG8(0xe04f), 0x1f},
737+
{CCI_REG8(0x3f56), 0x02},
738+
{CCI_REG8(0x3f57), 0xae},
739+
};
740+
677741
/* 2x2 binned. 40fps */
678742
static const struct cci_reg_sequence mode_2028x1520_regs[] = {
679743
{CCI_REG8(0x0344), 0x00},
@@ -893,6 +957,23 @@ static const struct imx477_mode supported_modes_12bit[] = {
893957
.regs = mode_4056x3040_regs,
894958
},
895959
},
960+
{
961+
/* 12MPix cropped 16:9 mode */
962+
.width = 4056,
963+
.height = 2160,
964+
.line_length_pix = 24000,
965+
.crop = {
966+
.left = IMX477_PIXEL_ARRAY_LEFT,
967+
.top = IMX477_PIXEL_ARRAY_TOP + 440,
968+
.width = 4056,
969+
.height = 3040,
970+
},
971+
.frm_length_default = 10,
972+
.reg_list = {
973+
.num_of_regs = ARRAY_SIZE(mode_4056x2160_regs),
974+
.regs = mode_4056x2160_regs,
975+
},
976+
},
896977
{
897978
/* 2x2 binned 40fps mode */
898979
.width = 2028,

0 commit comments

Comments
 (0)