[PATCH 10/13] media: i2c: ov5647: Tidy up mode registers to make the order common

Jai Luthra posted 13 patches 3 months, 2 weeks ago
There is a newer version of this series
[PATCH 10/13] media: i2c: ov5647: Tidy up mode registers to make the order common
Posted by Jai Luthra 3 months, 2 weeks ago
From: Dave Stevenson <dave.stevenson@raspberrypi.com>

To make comparisons of the mode registers easier, put the registers
for the binned and VGA modes in the same order as the others.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 drivers/media/i2c/ov5647.c | 33 ++++++++++++++-------------------
 1 file changed, 14 insertions(+), 19 deletions(-)

diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index 59c21b91d09d79f073a54871221f197a0bcf3aa2..2c9f50fd20d99f2adce2a1fbe4289cf7aeea2ba4 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -343,6 +343,8 @@ static struct regval_list ov5647_2x2binned_10bpp[] = {
 	{0x3036, 0x62},
 	{0x303c, 0x11},
 	{0x3106, 0xf5},
+	{0x3821, 0x01},
+	{0x3820, 0x41},
 	{0x3827, 0xec},
 	{0x370c, 0x03},
 	{0x3612, 0x59},
@@ -415,8 +417,6 @@ static struct regval_list ov5647_2x2binned_10bpp[] = {
 	{0x4837, 0x16},
 	{0x4800, 0x24},
 	{0x3503, 0x03},
-	{0x3820, 0x41},
-	{0x3821, 0x01},
 	{0x350a, 0x00},
 	{0x350b, 0x10},
 	{0x3500, 0x00},
@@ -429,20 +429,27 @@ static struct regval_list ov5647_2x2binned_10bpp[] = {
 static struct regval_list ov5647_640x480_10bpp[] = {
 	{0x0100, 0x00},
 	{0x0103, 0x01},
-	{0x3035, 0x11},
+	{0x3034, 0x1a},
+	{0x3035, 0x21},
 	{0x3036, 0x46},
 	{0x303c, 0x11},
+	{0x3106, 0xf5},
 	{0x3821, 0x01},
 	{0x3820, 0x41},
+	{0x3827, 0xec},
 	{0x370c, 0x03},
 	{0x3612, 0x59},
 	{0x3618, 0x00},
 	{0x5000, 0x06},
 	{0x5003, 0x08},
 	{0x5a00, 0x08},
-	{0x3000, 0xff},
-	{0x3001, 0xff},
-	{0x3002, 0xff},
+	{0x3000, 0x00},
+	{0x3001, 0x00},
+	{0x3002, 0x00},
+	{0x3016, 0x08},
+	{0x3017, 0xe0},
+	{0x3018, 0x44},
+	{0x301c, 0xf8},
 	{0x301d, 0xf0},
 	{0x3a18, 0x00},
 	{0x3a19, 0xf8},
@@ -468,6 +475,7 @@ static struct regval_list ov5647_640x480_10bpp[] = {
 	{0x3632, 0xe2},
 	{0x3633, 0x23},
 	{0x3634, 0x44},
+	{0x3636, 0x06},
 	{0x3620, 0x64},
 	{0x3621, 0xe0},
 	{0x3600, 0x37},
@@ -496,19 +504,6 @@ static struct regval_list ov5647_640x480_10bpp[] = {
 	{0x4001, 0x02},
 	{0x4004, 0x02},
 	{0x4000, 0x09},
-	{0x3000, 0x00},
-	{0x3001, 0x00},
-	{0x3002, 0x00},
-	{0x3017, 0xe0},
-	{0x301c, 0xfc},
-	{0x3636, 0x06},
-	{0x3016, 0x08},
-	{0x3827, 0xec},
-	{0x3018, 0x44},
-	{0x3035, 0x21},
-	{0x3106, 0xf5},
-	{0x3034, 0x1a},
-	{0x301c, 0xf8},
 	{0x4800, 0x34},
 	{0x3503, 0x03},
 	{0x0100, 0x01},

-- 
2.51.0
Re: [PATCH 10/13] media: i2c: ov5647: Tidy up mode registers to make the order common
Posted by Jacopo Mondi 3 months, 1 week ago
Hi Jai

On Tue, Oct 28, 2025 at 12:57:21PM +0530, Jai Luthra wrote:
> From: Dave Stevenson <dave.stevenson@raspberrypi.com>
>
> To make comparisons of the mode registers easier, put the registers
> for the binned and VGA modes in the same order as the others.
>
> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> ---
>  drivers/media/i2c/ov5647.c | 33 ++++++++++++++-------------------
>  1 file changed, 14 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
> index 59c21b91d09d79f073a54871221f197a0bcf3aa2..2c9f50fd20d99f2adce2a1fbe4289cf7aeea2ba4 100644
> --- a/drivers/media/i2c/ov5647.c
> +++ b/drivers/media/i2c/ov5647.c
> @@ -343,6 +343,8 @@ static struct regval_list ov5647_2x2binned_10bpp[] = {
>  	{0x3036, 0x62},
>  	{0x303c, 0x11},
>  	{0x3106, 0xf5},
> +	{0x3821, 0x01},
> +	{0x3820, 0x41},
>  	{0x3827, 0xec},
>  	{0x370c, 0x03},
>  	{0x3612, 0x59},
> @@ -415,8 +417,6 @@ static struct regval_list ov5647_2x2binned_10bpp[] = {
>  	{0x4837, 0x16},
>  	{0x4800, 0x24},
>  	{0x3503, 0x03},
> -	{0x3820, 0x41},
> -	{0x3821, 0x01},
>  	{0x350a, 0x00},
>  	{0x350b, 0x10},
>  	{0x3500, 0x00},
> @@ -429,20 +429,27 @@ static struct regval_list ov5647_2x2binned_10bpp[] = {
>  static struct regval_list ov5647_640x480_10bpp[] = {
>  	{0x0100, 0x00},
>  	{0x0103, 0x01},
> -	{0x3035, 0x11},
> +	{0x3034, 0x1a},
> +	{0x3035, 0x21},

Why has the register value changed ?

>  	{0x3036, 0x46},
>  	{0x303c, 0x11},
> +	{0x3106, 0xf5},
>  	{0x3821, 0x01},
>  	{0x3820, 0x41},
> +	{0x3827, 0xec},
>  	{0x370c, 0x03},
>  	{0x3612, 0x59},
>  	{0x3618, 0x00},
>  	{0x5000, 0x06},
>  	{0x5003, 0x08},
>  	{0x5a00, 0x08},
> -	{0x3000, 0xff},
> -	{0x3001, 0xff},
> -	{0x3002, 0xff},
> +	{0x3000, 0x00},
> +	{0x3001, 0x00},
> +	{0x3002, 0x00},

Uh these ones changed as well, is it intentional ?

> +	{0x3016, 0x08},
> +	{0x3017, 0xe0},
> +	{0x3018, 0x44},
> +	{0x301c, 0xf8},
>  	{0x301d, 0xf0},
>  	{0x3a18, 0x00},
>  	{0x3a19, 0xf8},
> @@ -468,6 +475,7 @@ static struct regval_list ov5647_640x480_10bpp[] = {
>  	{0x3632, 0xe2},
>  	{0x3633, 0x23},
>  	{0x3634, 0x44},
> +	{0x3636, 0x06},
>  	{0x3620, 0x64},
>  	{0x3621, 0xe0},
>  	{0x3600, 0x37},
> @@ -496,19 +504,6 @@ static struct regval_list ov5647_640x480_10bpp[] = {
>  	{0x4001, 0x02},
>  	{0x4004, 0x02},
>  	{0x4000, 0x09},
> -	{0x3000, 0x00},
> -	{0x3001, 0x00},
> -	{0x3002, 0x00},

Ah, that's why!

> -	{0x3017, 0xe0},
> -	{0x301c, 0xfc},
> -	{0x3636, 0x06},
> -	{0x3016, 0x08},
> -	{0x3827, 0xec},
> -	{0x3018, 0x44},
> -	{0x3035, 0x21},
> -	{0x3106, 0xf5},
> -	{0x3034, 0x1a},
> -	{0x301c, 0xf8},

Nice tidy up
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

>  	{0x4800, 0x34},
>  	{0x3503, 0x03},
>  	{0x0100, 0x01},
>
> --
> 2.51.0
>