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

Unicam FS/FE timing GPIO #6088

Merged
merged 2 commits into from
Apr 19, 2024
Merged

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Apr 3, 2024

Replicates the firmware option to enable a GPIO to follow CSI frame start/end timings.

https://forums.raspberrypi.com/viewtopic.php?t=368437

@6by9 6by9 marked this pull request as draft April 3, 2024 15:15

cam1_sync = <&csi1>, "sync-gpios:0=", <&gpio>,
<&csi1>, "sync-gpios:4",
<&csi1>, "sync-gpios:8=0"; /* GPIO_ACTIVE_HIGH */
Copy link
Contributor

Choose a reason for hiding this comment

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

This is OK, but you can use the named constant:

		cam1_sync = <&csi1>, "sync-gpios:0=", <&gpio>,
			    <&csi1>, "sync-gpios:4",
			    <&csi1>, "sync-gpios:8=", <GPIO_ACTIVE_HIGH>;

The legacy stack had an option to have a GPIO track frame start and
end events to give basic synchronisation to the incoming image stream.
https://forums.raspberrypi.com/viewtopic.php?t=190314

Replicate this in the kernel Unicam driver.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Unicam now takes an optional GPIO to expose frame start/end timing,
so add an override to configure that.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
@6by9
Copy link
Contributor Author

6by9 commented Apr 15, 2024

@naushir What's your view on this? It could be done from userspace, but with a large round trip delay.

@naushir
Copy link
Contributor

naushir commented Apr 16, 2024

Looks reasonable to me. Probably want to replicate this in the cfe driver?

@6by9
Copy link
Contributor Author

6by9 commented Apr 16, 2024

Looks reasonable to me. Probably want to replicate this in the cfe driver?

Probably yes (caveat around multiple virtual channels), but I'll leave that up to you :-)

The OP was really after the simple flash driver function from the legacy stack, but I don't believe flash has really been considered in libcamera as yet.

As this can be merged without impacting the normal flow of things, I'll drop the draft status even though the OP hasn't come back on it.

@6by9 6by9 marked this pull request as ready for review April 16, 2024 15:24
@6by9
Copy link
Contributor Author

6by9 commented Apr 19, 2024

Any objections to merging this then?

@naushir
Copy link
Contributor

naushir commented Apr 19, 2024

LGTM

@pelwell pelwell merged commit 9c68ba1 into raspberrypi:rpi-6.6.y Apr 19, 2024
12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Apr 26, 2024
See: raspberrypi/linux#6113

kernel: DRM: rp1: rp1-dsi: Fix escape clock divider and timeouts
See: raspberrypi/linux#6120

kernel: vc4/hdmi: Ignore hotplug interrupt with force_hotplug
See: raspberrypi/linux#6123

kernel: drivers: media: cfe: Add remap entries for mono formats
See: raspberrypi/linux#6122

kernel: dw-axi-dmac-platform: Avoid trampling with zero length buffer
See: raspberrypi/linux#6118

kernel: Add a strict_gpiod option
See: raspberrypi/linux#6117

kernel: Unicam FS/FE timing GPIO
See: raspberrypi/linux#6088
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Apr 26, 2024
See: raspberrypi/linux#6113

kernel: DRM: rp1: rp1-dsi: Fix escape clock divider and timeouts
See: raspberrypi/linux#6120

kernel: vc4/hdmi: Ignore hotplug interrupt with force_hotplug
See: raspberrypi/linux#6123

kernel: drivers: media: cfe: Add remap entries for mono formats
See: raspberrypi/linux#6122

kernel: dw-axi-dmac-platform: Avoid trampling with zero length buffer
See: raspberrypi/linux#6118

kernel: Add a strict_gpiod option
See: raspberrypi/linux#6117

kernel: Unicam FS/FE timing GPIO
See: raspberrypi/linux#6088
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