[PATCH 2/2] media: sony-starvis2: Add support for IMX676

From: Jai Luthra

Date: Thu Oct 22 2026 - 07:00:02 EST


The IMX676 is a 12.63MPix Starvis 2 sensor, so add support for it.

Signed-off-by: Jai Luthra <jai.luthra@xxxxxxxxxxxxxxxx>
---
drivers/media/i2c/sony-starvis2.c | 195 ++++++++++++++++++++++++++++++
1 file changed, 195 insertions(+)

diff --git a/drivers/media/i2c/sony-starvis2.c b/drivers/media/i2c/sony-starvis2.c
index e89aa1a7d5eb..b99835ab03e2 100644
--- a/drivers/media/i2c/sony-starvis2.c
+++ b/drivers/media/i2c/sony-starvis2.c
@@ -1372,6 +1372,178 @@ static const struct starvis2_variant imx585_variant_def = {
.shr_min = 8,
};

+static const struct cci_reg_sequence imx676_common_regs[] = {
+ { CCI_REG8(0x304e), 0x04 },
+ { CCI_REG8(0x3148), 0x00 },
+ { CCI_REG8(0x3460), 0x22 },
+ { CCI_REG8(0x347b), 0x02 },
+ { CCI_REG8(0x355a), 0x1c },
+ { CCI_REG8(0x3a3c), 0x0f },
+ { CCI_REG8(0x3a44), 0x0b },
+ { CCI_REG8(0x3a76), 0xb5 },
+ { CCI_REG8(0x3a77), 0x00 },
+ { CCI_REG8(0x3a78), 0x03 },
+ { CCI_REG8(0x3b22), 0x04 },
+ { CCI_REG8(0x3b23), 0x44 },
+ { CCI_REG8(0x3c03), 0x04 },
+ { CCI_REG8(0x3c04), 0x04 },
+ { CCI_REG8(0x3c0a), 0x03 },
+ { CCI_REG8(0x3c0b), 0x03 },
+ { CCI_REG8(0x3c0c), 0x03 },
+ { CCI_REG8(0x3c0d), 0x03 },
+ { CCI_REG8(0x3c0e), 0x03 },
+ { CCI_REG8(0x3c0f), 0x03 },
+ { CCI_REG8(0x3c30), 0x73 },
+ { CCI_REG8(0x3c34), 0x6c },
+ { CCI_REG8(0x3c3c), 0x20 },
+ { CCI_REG8(0x3cb8), 0x00 },
+ { CCI_REG8(0x3cba), 0xff },
+ { CCI_REG8(0x3cbb), 0x03 },
+ { CCI_REG8(0x3cbc), 0xff },
+ { CCI_REG8(0x3cbd), 0x03 },
+ { CCI_REG8(0x3cc2), 0xff },
+ { CCI_REG8(0x3cc3), 0x03 },
+ { CCI_REG8(0x3cc8), 0xff },
+ { CCI_REG8(0x3cc9), 0x03 },
+ { CCI_REG8(0x3cca), 0x00 },
+ { CCI_REG8(0x3cce), 0xff },
+ { CCI_REG8(0x3ccf), 0x03 },
+ { CCI_REG8(0x3cd0), 0xff },
+ { CCI_REG8(0x3cd1), 0x03 },
+ { CCI_REG8(0x3e00), 0x1e },
+ { CCI_REG8(0x3e02), 0x04 },
+ { CCI_REG8(0x3e03), 0x00 },
+ { CCI_REG8(0x3e20), 0x04 },
+ { CCI_REG8(0x3e21), 0x00 },
+ { CCI_REG8(0x3e22), 0x1e },
+ { CCI_REG8(0x3e24), 0xb6 },
+ { CCI_REG8(0x4490), 0x07 },
+ { CCI_REG8(0x4494), 0x10 },
+ { CCI_REG8(0x4495), 0x00 },
+ { CCI_REG8(0x4496), 0xb2 },
+ { CCI_REG8(0x4497), 0x00 },
+ { CCI_REG8(0x4498), 0x4c },
+ { CCI_REG8(0x449a), 0x4b },
+ { CCI_REG8(0x449c), 0x4b },
+ { CCI_REG8(0x449e), 0x49 },
+ { CCI_REG8(0x44a0), 0x33 },
+ { CCI_REG8(0x44a2), 0x10 },
+ { CCI_REG8(0x44a4), 0x10 },
+ { CCI_REG8(0x44a6), 0x10 },
+ { CCI_REG8(0x44a8), 0x4b },
+ { CCI_REG8(0x44aa), 0x4b },
+ { CCI_REG8(0x44ac), 0x4b },
+ { CCI_REG8(0x44ae), 0x46 },
+ { CCI_REG8(0x44b0), 0x33 },
+ { CCI_REG8(0x44b2), 0x10 },
+ { CCI_REG8(0x44b4), 0x10 },
+ { CCI_REG8(0x44b6), 0x10 },
+ { CCI_REG8(0x44b8), 0x42 },
+ { CCI_REG8(0x44ba), 0x42 },
+ { CCI_REG8(0x44bc), 0x42 },
+ { CCI_REG8(0x44be), 0x42 },
+ { CCI_REG8(0x44c0), 0x33 },
+ { CCI_REG8(0x44c2), 0x10 },
+ { CCI_REG8(0x44c4), 0x10 },
+ { CCI_REG8(0x44c6), 0x10 },
+ { CCI_REG8(0x44c8), 0xe7 },
+ { CCI_REG8(0x44ca), 0xe2 },
+ { CCI_REG8(0x44cc), 0xe2 },
+ { CCI_REG8(0x44ce), 0xdd },
+ { CCI_REG8(0x44d0), 0xdd },
+ { CCI_REG8(0x44d2), 0xb2 },
+ { CCI_REG8(0x44d4), 0xb2 },
+ { CCI_REG8(0x44d6), 0xb2 },
+ { CCI_REG8(0x44d8), 0xe1 },
+ { CCI_REG8(0x44da), 0xe1 },
+ { CCI_REG8(0x44dc), 0xe1 },
+ { CCI_REG8(0x44de), 0xdd },
+ { CCI_REG8(0x44e0), 0xdd },
+ { CCI_REG8(0x44e2), 0xb2 },
+ { CCI_REG8(0x44e4), 0xb2 },
+ { CCI_REG8(0x44e6), 0xb2 },
+ { CCI_REG8(0x44e8), 0xdd },
+ { CCI_REG8(0x44ea), 0xdd },
+ { CCI_REG8(0x44ec), 0xdd },
+ { CCI_REG8(0x44ee), 0xdd },
+ { CCI_REG8(0x44f0), 0xdd },
+ { CCI_REG8(0x44f2), 0xb2 },
+ { CCI_REG8(0x44f4), 0xb2 },
+ { CCI_REG8(0x44f6), 0xb2 },
+ { CCI_REG8(0x4538), 0x15 },
+ { CCI_REG8(0x4539), 0x15 },
+ { CCI_REG8(0x453a), 0x15 },
+ { CCI_REG8(0x4544), 0x15 },
+ { CCI_REG8(0x4545), 0x15 },
+ { CCI_REG8(0x4546), 0x15 },
+ { CCI_REG8(0x4550), 0x10 },
+ { CCI_REG8(0x4551), 0x10 },
+ { CCI_REG8(0x4552), 0x10 },
+ { CCI_REG8(0x4553), 0x10 },
+ { CCI_REG8(0x4554), 0x10 },
+ { CCI_REG8(0x4555), 0x10 },
+ { CCI_REG8(0x4556), 0x10 },
+ { CCI_REG8(0x4557), 0x10 },
+ { CCI_REG8(0x4558), 0x10 },
+ { CCI_REG8(0x455c), 0x10 },
+ { CCI_REG8(0x455d), 0x10 },
+ { CCI_REG8(0x455e), 0x10 },
+ { CCI_REG8(0x455f), 0x10 },
+ { CCI_REG8(0x4560), 0x10 },
+ { CCI_REG8(0x4561), 0x10 },
+ { CCI_REG8(0x4562), 0x10 },
+ { CCI_REG8(0x4563), 0x10 },
+ { CCI_REG8(0x4564), 0x10 },
+ { CCI_REG8(0x4604), 0x04 },
+ { CCI_REG8(0x4608), 0x22 },
+ { CCI_REG8(0x479c), 0x04 },
+ { CCI_REG8(0x47a0), 0x22 },
+ { CCI_REG8(0x4e3c), 0x07 },
+ { STARVIS2_REG_WDMODE, 0x00 },
+ { STARVIS2_REG_MDBIT, 0x01 },
+ { STARVIS2_REG_XXS_DRV, 0x00 },
+};
+
+static const u16 imx676_min_hmax_2lane[] = {
+ [STARVIS2_LINK_FREQ_297MHZ] = 2744,
+ [STARVIS2_LINK_FREQ_360MHZ] = 2277,
+ [STARVIS2_LINK_FREQ_445MHZ] = 1854,
+ [STARVIS2_LINK_FREQ_594MHZ] = 1410,
+ [STARVIS2_LINK_FREQ_720MHZ] = 1176,
+ [STARVIS2_LINK_FREQ_891MHZ] = 965,
+ [STARVIS2_LINK_FREQ_1039MHZ] = 838,
+ [STARVIS2_LINK_FREQ_1188MHZ] = 743,
+};
+
+const struct starvis2_variant imx676_variant_def = {
+ .name = "imx676",
+ .id_reg = CCI_REG16_LE(0x4d12),
+ .id_mask = 0xfff,
+ .id_value = 0x676,
+ .native_area = {
+ .top = 0,
+ .left = 0,
+ .width = 3553,
+ .height = 3577,
+ },
+ .active_area = {
+ .top = 24,
+ .left = 0,
+ .width = 3552,
+ .height = 3552,
+ },
+ .pixel_rate = 594000000,
+ .pix_per_clk = 8,
+ .common_regs = imx676_common_regs,
+ .num_common_regs = ARRAY_SIZE(imx676_common_regs),
+ .vmax_default = 3940,
+ .hmax_min_link_freq = imx676_min_hmax_2lane,
+ .hmax_min_pixel_array = 454,
+ .exposure_min = 2,
+ .exposure_step = 2,
+ .shr_min = 8,
+};
+
struct starvis2_model_info {
enum starvis2_type type;
const u32 *codes;
@@ -1482,6 +1654,26 @@ static const struct starvis2_model_info imx585_autodetect_info = {
.auto_detect_mono = &imx585_aamj_info,
};

+static const struct starvis2_model_info imx676_aacr_info = {
+ .type = STARVIS2_COLOR,
+ .codes = codes_bayer,
+ .num_codes = ARRAY_SIZE(codes_bayer),
+ .variant = &imx676_variant_def,
+};
+
+static const struct starvis2_model_info imx676_aamr_info = {
+ .type = STARVIS2_MONOCHROME,
+ .codes = codes_monochrome,
+ .num_codes = ARRAY_SIZE(codes_monochrome),
+ .variant = &imx676_variant_def,
+};
+
+static const struct starvis2_model_info imx676_autodetect_info = {
+ .variant = &imx676_variant_def,
+ .auto_detect_colour = &imx676_aacr_info,
+ .auto_detect_mono = &imx676_aamr_info,
+};
+
static const char * const starvis2_supply_name[] = {
"avdd", /* Analog (3.3V) supply */
"dvdd", /* Digital Core (1.1V) supply */
@@ -2328,6 +2520,8 @@ static const struct of_device_id starvis2_of_match[] = {
{ .compatible = "sony,imx662-aaqr", .data = &imx662_aaqr_info },
{ .compatible = "sony,imx675-aamr", .data = &imx675_aamr_info },
{ .compatible = "sony,imx675-aaqr", .data = &imx675_aaqr_info },
+ { .compatible = "sony,imx676-aamr", .data = &imx676_aamr_info },
+ { .compatible = "sony,imx676-aacr", .data = &imx676_aacr_info },
{ .compatible = "sony,imx678-aamr", .data = &imx678_aamr_info },
{ .compatible = "sony,imx678-aaqr", .data = &imx678_aaqr_info },
{ .compatible = "sony,imx832-amr", .data = &imx832_amr_info },
@@ -2336,6 +2530,7 @@ static const struct of_device_id starvis2_of_match[] = {
{ .compatible = "sony,imx585", .data = &imx585_autodetect_info },
{ .compatible = "sony,imx662", .data = &imx662_autodetect_info },
{ .compatible = "sony,imx675", .data = &imx675_autodetect_info },
+ { .compatible = "sony,imx676", .data = &imx676_autodetect_info },
{ .compatible = "sony,imx678", .data = &imx678_autodetect_info },
{ .compatible = "sony,imx832", .data = &imx832_autodetect_info },
{ /* sentinel */ }
--
2.55.0