Skip to contentSkip to conversation

media: ov01a10: Fix test pattern assignment

PATCH NAK Sakari Ailus 4 participants 6 messages Jan 13 – Jan 14

Subsystems (3)
lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

PATCH 1/1 media: ov01a10: Fix test pattern assignment

The test patterns of the test pattern menu control start from 1 whereas register values start from 0. Fix this.

---
This goes on top of my recent ov01a10 series.

 drivers/media/i2c/ov01a10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov01a10.c +1 -1
index 3dbc77430e0e..0a66d8974974 100644
@@ -319,7 +319,7 @@ static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain)
 static int ov01a10_test_pattern(struct ov01a10 *ov01a10, u32 pattern)
 {
 	if (pattern)
-		pattern |= OV01A10_TEST_PATTERN_ENABLE;
+		pattern = (pattern - 1) | OV01A10_TEST_PATTERN_ENABLE;
 
 	return cci_write(ov01a10->regmap, OV01A10_REG_TEST_PATTERN, pattern,
 			 NULL);
Signature · 1 line
2.47.3
#1 lore raw

Hi,

Quoted 15 lines · Sakari Ailus

The test patterns of the test pattern menu control start from 1 whereas register values start from 0. Fix this.

---
This goes on top of my recent ov01a10 series.

 drivers/media/i2c/ov01a10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov01a10.c +0 -0
index 3dbc77430e0e..0a66d8974974 100644

drivers/media/i2c/ov01a10.c static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain) · line 322

Quoted 5 lines
drivers/media/i2c/ov01a10.c +1 -1
@@ -319,7 +319,7 @@ static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain)
 static int ov01a10_test_pattern(struct ov01a10 *ov01a10, u32 pattern)
 {
 	if (pattern)
-		pattern |= OV01A10_TEST_PATTERN_ENABLE;
+		pattern = (pattern - 1) | OV01A10_TEST_PATTERN_ENABLE;

Nack, copy paste of my reply to Bingbu's email where this change was requested:

This was "pattern - 1" in the original v1 patch-set, the - 1 is dropped deliberately c2 because testing has shown that there is no difference between writing "0 | OV01A10_TEST_PATTERN_ENABLE" vs
"1 | OV01A10_TEST_PATTERN_ENABLE" to the register.

See the discussion here:

https://lore.kernel.org/linux-media/jgzovuqvd5csxwzmzf5asri7xvftoyb4lqyywtfdsrsgdvwz7i@neqszepmzw3m/

Please drop this patch.

Regards,

Hans

author maintainer
#2 lore raw
Quoted 31 lines · Hans de Goede

Hi,

Quoted 15 lines · Sakari Ailus

The test patterns of the test pattern menu control start from 1 whereas register values start from 0. Fix this.

---
This goes on top of my recent ov01a10 series.

 drivers/media/i2c/ov01a10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov01a10.c +0 -0
index 3dbc77430e0e..0a66d8974974 100644

drivers/media/i2c/ov01a10.c static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain) · line 322

Quoted 5 lines
drivers/media/i2c/ov01a10.c +1 -1
@@ -319,7 +319,7 @@ static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain)
 static int ov01a10_test_pattern(struct ov01a10 *ov01a10, u32 pattern)
 {
 	if (pattern)
-		pattern |= OV01A10_TEST_PATTERN_ENABLE;
+		pattern = (pattern - 1) | OV01A10_TEST_PATTERN_ENABLE;

Nack, copy paste of my reply to Bingbu's email where this change was requested:

This was "pattern - 1" in the original v1 patch-set, the - 1 is dropped deliberately c2 because testing has shown that there is no difference between writing "0 | OV01A10_TEST_PATTERN_ENABLE" vs
"1 | OV01A10_TEST_PATTERN_ENABLE" to the register.

Quoted 5 lines

See the discussion here:

https://lore.kernel.org/linux-media/jgzovuqvd5csxwzmzf5asri7xvftoyb4lqyywtfdsrsgdvwz7i@neqszepmzw3m/

Please drop this patch.

Ack; done.

Signature · 1 line
Sakari Ailus
#3 lore raw
In reply to Hans de Goede

Hans,

Quoted 26 lines · Hans de Goede

Hi,

Quoted 15 lines · Sakari Ailus

The test patterns of the test pattern menu control start from 1 whereas register values start from 0. Fix this.

---
This goes on top of my recent ov01a10 series.

 drivers/media/i2c/ov01a10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov01a10.c +0 -0
index 3dbc77430e0e..0a66d8974974 100644

drivers/media/i2c/ov01a10.c static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain) · line 322

Quoted 5 lines
drivers/media/i2c/ov01a10.c +1 -1
@@ -319,7 +319,7 @@ static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain)
 static int ov01a10_test_pattern(struct ov01a10 *ov01a10, u32 pattern)
 {
 	if (pattern)
-		pattern |= OV01A10_TEST_PATTERN_ENABLE;
+		pattern = (pattern - 1) | OV01A10_TEST_PATTERN_ENABLE;

Nack, copy paste of my reply to Bingbu's email where this change was requested:

Quoted 4 lines

This was "pattern - 1" in the original v1 patch-set, the - 1 is dropped deliberately c2 because testing has shown that there is no difference between writing "0 | OV01A10_TEST_PATTERN_ENABLE" vs
"1 | OV01A10_TEST_PATTERN_ENABLE" to the register.

Hans,

Thanks for the explanation.

From the specification, color bar type1 is not same type2, type1 is a standard color bar, type2 is a top-bottom darker color bar, type3 is right-left darker one.

Mehdi, did you confirm the description in specification is wrong?

Quoted 15 lines

See the discussion here:

https://lore.kernel.org/linux-media/jgzovuqvd5csxwzmzf5asri7xvftoyb4lqyywtfdsrsgdvwz7i@neqszepmzw3m/

Please drop this patch.

Regards,

Hans

Signature · 2 lines
Best regards,
Bingbu Cao
#4 lore raw

Hi Bingbu,

Quoted 36 lines · Bingbu Cao

Hans,

Quoted 26 lines · Hans de Goede

Hi,

Quoted 15 lines · Sakari Ailus

The test patterns of the test pattern menu control start from 1 whereas register values start from 0. Fix this.

---
This goes on top of my recent ov01a10 series.

 drivers/media/i2c/ov01a10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov01a10.c +0 -0
index 3dbc77430e0e..0a66d8974974 100644

drivers/media/i2c/ov01a10.c static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain) · line 322

Quoted 5 lines
drivers/media/i2c/ov01a10.c +1 -1
@@ -319,7 +319,7 @@ static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain)
 static int ov01a10_test_pattern(struct ov01a10 *ov01a10, u32 pattern)
 {
 	if (pattern)
-		pattern |= OV01A10_TEST_PATTERN_ENABLE;
+		pattern = (pattern - 1) | OV01A10_TEST_PATTERN_ENABLE;

Nack, copy paste of my reply to Bingbu's email where this change was requested:

Quoted 4 lines

This was "pattern - 1" in the original v1 patch-set, the - 1 is dropped deliberately c2 because testing has shown that there is no difference between writing "0 | OV01A10_TEST_PATTERN_ENABLE" vs
"1 | OV01A10_TEST_PATTERN_ENABLE" to the register.

Hans,

Quoted 7 lines

Thanks for the explanation.

From the specification, color bar type1 is not same type2, type1 is a standard color bar, type2 is a top-bottom darker color bar, type3 is right-left darker one.

Mehdi, did you confirm the description in specification is wrong?

Yes Mehdi did confirm this, see:

https://lore.kernel.org/linux-media/jgzovuqvd5csxwzmzf5asri7xvftoyb4lqyywtfdsrsgdvwz7i@neqszepmzw3m/

Here is a table of register values ( + OV01A10_TEST_PATTERN_ENABLE) + test-pattern seen in testing:

0: Standard Color Bar
1: Standard Color Bar
2: Left-Right Darker Color Bar 3: Bottom-Top Darker Color Bar

Regards,

Hans

#5 lore raw

Hi Hans, Bingbu and Sakari,

Quoted 51 lines · Hans de Goede

Hi Bingbu,

Quoted 36 lines · Bingbu Cao

Hans,

Quoted 26 lines · Hans de Goede

Hi,

Quoted 15 lines · Sakari Ailus

The test patterns of the test pattern menu control start from 1 whereas register values start from 0. Fix this.

---
This goes on top of my recent ov01a10 series.

 drivers/media/i2c/ov01a10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov01a10.c +0 -0
index 3dbc77430e0e..0a66d8974974 100644

drivers/media/i2c/ov01a10.c static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain) · line 322

Quoted 5 lines
drivers/media/i2c/ov01a10.c +1 -1
@@ -319,7 +319,7 @@ static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain)
 static int ov01a10_test_pattern(struct ov01a10 *ov01a10, u32 pattern)
 {
 	if (pattern)
-		pattern |= OV01A10_TEST_PATTERN_ENABLE;
+		pattern = (pattern - 1) | OV01A10_TEST_PATTERN_ENABLE;

Nack, copy paste of my reply to Bingbu's email where this change was requested:

Quoted 4 lines

This was "pattern - 1" in the original v1 patch-set, the - 1 is dropped deliberately c2 because testing has shown that there is no difference between writing "0 | OV01A10_TEST_PATTERN_ENABLE" vs
"1 | OV01A10_TEST_PATTERN_ENABLE" to the register.

Hans,

Quoted 7 lines

Thanks for the explanation.

From the specification, color bar type1 is not same type2, type1 is a standard color bar, type2 is a top-bottom darker color bar, type3 is right-left darker one.

Mehdi, did you confirm the description in specification is wrong?

Yes Mehdi did confirm this, see:

https://lore.kernel.org/linux-media/jgzovuqvd5csxwzmzf5asri7xvftoyb4lqyywtfdsrsgdvwz7i@neqszepmzw3m/

Quoted 7 lines

Here is a table of register values ( + OV01A10_TEST_PATTERN_ENABLE) + test-pattern seen in testing:

0: Standard Color Bar
1: Standard Color Bar
2: Left-Right Darker Color Bar 3: Bottom-Top Darker Color Bar

Yes I confirm this when testing/reviewing the series from Hans.

--
Kind Regards
Mehdi Djait