Skip to content

Commit bd0e8df

Browse files
committed
media: i2c: imx477: Clean up duplicated registers
Registers 0x0342 / 0x0343 are set via IMX477_REG_LINE_LENGTH as V4L2_CID_HBLANK, so shouldn't be in the register tables. Registers 0x0340 / 0x0341 are set via IMX477_REG_FRAME_LENGTH as V4L2_CID_VBLANK so shouldn't be in the register tables. Registers 0x0112 and 0x0113 set the bit depth, so should be per mode rather than in the common table and overridden for the 10bit mode(s). Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 5fa4b1f commit bd0e8df

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

drivers/media/i2c/imx477.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,6 @@ static const struct imx477_reg mode_common_regs[] = {
512512
{0xb21f, 0x04},
513513
{0xb35c, 0x00},
514514
{0xb35e, 0x08},
515-
{0x0112, 0x0c},
516-
{0x0113, 0x0c},
517515
{0x0114, 0x01},
518516
{0x0350, 0x00},
519517
{0xbcf1, 0x02},
@@ -522,8 +520,8 @@ static const struct imx477_reg mode_common_regs[] = {
522520

523521
/* 12 mpix 10fps */
524522
static const struct imx477_reg mode_4056x3040_regs[] = {
525-
{0x0342, 0x5d},
526-
{0x0343, 0xc0},
523+
{0x0112, 0x0c},
524+
{0x0113, 0x0c},
527525
{0x0344, 0x00},
528526
{0x0345, 0x00},
529527
{0x0346, 0x00},
@@ -632,8 +630,8 @@ static const struct imx477_reg mode_4056x3040_regs[] = {
632630

633631
/* 2x2 binned. 40fps */
634632
static const struct imx477_reg mode_2028x1520_regs[] = {
635-
{0x0342, 0x31},
636-
{0x0343, 0xc4},
633+
{0x0112, 0x0c},
634+
{0x0113, 0x0c},
637635
{0x0344, 0x00},
638636
{0x0345, 0x00},
639637
{0x0346, 0x00},
@@ -731,8 +729,8 @@ static const struct imx477_reg mode_2028x1520_regs[] = {
731729

732730
/* 1080p cropped mode */
733731
static const struct imx477_reg mode_2028x1080_regs[] = {
734-
{0x0342, 0x31},
735-
{0x0343, 0xc4},
732+
{0x0112, 0x0c},
733+
{0x0113, 0x0c},
736734
{0x0344, 0x00},
737735
{0x0345, 0x00},
738736
{0x0346, 0x01},
@@ -830,6 +828,8 @@ static const struct imx477_reg mode_2028x1080_regs[] = {
830828

831829
/* 4x4 binned. 120fps */
832830
static const struct imx477_reg mode_1332x990_regs[] = {
831+
{0x0112, 0x0a},
832+
{0x0113, 0x0a},
833833
{0x420b, 0x01},
834834
{0x990c, 0x00},
835835
{0x990d, 0x08},
@@ -842,13 +842,6 @@ static const struct imx477_reg mode_1332x990_regs[] = {
842842
{0x9a4b, 0x06},
843843
{0x9a4c, 0x06},
844844
{0x9a4d, 0x06},
845-
{0x0112, 0x0a},
846-
{0x0113, 0x0a},
847-
{0x0114, 0x01},
848-
{0x0342, 0x1a},
849-
{0x0343, 0x08},
850-
{0x0340, 0x04},
851-
{0x0341, 0x1a},
852845
{0x0344, 0x00},
853846
{0x0345, 0x00},
854847
{0x0346, 0x02},

0 commit comments

Comments
 (0)