Skip to content

Commit 5c58239

Browse files
popcornmixlimeng-linux
authored andcommitted
drm/vc4_hdmi: Allow hotplug detect to be forced
commit 0641198ad17c6a6ded66e736da9fe97e09529dbd from https://github.com/raspberrypi/linux.git rpi-6.1.y See: https://forum.libreelec.tv/thread/24783-tv-avr-turns-back-on-right-after-turning-them-off While the kernel provides a :D flag for assuming device is connected, it doesn't stop this function from being called and generating a cec_phys_addr_invalidate message when hotplug is deasserted. That message provokes a flurry of CEC messages which for many users results in the TV switching back on again and it's very hard to get it to stay switched off. It seems to only occur with an AVR and TV connected but has been observed across a number of manufacturers. The issue started with raspberrypi/linux#4371 and this provides an optional way of getting back the old behaviour Signed-off-by: Dom Cobley <[email protected]> Signed-off-by: Meng Li <[email protected]>
1 parent e0c279a commit 5c58239

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
#include <linux/component.h>
4242
#include <linux/gpio/consumer.h>
4343
#include <linux/i2c.h>
44+
#include <linux/module.h>
45+
#include <linux/moduleparam.h>
4446
#include <linux/of_address.h>
4547
#include <linux/of_platform.h>
4648
#include <linux/pm_runtime.h>
@@ -113,6 +115,10 @@
113115

114116
#define HDMI_14_MAX_TMDS_CLK (340 * 1000 * 1000)
115117

118+
/* bit field to force hotplug detection. bit0 = HDMI0 */
119+
static int force_hotplug = 0;
120+
module_param(force_hotplug, int, 0644);
121+
116122
static const char * const output_format_str[] = {
117123
[VC4_HDMI_OUTPUT_RGB] = "RGB",
118124
[VC4_HDMI_OUTPUT_YUV420] = "YUV 4:2:0",
@@ -475,7 +481,9 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
475481

476482
WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev));
477483

478-
if (vc4_hdmi->hpd_gpio) {
484+
if (force_hotplug & BIT(vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0))
485+
status = connector_status_connected;
486+
else if (vc4_hdmi->hpd_gpio) {
479487
if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio))
480488
status = connector_status_connected;
481489
} else {

0 commit comments

Comments
 (0)