Skip to content

IMX708 ccs and link frequency changes - #7605

Open
naushir wants to merge 5 commits into
raspberrypi:rpi-6.18.yfrom
naushir:imx708_ccs_link_freq
Open

IMX708 ccs and link frequency changes#7605
naushir wants to merge 5 commits into
raspberrypi:rpi-6.18.yfrom
naushir:imx708_ccs_link_freq

Conversation

@naushir

@naushir naushir commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread drivers/media/i2c/imx708.c Outdated
#define IMX708_REG_IOP_PREPLLCK_DIV 0x030d
#define IMX708_REG_IOP_PLL_MPY 0x030e
#define IMX708_REG_PLL_MULT_DRIV 0x0310
#define IMX708_PLL_MULT_DRIV_DUAL 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all duplicates of the CCS registers
https://elixir.bootlin.com/linux/v7.2.2/source/drivers/media/i2c/ccs/ccs-regs.h#L202-L214

Hmm, I thought I'd done the conversion to use CCS_REGxx macros, but it seems not to have been merged. Drat, it was part of #7057 which got stalled.
If the first patch from there still cherry-picks cleanly, then can we do that one first?

@jailuthra jailuthra Sep 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case that one doesn't apply cleanly, I've done the same in my branch relatively early in the git log, so maybe that would apply cleanly.

See f1a4b608ea in rpi/imx708

Comment thread drivers/media/i2c/imx708.c Outdated
ret = imx708_write_reg(imx708, IMX708_REG_PLL_MULT_DRIV,
IMX708_REG_VALUE_08BIT,
IMX708_PLL_MULT_DRIV_DUAL);
if (!ret)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using ccs_reg gets rid of this pattern as you pass in a pointer to ret, and it aborts if it is set.

Comment thread drivers/media/i2c/imx708.c Outdated
unsigned int i;

for (i = 1; i < ARRAY_SIZE(mode->timings); i++) {
if (mode->timings[i].link_frequency == link_freq)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mode->timings[i].link_frequency <= link_freq?
No reason why selecting a link frequency of 963MHz should preclude selecting your faster rate.
(Ideally we'd work out the threshold point for switching to the more ambitious timing, and ditch the specific link frequencies and allow any achievable values).

jailuthra and others added 5 commits September 8, 2026 14:49
…ites

Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
When the PLL is configured in DUAL_MODE (separate VT and OP trees) and
the sensor's FIFOs allow derating and/or overrating, the VT pixel rate
might be higher or lower than OP pixel rate.

Support such usecases by allowing an optional input for the target VT
pixel rate.

Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Replace the PLL dividers and multipliers hard coded into the mode and link
frequency register lists with a call to the CCS PLL calculator, describing
the sensor clock tree limits from its manual. The pre-PLL dividers are
pinned to the values those register lists used, so the tree the calculator
arrives at is the one the driver has always programmed, which was confirmed
against every mode at every link frequency.
Give each mode an array of timings rather than one fixed set, so that
a mode can run faster when the link has the bandwidth for it. A mode
uses the higest link frequency timings specified.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Add timings for a 960MHz link frequency, which gives the full resolution
mode enough bandwidth to reach 30fps and roughly doubles the rate of the
binned modes.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
@naushir
naushir force-pushed the imx708_ccs_link_freq branch from 4f58560 to e8f0ba8 Compare September 8, 2026 14:32
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.

3 participants