-
Notifications
You must be signed in to change notification settings - Fork 5.2k
HDMI Interrupt-Based Hotplug for Devices with a GPIO #4327
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
base: rpi-5.10.y
Are you sure you want to change the base?
Conversation
5a513e7
to
2d17cf0
Compare
It appears that the interrupts for all the banks but the first one are not working properly. Disable them for now. Signed-off-by: Maxime Ripard <[email protected]>
If the of_get_named_gpio_flags call fails in vc4_hdmi_bind, we jump to the err_unprepare_hsm label. That label will then call pm_runtime_disable and put_device on the DDC device. We just retrieved the DDC device, so the latter is definitely justified. However at that point we still haven't called pm_runtime_enable, so the call to pm_runtime_disable is not supposed to be there. Fixes: 10ee275 ("drm/vc4: prepare for CEC support") Signed-off-by: Maxime Ripard <[email protected]>
The new gpiod interface takes care of parsing the GPIO flags and to return the logical value when accessing an active-low GPIO, so switching to it simplifies a lot the driver. Signed-off-by: Maxime Ripard <[email protected]>
The HPD GPIO can be used on some RPi (2B, 3B+). However, and while it works fine on the 3B+, it looks like on the 2B irq over gpios doesn't work yet. Signed-off-by: Maxime Ripard <[email protected]>
2d17cf0
to
14167a2
Compare
I just pushed a change that disables the interrupts-based hotplug on devices using a GPIO on a bank other than bank 0 (like the Pi2B). I don't have a Pi2B so I couldn't test on that hardware, but hacking a bit on the Pi3B+ looks like it should be working there. |
I'm happy with the patches, although I don't see why only bank 0 interrupts work. Or is that more to keep general GPIO interrupt handling working? That's got potential fall-out on the Compute Module 1&3 (not 4) where Bank 1 GPIOs are available for general use. My concerns were that the firmware appears to be using the edge detection part of the interrupt block, even if it doesn't enable the actual interrupt and install an ISR. This PR will make HPD work on those platforms with HPD on the GPIO expander (via polling), but I think I need to look at the firmware to make it drop all HPD stuff should KMS be enabled. |
The first patch was meant to prevent using the interrupt based hotplug on the devices that have a GPIO on bank > 0 since you reported it as broken. After this patch, as far as I know, the Pi with a GPIO Expander or a GPIO on bank 1 would use polling, and the one with a dedicated interrupt line (Pi4, CM4?) or a GPIO on the bank 0 (Pi3B+) would use interrupts It's true that the side effect is that any driver using an interrupt handler would now get an error, but the way I understood it is that they were always broken anyway. If it's the firmware interfering, then we shouldn't merge this patch indeed. |
Hi,
I'm pushing a draft PR here since Dave reported that the bank1 interrupts were apparently not working on the Pi2B, in PR #4313
The code here works on the Pi3B+, so it might be helpful to someone.