Skip to content

Commit 28a4b8d

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 085e8b4 commit 28a4b8d

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
@@ -472,8 +472,6 @@ static const struct imx477_reg mode_common_regs[] = {
472472
{0xb21f, 0x04},
473473
{0xb35c, 0x00},
474474
{0xb35e, 0x08},
475-
{0x0112, 0x0c},
476-
{0x0113, 0x0c},
477475
{0x0114, 0x01},
478476
{0x0350, 0x00},
479477
{0xbcf1, 0x02},
@@ -482,8 +480,8 @@ static const struct imx477_reg mode_common_regs[] = {
482480

483481
/* 12 mpix 10fps */
484482
static const struct imx477_reg mode_4056x3040_regs[] = {
485-
{0x0342, 0x5d},
486-
{0x0343, 0xc0},
483+
{0x0112, 0x0c},
484+
{0x0113, 0x0c},
487485
{0x0344, 0x00},
488486
{0x0345, 0x00},
489487
{0x0346, 0x00},
@@ -594,8 +592,8 @@ static const struct imx477_reg mode_4056x3040_regs[] = {
594592

595593
/* 2x2 binned. 40fps */
596594
static const struct imx477_reg mode_2028x1520_regs[] = {
597-
{0x0342, 0x31},
598-
{0x0343, 0xc4},
595+
{0x0112, 0x0c},
596+
{0x0113, 0x0c},
599597
{0x0344, 0x00},
600598
{0x0345, 0x00},
601599
{0x0346, 0x00},
@@ -695,8 +693,8 @@ static const struct imx477_reg mode_2028x1520_regs[] = {
695693

696694
/* 1080p cropped mode */
697695
static const struct imx477_reg mode_2028x1080_regs[] = {
698-
{0x0342, 0x31},
699-
{0x0343, 0xc4},
696+
{0x0112, 0x0c},
697+
{0x0113, 0x0c},
700698
{0x0344, 0x00},
701699
{0x0345, 0x00},
702700
{0x0346, 0x01},
@@ -796,6 +794,8 @@ static const struct imx477_reg mode_2028x1080_regs[] = {
796794

797795
/* 4x4 binned. 120fps */
798796
static const struct imx477_reg mode_1332x990_regs[] = {
797+
{0x0112, 0x0a},
798+
{0x0113, 0x0a},
799799
{0x420b, 0x01},
800800
{0x990c, 0x00},
801801
{0x990d, 0x08},
@@ -808,13 +808,6 @@ static const struct imx477_reg mode_1332x990_regs[] = {
808808
{0x9a4b, 0x06},
809809
{0x9a4c, 0x06},
810810
{0x9a4d, 0x06},
811-
{0x0112, 0x0a},
812-
{0x0113, 0x0a},
813-
{0x0114, 0x01},
814-
{0x0342, 0x1a},
815-
{0x0343, 0x08},
816-
{0x0340, 0x04},
817-
{0x0341, 0x1a},
818811
{0x0344, 0x00},
819812
{0x0345, 0x00},
820813
{0x0346, 0x02},

0 commit comments

Comments
 (0)