mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
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 https://github.com/raspberrypi/linux/pull/4371 and this provides an optional way of getting back the old behaviour Signed-off-by: Dom Cobley <popcornmix@gmail.com>
This commit is contained in:
@@ -44,6 +44,8 @@
|
|||||||
#include <linux/component.h>
|
#include <linux/component.h>
|
||||||
#include <linux/gpio/consumer.h>
|
#include <linux/gpio/consumer.h>
|
||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/moduleparam.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_address.h>
|
#include <linux/of_address.h>
|
||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
@@ -113,6 +115,10 @@
|
|||||||
|
|
||||||
#define HDMI_14_MAX_TMDS_CLK (340 * 1000 * 1000)
|
#define HDMI_14_MAX_TMDS_CLK (340 * 1000 * 1000)
|
||||||
|
|
||||||
|
/* bit field to force hotplug detection. bit0 = HDMI0 */
|
||||||
|
static int force_hotplug;
|
||||||
|
module_param(force_hotplug, int, 0644);
|
||||||
|
|
||||||
static bool vc4_hdmi_supports_scrambling(struct vc4_hdmi *vc4_hdmi)
|
static bool vc4_hdmi_supports_scrambling(struct vc4_hdmi *vc4_hdmi)
|
||||||
{
|
{
|
||||||
struct drm_display_info *display = &vc4_hdmi->connector.display_info;
|
struct drm_display_info *display = &vc4_hdmi->connector.display_info;
|
||||||
@@ -423,7 +429,9 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
|
|||||||
return connector_status_unknown;
|
return connector_status_unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vc4_hdmi->hpd_gpio) {
|
if (force_hotplug & BIT(vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0))
|
||||||
|
status = connector_status_connected;
|
||||||
|
else if (vc4_hdmi->hpd_gpio) {
|
||||||
if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio))
|
if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio))
|
||||||
status = connector_status_connected;
|
status = connector_status_connected;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user