Skip to content

Commit 1fcfdd1

Browse files
committed
drm/vc4_hdmi: Allow hotplug detect to be forced
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 #4371 and this provides an optional way of getting back the old behaviour Signed-off-by: Dom Cobley <[email protected]>
1 parent a50a9e6 commit 1fcfdd1

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
@@ -44,6 +44,8 @@
4444
#include <linux/component.h>
4545
#include <linux/gpio/consumer.h>
4646
#include <linux/i2c.h>
47+
#include <linux/module.h>
48+
#include <linux/moduleparam.h>
4749
#include <linux/of.h>
4850
#include <linux/of_address.h>
4951
#include <linux/pm_runtime.h>
@@ -112,6 +114,10 @@
112114

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

117+
/* bit field to force hotplug detection. bit0 = HDMI0 */
118+
static int force_hotplug;
119+
module_param(force_hotplug, int, 0644);
120+
115121
static bool vc4_hdmi_supports_scrambling(struct vc4_hdmi *vc4_hdmi)
116122
{
117123
struct drm_display_info *display = &vc4_hdmi->connector.display_info;
@@ -450,7 +456,9 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
450456
return connector_status_unknown;
451457
}
452458

453-
if (vc4_hdmi->hpd_gpio) {
459+
if (force_hotplug & BIT(vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0))
460+
status = connector_status_connected;
461+
else if (vc4_hdmi->hpd_gpio) {
454462
if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio))
455463
status = connector_status_connected;
456464
} else {

0 commit comments

Comments
 (0)