Skip to content

Commit 8d9d3e3

Browse files
committed
media: i2c: imx477: Extract more registers from mode tables to common
There are a fair number of registers duplicated in all the mode tables, so move those into the common table. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 03fc72e commit 8d9d3e3

File tree

1 file changed

+43
-172
lines changed

1 file changed

+43
-172
lines changed

drivers/media/i2c/imx477.c

Lines changed: 43 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,49 @@ static const struct imx477_reg mode_common_regs[] = {
552552
{0x0350, 0x00},
553553
{0xbcf1, 0x02},
554554
{0x3ff9, 0x01},
555+
{0x0220, 0x00},
556+
{0x0221, 0x11},
557+
{0x0381, 0x01},
558+
{0x0383, 0x01},
559+
{0x0385, 0x01},
560+
{0x0387, 0x01},
561+
{0x0902, 0x02},
562+
{0x3140, 0x02},
563+
{0x3c00, 0x00},
564+
{0x9e9a, 0x2f},
565+
{0x9e9b, 0x2f},
566+
{0x9e9c, 0x2f},
567+
{0x9e9d, 0x00},
568+
{0x9e9e, 0x00},
569+
{0x9e9f, 0x00},
570+
{0x0301, 0x05},
571+
{0x0303, 0x02},
572+
{0x030b, 0x02},
573+
{0x030d, 0x02},
574+
{0x0310, 0x01},
575+
{0x0820, 0x07},
576+
{0x0821, 0x08},
577+
{0x0822, 0x00},
578+
{0x0823, 0x00},
579+
{0x080a, 0x00},
580+
{0x080b, 0x7f},
581+
{0x080c, 0x00},
582+
{0x080d, 0x4f},
583+
{0x080e, 0x00},
584+
{0x080f, 0x77},
585+
{0x0810, 0x00},
586+
{0x0811, 0x5f},
587+
{0x0812, 0x00},
588+
{0x0813, 0x57},
589+
{0x0814, 0x00},
590+
{0x0815, 0x4f},
591+
{0x0816, 0x01},
592+
{0x0817, 0x27},
593+
{0x0818, 0x00},
594+
{0x0819, 0x3f},
595+
{0x3e20, 0x01},
596+
{0x3e37, 0x00},
597+
{0x3f50, 0x00},
555598
};
556599

557600
/* 12 mpix 10fps */
@@ -572,17 +615,8 @@ static const struct imx477_reg mode_4056x3040_regs[] = {
572615
{0x00fd, 0x0a},
573616
{0x00fe, 0x0a},
574617
{0x00ff, 0x0a},
575-
{0x0220, 0x00},
576-
{0x0221, 0x11},
577-
{0x0381, 0x01},
578-
{0x0383, 0x01},
579-
{0x0385, 0x01},
580-
{0x0387, 0x01},
581618
{0x0900, 0x00},
582619
{0x0901, 0x11},
583-
{0x0902, 0x02},
584-
{0x3140, 0x02},
585-
{0x3c00, 0x00},
586620
{0x3c01, 0x03},
587621
{0x3c02, 0xa2},
588622
{0x3f0d, 0x01},
@@ -601,12 +635,6 @@ static const struct imx477_reg mode_4056x3040_regs[] = {
601635
{0x936d, 0x28},
602636
{0x9304, 0x00},
603637
{0x9305, 0x00},
604-
{0x9e9a, 0x2f},
605-
{0x9e9b, 0x2f},
606-
{0x9e9c, 0x2f},
607-
{0x9e9d, 0x00},
608-
{0x9e9e, 0x00},
609-
{0x9e9f, 0x00},
610638
{0xa2a9, 0x60},
611639
{0xa2b7, 0x00},
612640
{0x0401, 0x00},
@@ -624,42 +652,14 @@ static const struct imx477_reg mode_4056x3040_regs[] = {
624652
{0x034d, 0xd8},
625653
{0x034e, 0x0b},
626654
{0x034f, 0xe0},
627-
{0x0301, 0x05},
628-
{0x0303, 0x02},
629655
{0x0305, 0x04},
630656
{0x0306, 0x01},
631657
{0x0307, 0x5e},
632658
{0x0309, 0x0c},
633-
{0x030b, 0x02},
634-
{0x030d, 0x02},
635-
{0x0310, 0x01},
636-
{0x0820, 0x07},
637-
{0x0821, 0x08},
638-
{0x0822, 0x00},
639-
{0x0823, 0x00},
640-
{0x080a, 0x00},
641-
{0x080b, 0x7f},
642-
{0x080c, 0x00},
643-
{0x080d, 0x4f},
644-
{0x080e, 0x00},
645-
{0x080f, 0x77},
646-
{0x0810, 0x00},
647-
{0x0811, 0x5f},
648-
{0x0812, 0x00},
649-
{0x0813, 0x57},
650-
{0x0814, 0x00},
651-
{0x0815, 0x4f},
652-
{0x0816, 0x01},
653-
{0x0817, 0x27},
654-
{0x0818, 0x00},
655-
{0x0819, 0x3f},
656659
{0xe04c, 0x00},
657660
{0xe04d, 0x7f},
658661
{0xe04e, 0x00},
659662
{0xe04f, 0x1f},
660-
{0x3e20, 0x01},
661-
{0x3e37, 0x00},
662-
{0x3f50, 0x00},
663663
{0x3f56, 0x02},
664664
{0x3f57, 0xae},
665665
};
@@ -676,17 +676,8 @@ static const struct imx477_reg mode_2028x1520_regs[] = {
676676
{0x0349, 0xd7},
677677
{0x034a, 0x0b},
678678
{0x034b, 0xdf},
679-
{0x0220, 0x00},
680-
{0x0221, 0x11},
681-
{0x0381, 0x01},
682-
{0x0383, 0x01},
683-
{0x0385, 0x01},
684-
{0x0387, 0x01},
685679
{0x0900, 0x01},
686680
{0x0901, 0x22},
687-
{0x0902, 0x02},
688-
{0x3140, 0x02},
689-
{0x3c00, 0x00},
690681
{0x3c01, 0x03},
691682
{0x3c02, 0xa2},
692683
{0x3f0d, 0x01},
@@ -700,12 +691,6 @@ static const struct imx477_reg mode_2028x1520_regs[] = {
700691
{0x936d, 0x5f},
701692
{0x9304, 0x00},
702693
{0x9305, 0x00},
703-
{0x9e9a, 0x2f},
704-
{0x9e9b, 0x2f},
705-
{0x9e9c, 0x2f},
706-
{0x9e9d, 0x00},
707-
{0x9e9e, 0x00},
708-
{0x9e9f, 0x00},
709694
{0xa2a9, 0x60},
710695
{0xa2b7, 0x00},
711696
{0x0401, 0x00},
@@ -723,42 +708,14 @@ static const struct imx477_reg mode_2028x1520_regs[] = {
723708
{0x034d, 0xec},
724709
{0x034e, 0x05},
725710
{0x034f, 0xf0},
726-
{0x0301, 0x05},
727-
{0x0303, 0x02},
728711
{0x0305, 0x04},
729712
{0x0306, 0x01},
730713
{0x0307, 0x5e},
731714
{0x0309, 0x0c},
732-
{0x030b, 0x02},
733-
{0x030d, 0x02},
734-
{0x0310, 0x01},
735-
{0x0820, 0x07},
736-
{0x0821, 0x08},
737-
{0x0822, 0x00},
738-
{0x0823, 0x00},
739-
{0x080a, 0x00},
740-
{0x080b, 0x7f},
741-
{0x080c, 0x00},
742-
{0x080d, 0x4f},
743-
{0x080e, 0x00},
744-
{0x080f, 0x77},
745-
{0x0810, 0x00},
746-
{0x0811, 0x5f},
747-
{0x0812, 0x00},
748-
{0x0813, 0x57},
749-
{0x0814, 0x00},
750-
{0x0815, 0x4f},
751-
{0x0816, 0x01},
752-
{0x0817, 0x27},
753-
{0x0818, 0x00},
754-
{0x0819, 0x3f},
755715
{0xe04c, 0x00},
756716
{0xe04d, 0x7f},
757717
{0xe04e, 0x00},
758718
{0xe04f, 0x1f},
759-
{0x3e20, 0x01},
760-
{0x3e37, 0x00},
761-
{0x3f50, 0x00},
762719
{0x3f56, 0x01},
763720
{0x3f57, 0x6c},
764721
};
@@ -775,17 +732,8 @@ static const struct imx477_reg mode_2028x1080_regs[] = {
775732
{0x0349, 0xd7},
776733
{0x034a, 0x0a},
777734
{0x034b, 0x27},
778-
{0x0220, 0x00},
779-
{0x0221, 0x11},
780-
{0x0381, 0x01},
781-
{0x0383, 0x01},
782-
{0x0385, 0x01},
783-
{0x0387, 0x01},
784735
{0x0900, 0x01},
785736
{0x0901, 0x22},
786-
{0x0902, 0x02},
787-
{0x3140, 0x02},
788-
{0x3c00, 0x00},
789737
{0x3c01, 0x03},
790738
{0x3c02, 0xa2},
791739
{0x3f0d, 0x01},
@@ -799,12 +747,6 @@ static const struct imx477_reg mode_2028x1080_regs[] = {
799747
{0x936d, 0x5f},
800748
{0x9304, 0x00},
801749
{0x9305, 0x00},
802-
{0x9e9a, 0x2f},
803-
{0x9e9b, 0x2f},
804-
{0x9e9c, 0x2f},
805-
{0x9e9d, 0x00},
806-
{0x9e9e, 0x00},
807-
{0x9e9f, 0x00},
808750
{0xa2a9, 0x60},
809751
{0xa2b7, 0x00},
810752
{0x0401, 0x00},
@@ -822,42 +764,14 @@ static const struct imx477_reg mode_2028x1080_regs[] = {
822764
{0x034d, 0xec},
823765
{0x034e, 0x04},
824766
{0x034f, 0x38},
825-
{0x0301, 0x05},
826-
{0x0303, 0x02},
827767
{0x0305, 0x04},
828768
{0x0306, 0x01},
829769
{0x0307, 0x5e},
830770
{0x0309, 0x0c},
831-
{0x030b, 0x02},
832-
{0x030d, 0x02},
833-
{0x0310, 0x01},
834-
{0x0820, 0x07},
835-
{0x0821, 0x08},
836-
{0x0822, 0x00},
837-
{0x0823, 0x00},
838-
{0x080a, 0x00},
839-
{0x080b, 0x7f},
840-
{0x080c, 0x00},
841-
{0x080d, 0x4f},
842-
{0x080e, 0x00},
843-
{0x080f, 0x77},
844-
{0x0810, 0x00},
845-
{0x0811, 0x5f},
846-
{0x0812, 0x00},
847-
{0x0813, 0x57},
848-
{0x0814, 0x00},
849-
{0x0815, 0x4f},
850-
{0x0816, 0x01},
851-
{0x0817, 0x27},
852-
{0x0818, 0x00},
853-
{0x0819, 0x3f},
854771
{0xe04c, 0x00},
855772
{0xe04d, 0x7f},
856773
{0xe04e, 0x00},
857774
{0xe04f, 0x1f},
858-
{0x3e20, 0x01},
859-
{0x3e37, 0x00},
860-
{0x3f50, 0x00},
861775
{0x3f56, 0x01},
862776
{0x3f57, 0x6c},
863777
};
@@ -893,17 +807,8 @@ static const struct imx477_reg mode_1332x990_regs[] = {
893807
{0x00fe, 0x0a},
894808
{0x00ff, 0x0a},
895809
{0xe013, 0x00},
896-
{0x0220, 0x00},
897-
{0x0221, 0x11},
898-
{0x0381, 0x01},
899-
{0x0383, 0x01},
900-
{0x0385, 0x01},
901-
{0x0387, 0x01},
902810
{0x0900, 0x01},
903811
{0x0901, 0x22},
904-
{0x0902, 0x02},
905-
{0x3140, 0x02},
906-
{0x3c00, 0x00},
907812
{0x3c01, 0x01},
908813
{0x3c02, 0x9c},
909814
{0x3f0d, 0x00},
@@ -922,12 +827,6 @@ static const struct imx477_reg mode_1332x990_regs[] = {
922827
{0x936d, 0x5f},
923828
{0x9304, 0x03},
924829
{0x9305, 0x80},
925-
{0x9e9a, 0x2f},
926-
{0x9e9b, 0x2f},
927-
{0x9e9c, 0x2f},
928-
{0x9e9d, 0x00},
929-
{0x9e9e, 0x00},
930-
{0x9e9f, 0x00},
931830
{0xa2a9, 0x27},
932831
{0xa2b7, 0x03},
933832
{0x0401, 0x00},
@@ -945,42 +844,14 @@ static const struct imx477_reg mode_1332x990_regs[] = {
945844
{0x034d, 0x34},
946845
{0x034e, 0x03},
947846
{0x034f, 0xde},
948-
{0x0301, 0x05},
949-
{0x0303, 0x02},
950847
{0x0305, 0x02},
951848
{0x0306, 0x00},
952849
{0x0307, 0xaf},
953850
{0x0309, 0x0a},
954-
{0x030b, 0x02},
955-
{0x030d, 0x02},
956-
{0x0310, 0x01},
957-
{0x0820, 0x07},
958-
{0x0821, 0x08},
959-
{0x0822, 0x00},
960-
{0x0823, 0x00},
961-
{0x080a, 0x00},
962-
{0x080b, 0x7f},
963-
{0x080c, 0x00},
964-
{0x080d, 0x4f},
965-
{0x080e, 0x00},
966-
{0x080f, 0x77},
967-
{0x0810, 0x00},
968-
{0x0811, 0x5f},
969-
{0x0812, 0x00},
970-
{0x0813, 0x57},
971-
{0x0814, 0x00},
972-
{0x0815, 0x4f},
973-
{0x0816, 0x01},
974-
{0x0817, 0x27},
975-
{0x0818, 0x00},
976-
{0x0819, 0x3f},
977851
{0xe04c, 0x00},
978852
{0xe04d, 0x5f},
979853
{0xe04e, 0x00},
980854
{0xe04f, 0x1f},
981-
{0x3e20, 0x01},
982-
{0x3e37, 0x00},
983-
{0x3f50, 0x00},
984855
{0x3f56, 0x00},
985856
{0x3f57, 0xbf},
986857
};

0 commit comments

Comments
 (0)