]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
omapdrm: omapdss_hdmi_ops: add lost_hotplug op
authorHans Verkuil <hverkuil@xs4all.nl>
Thu, 17 Aug 2017 13:19:57 +0000 (15:19 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 12 Oct 2017 07:49:14 +0000 (10:49 +0300)
The CEC framework needs to know when the hotplug detect signal
disappears, since that means the CEC physical address has to be
invalidated (i.e. set to f.f.f.f).

Add a lost_hotplug op that is called when the HPD signal goes away.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
drivers/gpu/drm/omapdrm/dss/hdmi4.c
drivers/gpu/drm/omapdrm/dss/omapdss.h

index d9d25df6fc1b5311cb1a97c6517fb3587f8bf708..4600d3841c2512a0406bd797d71bea298ec3c740 100644 (file)
@@ -165,11 +165,15 @@ static bool hdmic_detect(struct omap_dss_device *dssdev)
 {
        struct panel_drv_data *ddata = to_panel_data(dssdev);
        struct omap_dss_device *in = ddata->in;
+       bool connected;
 
        if (gpio_is_valid(ddata->hpd_gpio))
-               return gpio_get_value_cansleep(ddata->hpd_gpio);
+               connected = gpio_get_value_cansleep(ddata->hpd_gpio);
        else
-               return in->ops.hdmi->detect(in);
+               connected = in->ops.hdmi->detect(in);
+       if (!connected && in->ops.hdmi->lost_hotplug)
+               in->ops.hdmi->lost_hotplug(in);
+       return connected;
 }
 
 static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev,
index 293b8fd07cfc8ba0f059039a50dc6e57b1857a12..e3d98d78fc401167cb5afeefc190a1c871e27e79 100644 (file)
@@ -159,8 +159,12 @@ static int tpd_read_edid(struct omap_dss_device *dssdev,
 static bool tpd_detect(struct omap_dss_device *dssdev)
 {
        struct panel_drv_data *ddata = to_panel_data(dssdev);
+       struct omap_dss_device *in = ddata->in;
+       bool connected = gpiod_get_value_cansleep(ddata->hpd_gpio);
 
-       return gpiod_get_value_cansleep(ddata->hpd_gpio);
+       if (!connected && in->ops.hdmi->lost_hotplug)
+               in->ops.hdmi->lost_hotplug(in);
+       return connected;
 }
 
 static int tpd_register_hpd_cb(struct omap_dss_device *dssdev,
index 2bfbd67458502d03fee0ce840f594afe7d5f41dc..a598dfdeb5850ee26f791416ecc4193cf11cf6e7 100644 (file)
@@ -401,8 +401,6 @@ static void hdmi_display_disable(struct omap_dss_device *dssdev)
 
        DSSDBG("Enter hdmi_display_disable\n");
 
-       hdmi4_cec_set_phys_addr(&hdmi.core, CEC_PHYS_ADDR_INVALID);
-
        mutex_lock(&hdmi.lock);
 
        spin_lock_irqsave(&hdmi.audio_playing_lock, flags);
@@ -514,6 +512,11 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,
        return r;
 }
 
+static void hdmi_lost_hotplug(struct omap_dss_device *dssdev)
+{
+       hdmi4_cec_set_phys_addr(&hdmi.core, CEC_PHYS_ADDR_INVALID);
+}
+
 static int hdmi_set_infoframe(struct omap_dss_device *dssdev,
                const struct hdmi_avi_infoframe *avi)
 {
@@ -540,6 +543,7 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
        .get_timings            = hdmi_display_get_timings,
 
        .read_edid              = hdmi_read_edid,
+       .lost_hotplug           = hdmi_lost_hotplug,
        .set_infoframe          = hdmi_set_infoframe,
        .set_hdmi_mode          = hdmi_set_hdmi_mode,
 };
index 47a331670963b2fdffd47a0080e56c09257f3595..990422b357849ec495f7c9fc9a3a6efbf4d4a0d0 100644 (file)
@@ -395,6 +395,7 @@ struct omapdss_hdmi_ops {
                            struct videomode *vm);
 
        int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len);
+       void (*lost_hotplug)(struct omap_dss_device *dssdev);
        bool (*detect)(struct omap_dss_device *dssdev);
 
        int (*register_hpd_cb)(struct omap_dss_device *dssdev,