Skip to content

Commit 8a95009

Browse files
committed
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 935d6ab commit 8a95009

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
@@ -658,6 +658,70 @@ static const struct cci_reg_sequence mode_4056x3040_regs[] = {
658658
{CCI_REG8(0x3f57), 0xae},
659659
};
660660

661+
/* 12 mpix cropped to 16:9 10fps */
662+
static const struct cci_reg_sequence mode_4056x2160_regs[] = {
663+
{CCI_REG8(0x0344), 0x00},
664+
{CCI_REG8(0x0345), 0x00},
665+
{CCI_REG8(0x0346), 0x01},
666+
{CCI_REG8(0x0347), 0xb8},
667+
{CCI_REG8(0x0348), 0x0f},
668+
{CCI_REG8(0x0349), 0xd7},
669+
{CCI_REG8(0x034a), 0x0a},
670+
{CCI_REG8(0x034b), 0x27},
671+
{CCI_REG8(0x00e3), 0x00},
672+
{CCI_REG8(0x00e4), 0x00},
673+
{CCI_REG8(0x00fc), 0x0a},
674+
{CCI_REG8(0x00fd), 0x0a},
675+
{CCI_REG8(0x00fe), 0x0a},
676+
{CCI_REG8(0x00ff), 0x0a},
677+
{CCI_REG8(0x0900), 0x00},
678+
{CCI_REG8(0x0901), 0x11},
679+
{CCI_REG8(0x3c01), 0x03},
680+
{CCI_REG8(0x3c02), 0xa2},
681+
{CCI_REG8(0x3f0d), 0x01},
682+
{CCI_REG8(0x5748), 0x07},
683+
{CCI_REG8(0x5749), 0xff},
684+
{CCI_REG8(0x574a), 0x00},
685+
{CCI_REG8(0x574b), 0x00},
686+
{CCI_REG8(0x7b75), 0x0a},
687+
{CCI_REG8(0x7b76), 0x0c},
688+
{CCI_REG8(0x7b77), 0x07},
689+
{CCI_REG8(0x7b78), 0x06},
690+
{CCI_REG8(0x7b79), 0x3c},
691+
{CCI_REG8(0x7b53), 0x01},
692+
{CCI_REG8(0x9369), 0x5a},
693+
{CCI_REG8(0x936b), 0x55},
694+
{CCI_REG8(0x936d), 0x28},
695+
{CCI_REG8(0x9304), 0x00},
696+
{CCI_REG8(0x9305), 0x00},
697+
{CCI_REG8(0xa2a9), 0x60},
698+
{CCI_REG8(0xa2b7), 0x00},
699+
{CCI_REG8(0x0401), 0x00},
700+
{CCI_REG8(0x0404), 0x00},
701+
{CCI_REG8(0x0405), 0x10},
702+
{CCI_REG8(0x0408), 0x00},
703+
{CCI_REG8(0x0409), 0x00},
704+
{CCI_REG8(0x040a), 0x00},
705+
{CCI_REG8(0x040b), 0x00},
706+
{CCI_REG8(0x040c), 0x0f},
707+
{CCI_REG8(0x040d), 0xd8},
708+
{CCI_REG8(0x040e), 0x08},
709+
{CCI_REG8(0x040f), 0x70},
710+
{CCI_REG8(0x034c), 0x0f},
711+
{CCI_REG8(0x034d), 0xd8},
712+
{CCI_REG8(0x034e), 0x08},
713+
{CCI_REG8(0x034f), 0x70},
714+
{CCI_REG8(0x0305), 0x04},
715+
{CCI_REG8(0x0306), 0x01},
716+
{CCI_REG8(0x0307), 0x5e},
717+
{CCI_REG8(0xe04c), 0x00},
718+
{CCI_REG8(0xe04d), 0x7f},
719+
{CCI_REG8(0xe04e), 0x00},
720+
{CCI_REG8(0xe04f), 0x1f},
721+
{CCI_REG8(0x3f56), 0x02},
722+
{CCI_REG8(0x3f57), 0xae},
723+
};
724+
661725
/* 2x2 binned. 40fps */
662726
static const struct cci_reg_sequence mode_2028x1520_regs[] = {
663727
{CCI_REG8(0x0344), 0x00},
@@ -877,6 +941,23 @@ static const struct imx477_mode supported_modes_12bit[] = {
877941
.regs = mode_4056x3040_regs,
878942
},
879943
},
944+
{
945+
/* 12MPix cropped 16:9 mode */
946+
.width = 4056,
947+
.height = 2160,
948+
.line_length_pix = 24000,
949+
.crop = {
950+
.left = IMX477_PIXEL_ARRAY_LEFT,
951+
.top = IMX477_PIXEL_ARRAY_TOP + 440,
952+
.width = 4056,
953+
.height = 3040,
954+
},
955+
.frm_length_default = 10,
956+
.reg_list = {
957+
.num_of_regs = ARRAY_SIZE(mode_4056x2160_regs),
958+
.regs = mode_4056x2160_regs,
959+
},
960+
},
880961
{
881962
/* 2x2 binned 40fps mode */
882963
.width = 2028,

0 commit comments

Comments
 (0)