From: Dave Stevenson <dave.stevenson@raspberrypi.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>,
Jai Luthra <jai.luthra@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Alexander Shiyan <eagle.alexander923@gmail.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org,
Dave Stevenson <dave.stevenson@raspberrypi.com>
Subject: [PATCH v2 13/13] media: sony-starvis2: Add support for IMX585
Date: Tue, 13 Oct 2026 16:17:12 +0100 [thread overview]
Message-ID: <20261013-media-starvis2-v2-13-3670722d250a@raspberrypi.com> (raw)
In-Reply-To: <20261013-media-starvis2-v2-0-3670722d250a@raspberrypi.com>
IMX585 is an 8MPix Starvis 2 sensor, so add support for it.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/media/i2c/sony-starvis2.c | 302 ++++++++++++++++++++++++++++++++++++++
1 file changed, 302 insertions(+)
diff --git a/drivers/media/i2c/sony-starvis2.c b/drivers/media/i2c/sony-starvis2.c
index 1ce2b86c57ac..c9a3dd4fe529 100644
--- a/drivers/media/i2c/sony-starvis2.c
+++ b/drivers/media/i2c/sony-starvis2.c
@@ -14,6 +14,8 @@
* pixels.
* IMX832: Diagonal 6.45mm (Type 1/2.8) CMOS image sensor with 2.12 M effective
* pixels.
+ * IMX585: Diagonal 12.84 mm (Type 1/1.2) CMOS image sensor with 8.40 M effective
+ * pixels.
*
* Copyright (C) 2026 Ideas On Board Oy.
*
@@ -1078,6 +1080,283 @@ const struct starvis2_variant imx832_variant_def = {
.hmax_min_pixel_array = 990,
};
+static const struct cci_reg_sequence imx585_common_regs[] = {
+ { STARVIS2_REG_THIN_V_EN, 0x00 },
+ { STARVIS2_REG_VCMODE, 0x01 },
+ { CCI_REG8(0x306b), 0x00 },
+ { STARVIS2_REG_GAIN_PGC_FIDMD, 0x01 },
+
+ { CCI_REG8(0x3460), 0x21 },
+ { CCI_REG8(0x3478), 0xa1 },
+ { CCI_REG8(0x347c), 0x01 },
+ { CCI_REG8(0x3480), 0x01 },
+ { CCI_REG8(0x3930), 0x0c },
+ { CCI_REG8(0x3931), 0x01 },
+ { CCI_REG8(0x3a4c), 0x39 },
+ { CCI_REG8(0x3a4d), 0x01 },
+ { CCI_REG8(0x3a4e), 0x14 },
+ { CCI_REG8(0x3a50), 0x48 },
+ { CCI_REG8(0x3a51), 0x01 },
+ { CCI_REG8(0x3a52), 0x14 },
+ { CCI_REG8(0x3a56), 0x00 },
+ { CCI_REG8(0x3a5a), 0x00 },
+ { CCI_REG8(0x3a5e), 0x00 },
+ { CCI_REG8(0x3a62), 0x00 },
+ { CCI_REG8(0x3a6a), 0x20 },
+ { CCI_REG8(0x3a6c), 0x42 },
+ { CCI_REG8(0x3a6e), 0xa0 },
+ { CCI_REG8(0x3b2c), 0x0c },
+ { CCI_REG8(0x3b30), 0x1c },
+ { CCI_REG8(0x3b34), 0x0c },
+ { CCI_REG8(0x3b38), 0x1c },
+ { CCI_REG8(0x3ba0), 0x0c },
+ { CCI_REG8(0x3ba4), 0x1c },
+ { CCI_REG8(0x3ba8), 0x0c },
+ { CCI_REG8(0x3bac), 0x1c },
+ { CCI_REG8(0x3d3c), 0x11 },
+ { CCI_REG8(0x3d46), 0x0b },
+ { CCI_REG8(0x3de0), 0x3f },
+ { CCI_REG8(0x3de1), 0x08 },
+ { CCI_REG8(0x3e10), 0x10 },
+ { CCI_REG8(0x3e14), 0x87 },
+ { CCI_REG8(0x3e16), 0x91 },
+ { CCI_REG8(0x3e18), 0x91 },
+ { CCI_REG8(0x3e1a), 0x87 },
+ { CCI_REG8(0x3e1c), 0x78 },
+ { CCI_REG8(0x3e1e), 0x50 },
+ { CCI_REG8(0x3e20), 0x50 },
+ { CCI_REG8(0x3e22), 0x50 },
+ { CCI_REG8(0x3e24), 0x87 },
+ { CCI_REG8(0x3e26), 0x91 },
+ { CCI_REG8(0x3e28), 0x91 },
+ { CCI_REG8(0x3e2a), 0x87 },
+ { CCI_REG8(0x3e2c), 0x78 },
+ { CCI_REG8(0x3e2e), 0x50 },
+ { CCI_REG8(0x3e30), 0x50 },
+ { CCI_REG8(0x3e32), 0x50 },
+ { CCI_REG8(0x3e34), 0x87 },
+ { CCI_REG8(0x3e36), 0x91 },
+ { CCI_REG8(0x3e38), 0x91 },
+ { CCI_REG8(0x3e3a), 0x87 },
+ { CCI_REG8(0x3e3c), 0x78 },
+ { CCI_REG8(0x3e3e), 0x50 },
+ { CCI_REG8(0x3e40), 0x50 },
+ { CCI_REG8(0x3e42), 0x50 },
+ { CCI_REG8(0x4054), 0x64 },
+ { CCI_REG8(0x4148), 0xfe },
+ { CCI_REG8(0x4149), 0x05 },
+ { CCI_REG8(0x414a), 0xff },
+ { CCI_REG8(0x414b), 0x05 },
+ { CCI_REG8(0x420a), 0x03 },
+ { CCI_REG8(0x4231), 0x08 },
+ { CCI_REG8(0x423d), 0x9c },
+ { CCI_REG8(0x4242), 0xb4 },
+ { CCI_REG8(0x4246), 0xb4 },
+ { CCI_REG8(0x424e), 0xb4 },
+ { CCI_REG8(0x425c), 0xb4 },
+ { CCI_REG8(0x425e), 0xb6 },
+ { CCI_REG8(0x426c), 0xb4 },
+ { CCI_REG8(0x426e), 0xb6 },
+ { CCI_REG8(0x428c), 0xb4 },
+ { CCI_REG8(0x428e), 0xb6 },
+ { CCI_REG8(0x4708), 0x00 },
+ { CCI_REG8(0x4709), 0x00 },
+ { CCI_REG8(0x470a), 0xff },
+ { CCI_REG8(0x470b), 0x03 },
+ { CCI_REG8(0x470c), 0x00 },
+ { CCI_REG8(0x470d), 0x00 },
+ { CCI_REG8(0x470e), 0xff },
+ { CCI_REG8(0x470f), 0x03 },
+ { CCI_REG8(0x47eb), 0x1c },
+ { CCI_REG8(0x47f0), 0xa6 },
+ { CCI_REG8(0x47f2), 0xa6 },
+ { CCI_REG8(0x47f4), 0xa0 },
+ { CCI_REG8(0x47f6), 0x96 },
+ { CCI_REG8(0x4808), 0xa6 },
+ { CCI_REG8(0x480a), 0xa6 },
+ { CCI_REG8(0x480c), 0xa0 },
+ { CCI_REG8(0x480e), 0x96 },
+ { CCI_REG8(0x492c), 0xb2 },
+ { CCI_REG8(0x4930), 0x03 },
+ { CCI_REG8(0x4932), 0x03 },
+ { CCI_REG8(0x4936), 0x5b },
+ { CCI_REG8(0x4938), 0x82 },
+ { CCI_REG8(0x493c), 0x23 },
+ { CCI_REG8(0x493e), 0x23 },
+ { CCI_REG8(0x4940), 0x23 },
+ { CCI_REG8(0x4ba8), 0x1c },
+ { CCI_REG8(0x4ba9), 0x03 },
+ { CCI_REG8(0x4bac), 0x1c },
+ { CCI_REG8(0x4bad), 0x1c },
+ { CCI_REG8(0x4bae), 0x1c },
+ { CCI_REG8(0x4baf), 0x1c },
+ { CCI_REG8(0x4bb0), 0x1c },
+ { CCI_REG8(0x4bb1), 0x1c },
+ { CCI_REG8(0x4bb2), 0x1c },
+ { CCI_REG8(0x4bb3), 0x1c },
+ { CCI_REG8(0x4bb4), 0x1c },
+ { CCI_REG8(0x4bb8), 0x03 },
+ { CCI_REG8(0x4bb9), 0x03 },
+ { CCI_REG8(0x4bba), 0x03 },
+ { CCI_REG8(0x4bbb), 0x03 },
+ { CCI_REG8(0x4bbc), 0x03 },
+ { CCI_REG8(0x4bbd), 0x03 },
+ { CCI_REG8(0x4bbe), 0x03 },
+ { CCI_REG8(0x4bbf), 0x03 },
+ { CCI_REG8(0x4bc0), 0x03 },
+ { CCI_REG8(0x4c14), 0x87 },
+ { CCI_REG8(0x4c16), 0x91 },
+ { CCI_REG8(0x4c18), 0x91 },
+ { CCI_REG8(0x4c1a), 0x87 },
+ { CCI_REG8(0x4c1c), 0x78 },
+ { CCI_REG8(0x4c1e), 0x50 },
+ { CCI_REG8(0x4c20), 0x50 },
+ { CCI_REG8(0x4c22), 0x50 },
+ { CCI_REG8(0x4c24), 0x87 },
+ { CCI_REG8(0x4c26), 0x91 },
+ { CCI_REG8(0x4c28), 0x91 },
+ { CCI_REG8(0x4c2a), 0x87 },
+ { CCI_REG8(0x4c2c), 0x78 },
+ { CCI_REG8(0x4c2e), 0x50 },
+ { CCI_REG8(0x4c30), 0x50 },
+ { CCI_REG8(0x4c32), 0x50 },
+ { CCI_REG8(0x4c34), 0x87 },
+ { CCI_REG8(0x4c36), 0x91 },
+ { CCI_REG8(0x4c38), 0x91 },
+ { CCI_REG8(0x4c3a), 0x87 },
+ { CCI_REG8(0x4c3c), 0x78 },
+ { CCI_REG8(0x4c3e), 0x50 },
+ { CCI_REG8(0x4c40), 0x50 },
+ { CCI_REG8(0x4c42), 0x50 },
+ { CCI_REG8(0x4d12), 0x1f },
+ { CCI_REG8(0x4d13), 0x1e },
+ { CCI_REG8(0x4d26), 0x33 },
+ { CCI_REG8(0x4e0e), 0x59 },
+ { CCI_REG8(0x4e14), 0x55 },
+ { CCI_REG8(0x4e16), 0x59 },
+ { CCI_REG8(0x4e1e), 0x3b },
+ { CCI_REG8(0x4e20), 0x47 },
+ { CCI_REG8(0x4e22), 0x54 },
+ { CCI_REG8(0x4e26), 0x81 },
+ { CCI_REG8(0x4e2c), 0x7d },
+ { CCI_REG8(0x4e2e), 0x81 },
+ { CCI_REG8(0x4e36), 0x63 },
+ { CCI_REG8(0x4e38), 0x6f },
+ { CCI_REG8(0x4e3a), 0x7c },
+ { CCI_REG8(0x4f3a), 0x3c },
+ { CCI_REG8(0x4f3c), 0x46 },
+ { CCI_REG8(0x4f3e), 0x59 },
+ { CCI_REG8(0x4f42), 0x64 },
+ { CCI_REG8(0x4f44), 0x6e },
+ { CCI_REG8(0x4f46), 0x81 },
+ { CCI_REG8(0x4f4a), 0x82 },
+ { CCI_REG8(0x4f5a), 0x81 },
+ { CCI_REG8(0x4f62), 0xaa },
+ { CCI_REG8(0x4f72), 0xa9 },
+ { CCI_REG8(0x4f78), 0x36 },
+ { CCI_REG8(0x4f7a), 0x41 },
+ { CCI_REG8(0x4f7c), 0x61 },
+ { CCI_REG8(0x4f7d), 0x01 },
+ { CCI_REG8(0x4f7e), 0x7c },
+ { CCI_REG8(0x4f7f), 0x01 },
+ { CCI_REG8(0x4f80), 0x77 },
+ { CCI_REG8(0x4f82), 0x7b },
+ { CCI_REG8(0x4f88), 0x37 },
+ { CCI_REG8(0x4f8a), 0x40 },
+ { CCI_REG8(0x4f8c), 0x62 },
+ { CCI_REG8(0x4f8d), 0x01 },
+ { CCI_REG8(0x4f8e), 0x76 },
+ { CCI_REG8(0x4f8f), 0x01 },
+ { CCI_REG8(0x4f90), 0x5e },
+ { CCI_REG8(0x4f91), 0x02 },
+ { CCI_REG8(0x4f92), 0x69 },
+ { CCI_REG8(0x4f93), 0x02 },
+ { CCI_REG8(0x4f94), 0x89 },
+ { CCI_REG8(0x4f95), 0x02 },
+ { CCI_REG8(0x4f96), 0xa4 },
+ { CCI_REG8(0x4f97), 0x02 },
+ { CCI_REG8(0x4f98), 0x9f },
+ { CCI_REG8(0x4f99), 0x02 },
+ { CCI_REG8(0x4f9a), 0xa3 },
+ { CCI_REG8(0x4f9b), 0x02 },
+ { CCI_REG8(0x4fa0), 0x5f },
+ { CCI_REG8(0x4fa1), 0x02 },
+ { CCI_REG8(0x4fa2), 0x68 },
+ { CCI_REG8(0x4fa3), 0x02 },
+ { CCI_REG8(0x4fa4), 0x8a },
+ { CCI_REG8(0x4fa5), 0x02 },
+ { CCI_REG8(0x4fa6), 0x9e },
+ { CCI_REG8(0x4fa7), 0x02 },
+ { CCI_REG8(0x519e), 0x79 },
+ { CCI_REG8(0x51a6), 0xa1 },
+ { CCI_REG8(0x51f0), 0xac },
+ { CCI_REG8(0x51f2), 0xaa },
+ { CCI_REG8(0x51f4), 0xa5 },
+ { CCI_REG8(0x51f6), 0xa0 },
+ { CCI_REG8(0x5200), 0x9b },
+ { CCI_REG8(0x5202), 0x91 },
+ { CCI_REG8(0x5204), 0x87 },
+ { CCI_REG8(0x5206), 0x82 },
+ { CCI_REG8(0x5208), 0xac },
+ { CCI_REG8(0x520a), 0xaa },
+ { CCI_REG8(0x520c), 0xa5 },
+ { CCI_REG8(0x520e), 0xa0 },
+ { CCI_REG8(0x5210), 0x9b },
+ { CCI_REG8(0x5212), 0x91 },
+ { CCI_REG8(0x5214), 0x87 },
+ { CCI_REG8(0x5216), 0x82 },
+ { CCI_REG8(0x5218), 0xac },
+ { CCI_REG8(0x521a), 0xaa },
+ { CCI_REG8(0x521c), 0xa5 },
+ { CCI_REG8(0x521e), 0xa0 },
+ { CCI_REG8(0x5220), 0x9b },
+ { CCI_REG8(0x5222), 0x91 },
+ { CCI_REG8(0x5224), 0x87 },
+ { CCI_REG8(0x5226), 0x82 },
+ { CCI_REG8(0x5b3c), 0x07 },
+
+ { STARVIS2_REG_WDMODE, 0x00 },
+ { STARVIS2_REG_MDBIT, 0x01 },
+ { STARVIS2_REG_XXS_DRV, 0x00 },
+};
+
+static const u16 imx585_min_hmax_2lane[] = {
+ [STARVIS2_LINK_FREQ_297MHZ] = 2984,
+ [STARVIS2_LINK_FREQ_360MHZ] = 2464,
+ [STARVIS2_LINK_FREQ_445MHZ] = 2004,
+ [STARVIS2_LINK_FREQ_594MHZ] = 1512,
+ [STARVIS2_LINK_FREQ_720MHZ] = 1260,
+ [STARVIS2_LINK_FREQ_891MHZ] = 996,
+ [STARVIS2_LINK_FREQ_1039MHZ] = 856,
+ [STARVIS2_LINK_FREQ_1188MHZ] = 856,
+};
+
+const struct starvis2_variant imx585_variant_def = {
+ .name = "imx585",
+ .id_reg = CCI_REG16_LE(0x5a1d),
+ .id_mask = 0x3ff,
+ .id_value = 0x259,
+ .active_area = {
+ .top = 0,
+ .left = 0,
+ .width = 3857,
+ .height = 2201,
+ },
+ .active_area = {
+ .top = 20,
+ .left = 0,
+ .width = 3856,
+ .height = 2180,
+ },
+ .pixel_rate = 594000000,
+ .pix_per_clk = 8,
+ .common_regs = imx585_common_regs,
+ .num_common_regs = ARRAY_SIZE(imx585_common_regs),
+ .vmax_default = 2250,
+ .hmax_min_link_freq = imx585_min_hmax_2lane,
+ .hmax_min_pixel_array = 550,
+};
+
struct starvis2_model_info {
enum starvis2_type type;
const u32 *codes;
@@ -1168,6 +1447,26 @@ static const struct starvis2_model_info imx832_autodetect_info = {
.auto_detect_mono = &imx832_amr_info,
};
+static const struct starvis2_model_info imx585_aaqj_info = {
+ .type = STARVIS2_COLOR,
+ .codes = codes_bayer,
+ .num_codes = ARRAY_SIZE(codes_bayer),
+ .variant = &imx585_variant_def,
+};
+
+static const struct starvis2_model_info imx585_aamj_info = {
+ .type = STARVIS2_MONOCHROME,
+ .codes = codes_monochrome,
+ .num_codes = ARRAY_SIZE(codes_monochrome),
+ .variant = &imx585_variant_def,
+};
+
+static const struct starvis2_model_info imx585_autodetect_info = {
+ .variant = &imx585_variant_def,
+ .auto_detect_colour = &imx585_aaqj_info,
+ .auto_detect_mono = &imx585_aamj_info,
+};
+
static const char * const starvis2_supply_name[] = {
"avdd", /* Analog (3.3V) supply */
"dvdd", /* Digital Core (1.1V) supply */
@@ -1983,11 +2282,14 @@ static const struct of_device_id starvis2_of_match[] = {
{ .compatible = "sony,imx662-aaqr", .data = &imx662_aaqr_info },
{ .compatible = "sony,imx832-amr", .data = &imx832_amr_info },
{ .compatible = "sony,imx832-aqr", .data = &imx832_aqr_info },
+ { .compatible = "sony,imx585-aamj", .data = &imx585_aamj_info },
+ { .compatible = "sony,imx585-aaqj", .data = &imx585_aaqj_info },
/* for non-conforming DTs that rely on runtime check */
{ .compatible = "sony,imx678", .data = &imx678_autodetect_info },
{ .compatible = "sony,imx675", .data = &imx675_autodetect_info },
{ .compatible = "sony,imx662", .data = &imx662_autodetect_info },
{ .compatible = "sony,imx832", .data = &imx832_autodetect_info },
+ { .compatible = "sony,imx585", .data = &imx585_autodetect_info },
{ /* sentinel */ }
};
--
2.34.1
next prev parent reply other threads:[~2026-10-13 15:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 15:16 [PATCH v2 00/13] Update imx678 to act as a common Sony Starvis 2 driver Dave Stevenson
2026-10-13 15:17 ` [PATCH v2 01/13] media: imx678: Rework into generic Starvis 2 sensor driver Dave Stevenson
2026-10-13 15:17 ` [PATCH v2 02/13] media: sony-starvis2: Reorder link frequencies to remove lookup Dave Stevenson
2026-10-13 15:17 ` [PATCH v2 03/13] media: sony-starvis2: Always program the sensor in window mode Dave Stevenson
2026-10-13 15:17 ` [PATCH v2 04/13] media: sony-starvis2: Parameterise the configuration to allow for other models Dave Stevenson
2026-10-13 15:17 ` [PATCH v2 05/13] media: sony-starvis2: Rework 2 lane support for higher link freqs Dave Stevenson
2026-10-13 15:17 ` [PATCH v2 06/13] media: sony-starvis2: Allow runtime control of link frequency Dave Stevenson
2026-10-13 15:17 ` [PATCH v2 07/13] media: sony-starvis2: Correct the minimum exposure Dave Stevenson
2026-10-13 15:17 ` [PATCH v2 08/13] media: dt-bindings: sony,imx678: Add other Starvis 2 family members Dave Stevenson
2026-10-14 11:27 ` Krzysztof Kozlowski
2026-10-13 15:17 ` [PATCH v2 09/13] media: sony-starvis2: Add support for IMX662 Dave Stevenson
2026-10-13 15:17 ` [PATCH v2 10/13] media: sony-starvis2: Add support for IMX675 Dave Stevenson
2026-10-13 15:17 ` [PATCH v2 11/13] media: sony-starvis2: Add support for IMX832 Dave Stevenson
2026-10-13 15:17 ` [PATCH v2 12/13] media: sony-starvis2: Only update bits for window mode Dave Stevenson
2026-10-13 15:17 ` Dave Stevenson [this message]
2026-10-14 13:50 ` [PATCH v2 13/13] media: sony-starvis2: Add support for IMX585 Jai Luthra
2026-10-14 14:06 ` Dave Stevenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261013-media-starvis2-v2-13-3670722d250a@raspberrypi.com \
--to=dave.stevenson@raspberrypi.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eagle.alexander923@gmail.com \
--cc=jai.luthra@ideasonboard.com \
--cc=krzk+dt@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®