Skip to content

Commit ad61893

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 4a039e7 commit ad61893

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
@@ -549,6 +549,49 @@ static const struct imx477_reg mode_common_regs[] = {
549549
{0x0350, 0x00},
550550
{0xbcf1, 0x02},
551551
{0x3ff9, 0x01},
552+
{0x0220, 0x00},
553+
{0x0221, 0x11},
554+
{0x0381, 0x01},
555+
{0x0383, 0x01},
556+
{0x0385, 0x01},
557+
{0x0387, 0x01},
558+
{0x0902, 0x02},
559+
{0x3140, 0x02},
560+
{0x3c00, 0x00},
561+
{0x9e9a, 0x2f},
562+
{0x9e9b, 0x2f},
563+
{0x9e9c, 0x2f},
564+
{0x9e9d, 0x00},
565+
{0x9e9e, 0x00},
566+
{0x9e9f, 0x00},
567+
{0x0301, 0x05},
568+
{0x0303, 0x02},
569+
{0x030b, 0x02},
570+
{0x030d, 0x02},
571+
{0x0310, 0x01},
572+
{0x0820, 0x07},
573+
{0x0821, 0x08},
574+
{0x0822, 0x00},
575+
{0x0823, 0x00},
576+
{0x080a, 0x00},
577+
{0x080b, 0x7f},
578+
{0x080c, 0x00},
579+
{0x080d, 0x4f},
580+
{0x080e, 0x00},
581+
{0x080f, 0x77},
582+
{0x0810, 0x00},
583+
{0x0811, 0x5f},
584+
{0x0812, 0x00},
585+
{0x0813, 0x57},
586+
{0x0814, 0x00},
587+
{0x0815, 0x4f},
588+
{0x0816, 0x01},
589+
{0x0817, 0x27},
590+
{0x0818, 0x00},
591+
{0x0819, 0x3f},
592+
{0x3e20, 0x01},
593+
{0x3e37, 0x00},
594+
{0x3f50, 0x00},
552595
};
553596

554597
/* 12 mpix 10fps */
@@ -569,17 +612,8 @@ static const struct imx477_reg mode_4056x3040_regs[] = {
569612
{0x00fd, 0x0a},
570613
{0x00fe, 0x0a},
571614
{0x00ff, 0x0a},
572-
{0x0220, 0x00},
573-
{0x0221, 0x11},
574-
{0x0381, 0x01},
575-
{0x0383, 0x01},
576-
{0x0385, 0x01},
577-
{0x0387, 0x01},
578615
{0x0900, 0x00},
579616
{0x0901, 0x11},
580-
{0x0902, 0x02},
581-
{0x3140, 0x02},
582-
{0x3c00, 0x00},
583617
{0x3c01, 0x03},
584618
{0x3c02, 0xa2},
585619
{0x3f0d, 0x01},
@@ -598,12 +632,6 @@ static const struct imx477_reg mode_4056x3040_regs[] = {
598632
{0x936d, 0x28},
599633
{0x9304, 0x00},
600634
{0x9305, 0x00},
601-
{0x9e9a, 0x2f},
602-
{0x9e9b, 0x2f},
603-
{0x9e9c, 0x2f},
604-
{0x9e9d, 0x00},
605-
{0x9e9e, 0x00},
606-
{0x9e9f, 0x00},
607635
{0xa2a9, 0x60},
608636
{0xa2b7, 0x00},
609637
{0x0401, 0x00},
@@ -621,42 +649,14 @@ static const struct imx477_reg mode_4056x3040_regs[] = {
621649
{0x034d, 0xd8},
622650
{0x034e, 0x0b},
623651
{0x034f, 0xe0},
624-
{0x0301, 0x05},
625-
{0x0303, 0x02},
626652
{0x0305, 0x04},
627653
{0x0306, 0x01},
628654
{0x0307, 0x5e},
629655
{0x0309, 0x0c},
630-
{0x030b, 0x02},
631-
{0x030d, 0x02},
632-
{0x0310, 0x01},
633-
{0x0820, 0x07},
634-
{0x0821, 0x08},
635-
{0x0822, 0x00},
636-
{0x0823, 0x00},
637-
{0x080a, 0x00},
638-
{0x080b, 0x7f},
639-
{0x080c, 0x00},
640-
{0x080d, 0x4f},
641-
{0x080e, 0x00},
642-
{0x080f, 0x77},
643-
{0x0810, 0x00},
644-
{0x0811, 0x5f},
645-
{0x0812, 0x00},
646-
{0x0813, 0x57},
647-
{0x0814, 0x00},
648-
{0x0815, 0x4f},
649-
{0x0816, 0x01},
650-
{0x0817, 0x27},
651-
{0x0818, 0x00},
652-
{0x0819, 0x3f},
653656
{0xe04c, 0x00},
654657
{0xe04d, 0x7f},
655658
{0xe04e, 0x00},
656659
{0xe04f, 0x1f},
657-
{0x3e20, 0x01},
658-
{0x3e37, 0x00},
659-
{0x3f50, 0x00},
660660
{0x3f56, 0x02},
661661
{0x3f57, 0xae},
662662
};
@@ -673,17 +673,8 @@ static const struct imx477_reg mode_2028x1520_regs[] = {
673673
{0x0349, 0xd7},
674674
{0x034a, 0x0b},
675675
{0x034b, 0xdf},
676-
{0x0220, 0x00},
677-
{0x0221, 0x11},
678-
{0x0381, 0x01},
679-
{0x0383, 0x01},
680-
{0x0385, 0x01},
681-
{0x0387, 0x01},
682676
{0x0900, 0x01},
683677
{0x0901, 0x22},
684-
{0x0902, 0x02},
685-
{0x3140, 0x02},
686-
{0x3c00, 0x00},
687678
{0x3c01, 0x03},
688679
{0x3c02, 0xa2},
689680
{0x3f0d, 0x01},
@@ -697,12 +688,6 @@ static const struct imx477_reg mode_2028x1520_regs[] = {
697688
{0x936d, 0x5f},
698689
{0x9304, 0x00},
699690
{0x9305, 0x00},
700-
{0x9e9a, 0x2f},
701-
{0x9e9b, 0x2f},
702-
{0x9e9c, 0x2f},
703-
{0x9e9d, 0x00},
704-
{0x9e9e, 0x00},
705-
{0x9e9f, 0x00},
706691
{0xa2a9, 0x60},
707692
{0xa2b7, 0x00},
708693
{0x0401, 0x00},
@@ -720,42 +705,14 @@ static const struct imx477_reg mode_2028x1520_regs[] = {
720705
{0x034d, 0xec},
721706
{0x034e, 0x05},
722707
{0x034f, 0xf0},
723-
{0x0301, 0x05},
724-
{0x0303, 0x02},
725708
{0x0305, 0x04},
726709
{0x0306, 0x01},
727710
{0x0307, 0x5e},
728711
{0x0309, 0x0c},
729-
{0x030b, 0x02},
730-
{0x030d, 0x02},
731-
{0x0310, 0x01},
732-
{0x0820, 0x07},
733-
{0x0821, 0x08},
734-
{0x0822, 0x00},
735-
{0x0823, 0x00},
736-
{0x080a, 0x00},
737-
{0x080b, 0x7f},
738-
{0x080c, 0x00},
739-
{0x080d, 0x4f},
740-
{0x080e, 0x00},
741-
{0x080f, 0x77},
742-
{0x0810, 0x00},
743-
{0x0811, 0x5f},
744-
{0x0812, 0x00},
745-
{0x0813, 0x57},
746-
{0x0814, 0x00},
747-
{0x0815, 0x4f},
748-
{0x0816, 0x01},
749-
{0x0817, 0x27},
750-
{0x0818, 0x00},
751-
{0x0819, 0x3f},
752712
{0xe04c, 0x00},
753713
{0xe04d, 0x7f},
754714
{0xe04e, 0x00},
755715
{0xe04f, 0x1f},
756-
{0x3e20, 0x01},
757-
{0x3e37, 0x00},
758-
{0x3f50, 0x00},
759716
{0x3f56, 0x01},
760717
{0x3f57, 0x6c},
761718
};
@@ -772,17 +729,8 @@ static const struct imx477_reg mode_2028x1080_regs[] = {
772729
{0x0349, 0xd7},
773730
{0x034a, 0x0a},
774731
{0x034b, 0x27},
775-
{0x0220, 0x00},
776-
{0x0221, 0x11},
777-
{0x0381, 0x01},
778-
{0x0383, 0x01},
779-
{0x0385, 0x01},
780-
{0x0387, 0x01},
781732
{0x0900, 0x01},
782733
{0x0901, 0x22},
783-
{0x0902, 0x02},
784-
{0x3140, 0x02},
785-
{0x3c00, 0x00},
786734
{0x3c01, 0x03},
787735
{0x3c02, 0xa2},
788736
{0x3f0d, 0x01},
@@ -796,12 +744,6 @@ static const struct imx477_reg mode_2028x1080_regs[] = {
796744
{0x936d, 0x5f},
797745
{0x9304, 0x00},
798746
{0x9305, 0x00},
799-
{0x9e9a, 0x2f},
800-
{0x9e9b, 0x2f},
801-
{0x9e9c, 0x2f},
802-
{0x9e9d, 0x00},
803-
{0x9e9e, 0x00},
804-
{0x9e9f, 0x00},
805747
{0xa2a9, 0x60},
806748
{0xa2b7, 0x00},
807749
{0x0401, 0x00},
@@ -819,42 +761,14 @@ static const struct imx477_reg mode_2028x1080_regs[] = {
819761
{0x034d, 0xec},
820762
{0x034e, 0x04},
821763
{0x034f, 0x38},
822-
{0x0301, 0x05},
823-
{0x0303, 0x02},
824764
{0x0305, 0x04},
825765
{0x0306, 0x01},
826766
{0x0307, 0x5e},
827767
{0x0309, 0x0c},
828-
{0x030b, 0x02},
829-
{0x030d, 0x02},
830-
{0x0310, 0x01},
831-
{0x0820, 0x07},
832-
{0x0821, 0x08},
833-
{0x0822, 0x00},
834-
{0x0823, 0x00},
835-
{0x080a, 0x00},
836-
{0x080b, 0x7f},
837-
{0x080c, 0x00},
838-
{0x080d, 0x4f},
839-
{0x080e, 0x00},
840-
{0x080f, 0x77},
841-
{0x0810, 0x00},
842-
{0x0811, 0x5f},
843-
{0x0812, 0x00},
844-
{0x0813, 0x57},
845-
{0x0814, 0x00},
846-
{0x0815, 0x4f},
847-
{0x0816, 0x01},
848-
{0x0817, 0x27},
849-
{0x0818, 0x00},
850-
{0x0819, 0x3f},
851768
{0xe04c, 0x00},
852769
{0xe04d, 0x7f},
853770
{0xe04e, 0x00},
854771
{0xe04f, 0x1f},
855-
{0x3e20, 0x01},
856-
{0x3e37, 0x00},
857-
{0x3f50, 0x00},
858772
{0x3f56, 0x01},
859773
{0x3f57, 0x6c},
860774
};
@@ -890,17 +804,8 @@ static const struct imx477_reg mode_1332x990_regs[] = {
890804
{0x00fe, 0x0a},
891805
{0x00ff, 0x0a},
892806
{0xe013, 0x00},
893-
{0x0220, 0x00},
894-
{0x0221, 0x11},
895-
{0x0381, 0x01},
896-
{0x0383, 0x01},
897-
{0x0385, 0x01},
898-
{0x0387, 0x01},
899807
{0x0900, 0x01},
900808
{0x0901, 0x22},
901-
{0x0902, 0x02},
902-
{0x3140, 0x02},
903-
{0x3c00, 0x00},
904809
{0x3c01, 0x01},
905810
{0x3c02, 0x9c},
906811
{0x3f0d, 0x00},
@@ -919,12 +824,6 @@ static const struct imx477_reg mode_1332x990_regs[] = {
919824
{0x936d, 0x5f},
920825
{0x9304, 0x03},
921826
{0x9305, 0x80},
922-
{0x9e9a, 0x2f},
923-
{0x9e9b, 0x2f},
924-
{0x9e9c, 0x2f},
925-
{0x9e9d, 0x00},
926-
{0x9e9e, 0x00},
927-
{0x9e9f, 0x00},
928827
{0xa2a9, 0x27},
929828
{0xa2b7, 0x03},
930829
{0x0401, 0x00},
@@ -942,42 +841,14 @@ static const struct imx477_reg mode_1332x990_regs[] = {
942841
{0x034d, 0x34},
943842
{0x034e, 0x03},
944843
{0x034f, 0xde},
945-
{0x0301, 0x05},
946-
{0x0303, 0x02},
947844
{0x0305, 0x02},
948845
{0x0306, 0x00},
949846
{0x0307, 0xaf},
950847
{0x0309, 0x0a},
951-
{0x030b, 0x02},
952-
{0x030d, 0x02},
953-
{0x0310, 0x01},
954-
{0x0820, 0x07},
955-
{0x0821, 0x08},
956-
{0x0822, 0x00},
957-
{0x0823, 0x00},
958-
{0x080a, 0x00},
959-
{0x080b, 0x7f},
960-
{0x080c, 0x00},
961-
{0x080d, 0x4f},
962-
{0x080e, 0x00},
963-
{0x080f, 0x77},
964-
{0x0810, 0x00},
965-
{0x0811, 0x5f},
966-
{0x0812, 0x00},
967-
{0x0813, 0x57},
968-
{0x0814, 0x00},
969-
{0x0815, 0x4f},
970-
{0x0816, 0x01},
971-
{0x0817, 0x27},
972-
{0x0818, 0x00},
973-
{0x0819, 0x3f},
974848
{0xe04c, 0x00},
975849
{0xe04d, 0x5f},
976850
{0xe04e, 0x00},
977851
{0xe04f, 0x1f},
978-
{0x3e20, 0x01},
979-
{0x3e37, 0x00},
980-
{0x3f50, 0x00},
981852
{0x3f56, 0x00},
982853
{0x3f57, 0xbf},
983854
};

0 commit comments

Comments
 (0)