[PATCH v6 16/18] media: sony-starvis2: Parameterise the mono ID register

From: Dave Stevenson

Date: Thu Oct 22 2026 - 13:43:29 EST


All sensors to this point have used register 0x4d18[0]
to signal whether it is a mono or colour module.
IMX585 uses a different register (0x5a18[0]), so parameterise
which register to use.

Signed-off-by: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx>
---
drivers/media/i2c/sony-starvis2.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/sony-starvis2.c b/drivers/media/i2c/sony-starvis2.c
index 15d5a066a556..b526ea3ce2e4 100644
--- a/drivers/media/i2c/sony-starvis2.c
+++ b/drivers/media/i2c/sony-starvis2.c
@@ -97,7 +97,6 @@
#define STARVIS2_REG_WINMODEV CCI_REG8(0x3021)

/* Sensor Identification */
-#define STARVIS2_REG_MONOCHROME CCI_REG8(0x4d18)
#define STARVIS2_TYPE BIT(0)
#define STARVIS2_MODULE_ID_DELAY 80000

@@ -629,6 +628,7 @@ struct starvis2_variant {
u32 id_mask;
u32 id_value;
u32 interface_sel_reg;
+ u32 mono_id_reg;
struct v4l2_rect native_area;
struct v4l2_rect active_area;
u64 pixel_rate;
@@ -649,6 +649,7 @@ static const struct starvis2_variant imx678_variant_def = {
.id_mask = 0x3ff,
.id_value = 0x2a6,
.interface_sel_reg = CCI_REG8(0x4e3c),
+ .mono_id_reg = CCI_REG8(0x4d18),
.native_area = {
.top = 0,
.left = 0,
@@ -782,6 +783,7 @@ static const struct starvis2_variant imx662_variant_def = {
.id_reg = CCI_REG16_LE(0x4d1c),
.id_mask = 0x3ff,
.id_value = 0x296,
+ .mono_id_reg = CCI_REG8(0x4d18),
.native_area = {
.top = 0,
.left = 0,
@@ -972,6 +974,7 @@ static const struct starvis2_variant imx675_variant_def = {
.id_reg = CCI_REG16_LE(0x4d12),
.id_mask = 0xfff,
.id_value = 0x576,
+ .mono_id_reg = CCI_REG8(0x4d18),
.native_area = {
.top = 0,
.left = 0,
@@ -1068,6 +1071,7 @@ static const struct starvis2_variant imx832_variant_def = {
.id_reg = CCI_REG16_LE(0x4d1c),
.id_mask = 0x3ff,
.id_value = 0x340,
+ .mono_id_reg = CCI_REG8(0x4d18),
.native_area = {
.top = 0,
.left = 0,
@@ -1675,7 +1679,7 @@ static int starvis2_identify_model(struct starvis2 *starvis2)
goto err_standby;
}

- cci_read(starvis2->cci, STARVIS2_REG_MONOCHROME, &val, &ret);
+ cci_read(starvis2->cci, variant->mono_id_reg, &val, &ret);

if (ret) {
dev_err(&client->dev,

--
2.34.1