-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
drivers: media: cfe: Add non-continuous CSI-2 clock mode #6705
base: rpi-6.12.y
Are you sure you want to change the base?
Conversation
@6by9 very speculative change that sets up the DPHY for non-continuous clock. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - I'll give it a test with OV9281.
0bee9c6
to
6945aa8
Compare
I would enable warnings-as-errors by default, but some don't like it. It's enabled in the auto-builds after the choice of defconfig by this step:
where |
This change will need adjusting so that we can switch between auto/manual termination since it's possible this is mode specific. |
cfe->csi2.dphy.noncontinuous_clock = | ||
(!ret ? mbus_config.bus.mipi_csi2.flags : cfe->csi2.bus_flags) & | ||
V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'll do.
I'd have fixed up the active_lanes
value too with
if (!ret) {
cfe->csi2.dphy.noncontinuous_clock = mbus_config.bus.mipi_csi2.flags & V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK;
cfe->csi2.dphy.active_lanes = mbus_config.bus.mipi_csi2.num_data_lanes;
if (cfe->csi2.dphy.active_lanes > cfe->csi2.dphy.max_lanes) {
cfe_err("Device has requested %u data lanes, which is >%u configured in DT\n",
cfe->csi2.dphy.active_lanes, cfe->csi2.dphy.max_lanes);
ret = -EINVAL;
goto err_disable_cfe;
}} else {
cfe->csi2.dphy.noncontinuous_clock = cfe->csi2.bus_flags & V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK;
cfe->csi2.dphy.active_lanes = cfe->csi2.dphy.max_lanes;
}
but that can wait for another day.
I still haven't managed to get the failure case to happen that we were discussing this for though....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still haven't managed to get the failure case to happen that we were discussing this for though....
Even with this commit reverted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still haven't managed to get the failure case to happen that we were discussing this for though....
Even with this commit reverted?
Reproduced now without this commit.
6.12 doesn't have #6700 to add the option for selecting clock mode. Adding that makes testing far easier.
Continuous clock mode fails. Non-continuous is OK. That's similar to Pi3 which won't stream in continuous clock mode.
With the latest version of this patch (guess who tried testing the version that only looked at the get_mbus_config result version) I get timeouts in continuous mode, and black images non-continuous.
So we look to be in the right sort of area, but not quite right. I'll give it a few more minutes poking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite likely the register configuration I've used is also incorrect. The datasheet is very convoluted.
After staring a bit more at the databook, I suspect that while the register configuration may be right, the way we (now) write multiple config register through the test interface is likely wrong. |
28d1e43
to
de1afd2
Compare
Calling this function without holding the mmap_read_lock causes the kernel to throw an error message, spamming the dmesg logs when running the Hailo hardware. Fix it by adding the approprite lock/unlock functions around find_vdma(). Signed-off-by: Naushir Patuck <[email protected]>
Set the DPHY block to manual clock lane termination enable and HS mode i V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK is set in the bus flags.