Skip to content

Commit db1a388

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 19c3100 commit db1a388

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
@@ -594,6 +594,70 @@ static const struct imx477_reg mode_4056x3040_regs[] = {
594594
{0x3f57, 0xae},
595595
};
596596

597+
/* 12 mpix cropped to 16:9 10fps */
598+
static const struct imx477_reg mode_4056x2160_regs[] = {
599+
{0x0344, 0x00},
600+
{0x0345, 0x00},
601+
{0x0346, 0x01},
602+
{0x0347, 0xb8},
603+
{0x0348, 0x0f},
604+
{0x0349, 0xd7},
605+
{0x034a, 0x0a},
606+
{0x034b, 0x27},
607+
{0x00e3, 0x00},
608+
{0x00e4, 0x00},
609+
{0x00fc, 0x0a},
610+
{0x00fd, 0x0a},
611+
{0x00fe, 0x0a},
612+
{0x00ff, 0x0a},
613+
{0x0900, 0x00},
614+
{0x0901, 0x11},
615+
{0x3c01, 0x03},
616+
{0x3c02, 0xa2},
617+
{0x3f0d, 0x01},
618+
{0x5748, 0x07},
619+
{0x5749, 0xff},
620+
{0x574a, 0x00},
621+
{0x574b, 0x00},
622+
{0x7b75, 0x0a},
623+
{0x7b76, 0x0c},
624+
{0x7b77, 0x07},
625+
{0x7b78, 0x06},
626+
{0x7b79, 0x3c},
627+
{0x7b53, 0x01},
628+
{0x9369, 0x5a},
629+
{0x936b, 0x55},
630+
{0x936d, 0x28},
631+
{0x9304, 0x00},
632+
{0x9305, 0x00},
633+
{0xa2a9, 0x60},
634+
{0xa2b7, 0x00},
635+
{0x0401, 0x00},
636+
{0x0404, 0x00},
637+
{0x0405, 0x10},
638+
{0x0408, 0x00},
639+
{0x0409, 0x00},
640+
{0x040a, 0x00},
641+
{0x040b, 0x00},
642+
{0x040c, 0x0f},
643+
{0x040d, 0xd8},
644+
{0x040e, 0x08},
645+
{0x040f, 0x70},
646+
{0x034c, 0x0f},
647+
{0x034d, 0xd8},
648+
{0x034e, 0x08},
649+
{0x034f, 0x70},
650+
{0x0305, 0x04},
651+
{0x0306, 0x01},
652+
{0x0307, 0x5e},
653+
{0xe04c, 0x00},
654+
{0xe04d, 0x7f},
655+
{0xe04e, 0x00},
656+
{0xe04f, 0x1f},
657+
{0x3f56, 0x02},
658+
{0x3f57, 0xae},
659+
};
660+
597661
/* 2x2 binned. 40fps */
598662
static const struct imx477_reg mode_2028x1520_regs[] = {
599663
{0x0112, 0x0c},
@@ -805,6 +869,23 @@ static const struct imx477_mode supported_modes_12bit[] = {
805869
.regs = mode_4056x3040_regs,
806870
},
807871
},
872+
{
873+
/* 12MPix cropped 16:9 mode */
874+
.width = 4056,
875+
.height = 2160,
876+
.line_length_pix = { 24000, 20000 },
877+
.crop = {
878+
.left = IMX477_PIXEL_ARRAY_LEFT,
879+
.top = IMX477_PIXEL_ARRAY_TOP + 440,
880+
.width = 4056,
881+
.height = 3040,
882+
},
883+
.framerate_default = 10,
884+
.reg_list = {
885+
.num_of_regs = ARRAY_SIZE(mode_4056x2160_regs),
886+
.regs = mode_4056x2160_regs,
887+
},
888+
},
808889
{
809890
/* 2x2 binned 40fps mode */
810891
.width = 2028,

0 commit comments

Comments
 (0)