Skip to content

Starvis2 sensor driver support (IMX662) on 7.3 - #7631

Draft
6by9 wants to merge 15 commits into
raspberrypi:rpi-7.3.yfrom
6by9:rpi-7.3.y-starvis2
Draft

6by9 wants to merge 15 commits into
raspberrypi:rpi-7.3.yfrom
6by9:rpi-7.3.y-starvis2

Conversation

@6by9

@6by9 6by9 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Wanted for testing closer to mainline.

The register layout and programming model for multiple of the
Sony Starvis2 sensors is identical, so prepare for supporting
those by renaming all common parts of the driver to a starvis2_
prefix, and renaming the driver.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
link_freqs_reg_value is table that just reverses the order of the
link frequency enum.

Reverse the order of the link frequencies so that the table is
redundant, and remove it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
If the requested region matched the defined active area then
the driver switched to all-pixel mode. This left the possibility
that the activeare was incorrect and not reading out the area
expected.

Switch to always requesting window mode.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
…er models

Several of the Sony Starvis 2 sensors are identical in the
majority of their programming, but differ largely only in the
size of pixel array and some timing parameters.

Parameterise those parameters in preparation for supporting other
variants.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
With some Starvis 2 sensors, the link frequency on 2 lanes is sufficient
to achieve a lower line time than the 4 lane divided by 2, effectively
that it hits the minimum that the pixel array can handle.
That can't easily be handled with the way the values are currently stored.

Storing the 2 lane hmax alongside the pixel array's minimum allows the
4 lane support to divide the value by 2, and then clip to the pixel
array value as a minimum.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
DT allows configuration of multiple link frequencies.
V4L2_CID_LINK_FREQ allows read write control.

Join these up so that link frequency can be configured at run time,
as long, as the sensor isn't streaming.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
@6by9
6by9 force-pushed the rpi-7.3.y-starvis2 branch 2 times, most recently from 472aecc to d91bea2 Compare September 17, 2026 09:50
As we have a way to confirm which Starvis2 module is connected, add
a generic compatible that will use all defined variants to attempt to
identify which module is connected.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
IMX662 is a 1080p Starvis 2 sensor that follows the same programming
pattern as IMX678, so add it to the newly parameterised common
driver.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
The IMX675 is a 5MPix Starvis2 sensor that follows the same
programming pattern as IMX678 and IMX662, so add it into the
driver.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
IMX832 is replacing IMX662, and it follows the same pattern as all the
Starvis2 sensors.

Add the sensor specific configuration for it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
IMX585 is an 8MPix Starvis 2 sensor, so add support for it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
HCG (High Conversion Gain) adds additional gain within the sensor,
but also requires that the minimum analogue gain is 34 rather than
0 when in the default LCG mode.

Add a module parameter that is read during probe and at the start
of enable_streams, and adjust settings accordingly.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Whilst normally digital gain would be applied in the ISP, there
are some situations where it is an advantage to allow the use of
the on-sensor digital gain too. Allow it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
@6by9
6by9 force-pushed the rpi-7.3.y-starvis2 branch from d91bea2 to b4d258f Compare September 17, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant