Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OV5647 link frequency control #6423

Merged
merged 4 commits into from
Oct 17, 2024
Merged

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Oct 17, 2024

I found I had the OV spreadsheet for PLL config, so could determine the link frequency.

I don't know why we had a different clock setup for 1080p cropped and binned modes vs the full res. Increasing it that fraction gives a slightly higher max frame rate in those modes (32.81 fps at 1080p and 46.34fps at 1296x972), and removes one extra link frequency.

There will hopefully be a follow-up to these which will add selection of the slower rate for 6sec exposures.
Simplest approach is to set {0x3037, 0x06} to halve all the clocks (default is 0x03). Arranging it will be the awkward one - selection via link frequency in DT is the cleanest approach, but the current overlays actually have a single incorrect value defined, so we'll need a fallback.

(I will find a few minutes to send these patches upstream in due course).

To make comparisons of the mode registers easier, put the registers
for the binned and VGA modes in the same order as the others.

Signed-off-by: Dave Stevenson <[email protected]>
There are many registers in common between all the modes.
Pull those out into one common table.

Signed-off-by: Dave Stevenson <[email protected]>
…ed modes

In order to simplify the driver slightly, use the same PLL
configuration, and hence pixel rate and link frequency (to be
added) for the full, 1080p, and binned modes.

Signed-off-by: Dave Stevenson <[email protected]>
The link frequency can vary between modes, so add it as a
control.

Signed-off-by: Dave Stevenson <[email protected]>
@6by9 6by9 requested a review from naushir October 17, 2024 10:50
Copy link
Contributor

@naushir naushir left a comment

Choose a reason for hiding this comment

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

Only the one minor thing, otherwise LGTM

drivers/media/i2c/ov5647.c Show resolved Hide resolved
@pelwell pelwell merged commit 84ab774 into raspberrypi:rpi-6.6.y Oct 17, 2024
12 checks passed
@Bajec
Copy link

Bajec commented Oct 17, 2024

why are link frequencyes not added also to the device tree?

@6by9
Copy link
Contributor Author

6by9 commented Oct 17, 2024

why are link frequencyes not added also to the device tree?

The driver doesn't check the link frequencies defined in devicetree, so there was little point in updating DT at this stage. The 297MHz value currently in there is totally wrong for this sensor.

As I've said, there will be a follow up patch that will read the link frequencies and configure the clock setup accordingly.

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Oct 18, 2024
See: raspberrypi/linux#6421

kernel: Fixes for video-mux with Pi5
See: raspberrypi/linux#6410

kernel: OV5647 link frequency control
See: raspberrypi/linux#6423

kernel: CQE incremental fixes part 2
See: raspberrypi/linux#6419
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Oct 18, 2024
See: raspberrypi/linux#6421

kernel: Fixes for video-mux with Pi5
See: raspberrypi/linux#6410

kernel: OV5647 link frequency control
See: raspberrypi/linux#6423

kernel: CQE incremental fixes part 2
See: raspberrypi/linux#6419
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.

4 participants