Skip to contentSkip to conversation

media: i2c: ov02c10: Narrow chip id check down to match ov02c chips only

PATCH In review Vladimir Zapolskiy 3 participants 5 messages Jun 21 – Sep 29

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: i2c: ov02c10: Narrow chip id check down to match ov02c chips only

Originally a chip id check in the driver's probe function is done for any OmniVision "ov02" sensors, but is too wide, since there are at least "ov02a", "ov02b", "ov02c", "ov02e", "ov02g", "ov02k" and likely even more families of sensors with similar names, thus the check for id shall be more specific and match "ov02c" exclusively and expectedly.

---
 drivers/media/i2c/ov02c10.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov02c10.c +2 -2
index cf93d36032e1..b36da75d7dfa 100644
@@ -18,8 +18,8 @@
 #define OV02C10_MCLK			19200000
 #define OV02C10_RGB_DEPTH		10
 
-#define OV02C10_REG_CHIP_ID		CCI_REG16(0x300a)
-#define OV02C10_CHIP_ID			0x5602
+#define OV02C10_REG_CHIP_ID		CCI_REG24(0x300a)
+#define OV02C10_CHIP_ID			0x560243
 
 #define OV02C10_REG_STREAM_CONTROL	CCI_REG8(0x0100)
 
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Vladimir,

Quoted 16 lines

Originally a chip id check in the driver's probe function is done for any OmniVision "ov02" sensors, but is too wide, since there are at least "ov02a", "ov02b", "ov02c", "ov02e", "ov02g", "ov02k" and likely even more families of sensors with similar names, thus the check for id shall be more specific and match "ov02c" exclusively and expectedly.

---
 drivers/media/i2c/ov02c10.c | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov02c10.c +0 -0
index cf93d36032e1..b36da75d7dfa 100644

drivers/media/i2c/ov02c10.c line 22

Quoted 7 lines
drivers/media/i2c/ov02c10.c +2 -2
@@ -18,8 +18,8 @@
  #define OV02C10_MCLK                   19200000
  #define OV02C10_RGB_DEPTH              10
 
-#define OV02C10_REG_CHIP_ID            CCI_REG16(0x300a)
-#define OV02C10_CHIP_ID                        0x5602
+#define OV02C10_REG_CHIP_ID            CCI_REG24(0x300a)
+#define OV02C10_CHIP_ID                        0x560243

Best Regards,
Tarang

#2 lore raw
In reply to Vladimir Zapolskiy

Hi Sakari,

Quoted 16 lines · Vladimir Zapolskiy

Originally a chip id check in the driver's probe function is done for any OmniVision "ov02" sensors, but is too wide, since there are at least "ov02a", "ov02b", "ov02c", "ov02e", "ov02g", "ov02k" and likely even more families of sensors with similar names, thus the check for id shall be more specific and match "ov02c" exclusively and expectedly.

---
  drivers/media/i2c/ov02c10.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov02c10.c +0 -0
index cf93d36032e1..b36da75d7dfa 100644

drivers/media/i2c/ov02c10.c line 25

Quoted 10 lines
drivers/media/i2c/ov02c10.c +2 -2
@@ -18,8 +18,8 @@
  #define OV02C10_MCLK			19200000
  #define OV02C10_RGB_DEPTH		10
 
-#define OV02C10_REG_CHIP_ID		CCI_REG16(0x300a)
-#define OV02C10_CHIP_ID			0x5602
+#define OV02C10_REG_CHIP_ID		CCI_REG24(0x300a)
+#define OV02C10_CHIP_ID			0x560243
 
  #define OV02C10_REG_STREAM_CONTROL	CCI_REG8(0x0100)
 

is there anything else to be done to get this proposed change accepted?

Signature · 2 lines
Best wishes,
Vladimir
#3 lore raw
In reply to Vladimir Zapolskiy

Hi Sakari,

Quoted 16 lines · Vladimir Zapolskiy

Originally a chip id check in the driver's probe function is done for any OmniVision "ov02" sensors, but is too wide, since there are at least "ov02a", "ov02b", "ov02c", "ov02e", "ov02g", "ov02k" and likely even more families of sensors with similar names, thus the check for id shall be more specific and match "ov02c" exclusively and expectedly.

---
  drivers/media/i2c/ov02c10.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov02c10.c +0 -0
index cf93d36032e1..b36da75d7dfa 100644

drivers/media/i2c/ov02c10.c line 25

Quoted 10 lines
drivers/media/i2c/ov02c10.c +2 -2
@@ -18,8 +18,8 @@
  #define OV02C10_MCLK			19200000
  #define OV02C10_RGB_DEPTH		10
 
-#define OV02C10_REG_CHIP_ID		CCI_REG16(0x300a)
-#define OV02C10_CHIP_ID			0x5602
+#define OV02C10_REG_CHIP_ID		CCI_REG24(0x300a)
+#define OV02C10_CHIP_ID			0x560243
 
  #define OV02C10_REG_STREAM_CONTROL	CCI_REG8(0x0100)
 

can you please start review of this trivial and long-standing change?

Thank you in advance.

Signature · 2 lines
Best wishes,
Vladimir
maintainer
#4 lore raw

Hi Vladimir,

Quoted 29 lines · Vladimir Zapolskiy

Hi Sakari,

Quoted 16 lines · Vladimir Zapolskiy

Originally a chip id check in the driver's probe function is done for any OmniVision "ov02" sensors, but is too wide, since there are at least "ov02a", "ov02b", "ov02c", "ov02e", "ov02g", "ov02k" and likely even more families of sensors with similar names, thus the check for id shall be more specific and match "ov02c" exclusively and expectedly.

---
  drivers/media/i2c/ov02c10.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov02c10.c +0 -0
index cf93d36032e1..b36da75d7dfa 100644

drivers/media/i2c/ov02c10.c line 22

Quoted 7 lines
drivers/media/i2c/ov02c10.c +2 -2
@@ -18,8 +18,8 @@
  #define OV02C10_MCLK			19200000
  #define OV02C10_RGB_DEPTH		10
-#define OV02C10_REG_CHIP_ID		CCI_REG16(0x300a)
-#define OV02C10_CHIP_ID			0x5602
+#define OV02C10_REG_CHIP_ID		CCI_REG24(0x300a)
+#define OV02C10_CHIP_ID			0x560243
  #define OV02C10_REG_STREAM_CONTROL	CCI_REG8(0x0100)

can you please start review of this trivial and long-standing change?

Quoted 1 line

Thank you in advance.

Thanks for the ping. I've queued it for 7.4.

Signature · 3 lines
Kind regards,

Sakari Ailus