The driver was using reverse engineered pixel rates, and had different values for different link frequencies. In common with the other Starvis sensors (eg imx290), this isn't actually the situation, and the pixel array runs off a different PLL to the MIPI block, and there is a FIFO between the two. It's not quite so simple as HMAX is said to be in units of INCK, not pixel clocks. Working through the various modes that appears that even that is slightly wrong as it is units of a scaled INCK of either 72MHz (for INCK = 24 or 72MHz) or 74.25MHz (for INCK = 27, 37.125, or 74.25MHz). Rework the configuration so that the pixel rate is fixed, with the different link frequencies adjusting the minimum hmax value so that the FIFO doesn't overflow. Switching between 2 and 4 data lanes also only changes the MIPI data rate, so also can be handled by altering the minimum HMAX. Once you've got HMAX / V4L2_CID_HBLANK represented sensibly, then frame rate control through V4L2_CID_HBLANK and V4L2_CID_VBLANK is trivial, so add in frame rate control too. Exposure is set in lines (as usual), so amending VBLANK changes the range for the exposure control. This has been tested on a Pi5 with Waveshare "IMX415-98 IR-CUT Camera" module (SKU 28524). That uses a 24MHz clock, so only the 360MHz and 720MHz link frequencies have been tested (other frequencies require a 27, 37.125, or 74.25MHz clock input. It'd be nice to add support for 12bit readout and windowed mode readout, but those are a job for another day. Signed-off-by: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx> --- Dave Stevenson (3): media: i2c: imx415: Add read/write control of VBLANK media: i2c: imx415: Make HBLANK controllable and in consistent units media: i2c: imx415: Link frequencies are not exclusive to num lanes drivers/media/i2c/imx415.c | 181 +++++++++++++++++++++++---------------------- 1 file changed, 92 insertions(+), 89 deletions(-) --- base-commit: 40ed9e9b2808beeb835bd0ed971fb364c285d39c change-id: 20250107-media-imx415-2df67ae21107 Best regards, -- Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx>