From: sashiko-bot@kernel.org
To: "Dave Stevenson" <dave.stevenson@raspberrypi.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
media-ci@linuxtv.org
Subject: Re: [PATCH v5 16/16] media: sony-starvis2: Add support for IMX585
Date: Mon, 19 Oct 2026 16:23:45 +0000 [thread overview]
Message-ID: <sashiko-outbox-177877@kernel.org> (raw)
In-Reply-To: <20261019-media-starvis2-v5-16-eef935347ce9@raspberrypi.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] media: sony-starvis2: starvis2_write_common() writes 0x4e3c on IMX585
- [Medium] media: sony-starvis2: starvis2_identify_model() reads 0x4d18 on IMX585
--
commit 760bcd8df1ec1dd08aab2a18c904b0c265aacbd2
Author: Dave Stevenson <dave.stevenson@raspberrypi.com>
media: sony-starvis2: Add support for IMX585
This commit adds register sequences, variant definitions, and device tree
match entries to support the Sony IMX585 8MPix Starvis 2 sensor.
> diff --git a/drivers/media/i2c/sony-starvis2.c b/drivers/media/i2c/sony-starvis2.c
> index b9ade0887b6bc..e89aa1a7d5eb8 100644
> --- a/drivers/media/i2c/sony-starvis2.c
> +++ b/drivers/media/i2c/sony-starvis2.c
> @@ -1090,6 +1092,286 @@ static const struct starvis2_variant imx832_variant_def = {
> .shr_min = 4,
> };
>
> +static const struct cci_reg_sequence imx585_common_regs[] = {
[ ... ]
> + { 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(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 },
> +};
[Severity: Medium]
On IMX678, register 0x4e3c (STARVIS2_REG_INTERFACE_SEL) selects the 2-lane or
4-lane CSI-2 interface (0x07). On IMX585, the register banks above 0x34xx
extend through 0x4dxx..0x52xx and the identification and interface selector
blocks are shifted by +0x0d00, so imx585_common_regs programs the interface
select register at 0x5b3c (0x4e3c + 0x0d00) while 0x4e0e..0x4e3a are internal
timing registers.
However, when starvis2_power_on() or starvis2_enable_streams() calls
starvis2_write_common(), it still unconditionally writes to
STARVIS2_REG_INTERFACE_SEL (0x4e3c) after writing common_regs:
drivers/media/i2c/sony-starvis2.c:starvis2_write_common() {
...
cci_multi_reg_write(starvis2->cci, starvis2->variant->common_regs,
starvis2->variant->num_common_regs, &ret);
...
cci_write(starvis2->cci, STARVIS2_REG_INTERFACE_SEL,
STARVIS2_INTERFACE_2L_4L, &ret);
...
}
Will this unintentionally overwrite register 0x4e3c in IMX585's internal
0x4exx timing bank whenever the sensor is powered on or streaming is enabled?
[ ... ]
> +static const struct starvis2_variant imx585_variant_def = {
> + .name = "imx585",
> + .id_reg = CCI_REG16_LE(0x5a1d),
> + .id_mask = 0x3ff,
> + .id_value = 0x259,
[Severity: Medium]
On IMX678, IMX662, IMX675, and IMX832, the sensor OTP identification registers
reside in the 0x4dxx range (with id_reg at 0x4d12 or 0x4d1c, and
STARVIS2_REG_MONOCHROME at 0x4d18).
On IMX585, 0x4dxx is a normal control register bank (imx585_common_regs writes
0x4d12, 0x4d13, and 0x4d26), and the identification block is shifted to 0x5axx
(with id_reg at 0x5a1d).
During starvis2_probe() -> starvis2_identify_model(), the driver reads the
variant's id_reg, but then unconditionally reads the hardcoded
STARVIS2_REG_MONOCHROME (0x4d18) for all variants:
drivers/media/i2c/sony-starvis2.c:starvis2_identify_model() {
...
cci_read(starvis2->cci, variant->id_reg, &val, &ret);
...
cci_read(starvis2->cci, STARVIS2_REG_MONOCHROME, &val, &ret);
...
detected = val & STARVIS2_TYPE;
}
Does reading 0x4d18 on IMX585 cause broken color/monochrome autodetection when
probing with the "sony,imx585" compatible, as well as false sensor-type
mismatch errors in dmesg when probing with "sony,imx585-aamj" or
"sony,imx585-aaqj"?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261019-media-starvis2-v5-0-eef935347ce9@raspberrypi.com?part=16
next prev parent reply other threads:[~2026-10-19 16:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 14:28 [PATCH v5 00/16] Update imx678 to act as a common Sony Starvis 2 driver Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 01/16] media: imx678: Rework into generic Starvis 2 sensor driver Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 02/16] media: sony-starvis2: Reorder link frequencies to remove lookup Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 03/16] media: sony-starvis2: Always program the sensor in window mode Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 04/16] media: sony-starvis2: Parameterise the configuration to allow for other models Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 05/16] media: sony-starvis2: Rework 2 lane support for higher link freqs Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 06/16] media: sony-starvis2: Allow runtime control of link frequency Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 07/16] media: sony-starvis2: Correct the exposure range Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 08/16] media: sony-starvis2: Put module into standby after identify Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 09/16] media: sony-starvis2: Use pm_runtime_autosuspend Dave Stevenson
2026-10-19 16:07 ` sashiko-bot
2026-10-19 14:28 ` [PATCH v5 10/16] media: dt-bindings: sony,imx678: Add other Starvis 2 family members Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 11/16] media: sony-starvis2: Add support for IMX662 Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 12/16] media: sony-starvis2: Add support for IMX675 Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 13/16] media: sony-starvis2: Add support for IMX832 Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 14/16] media: sony-starvis2: Only update bits for window mode Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 15/16] media: sony-starvis2: Parameterise exposure min and step Dave Stevenson
2026-10-19 14:28 ` [PATCH v5 16/16] media: sony-starvis2: Add support for IMX585 Dave Stevenson
2026-10-19 16:23 ` sashiko-bot [this message]
2026-10-20 10:21 ` [PATCH v5 00/16] Update imx678 to act as a common Sony Starvis 2 driver Sakari Ailus
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=sashiko-outbox-177877@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=dave.stevenson@raspberrypi.com \
--cc=devicetree@vger.kernel.org \
--cc=media-ci@linuxtv.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.