aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/sti/sti_hdmi.c11
-rw-r--r--drivers/gpu/drm/sti/sti_hdmi.h5
2 files changed, 5 insertions, 11 deletions
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index fed1b5fe4842..192119761c14 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -130,8 +130,7 @@ static irqreturn_t hdmi_irq_thread(int irq, void *arg)
130 130
131 /* Hot plug/unplug IRQ */ 131 /* Hot plug/unplug IRQ */
132 if (hdmi->irq_status & HDMI_INT_HOT_PLUG) { 132 if (hdmi->irq_status & HDMI_INT_HOT_PLUG) {
133 /* read gpio to get the status */ 133 hdmi->hpd = readl(hdmi->regs + HDMI_STA) & HDMI_STA_HOT_PLUG;
134 hdmi->hpd = gpio_get_value(hdmi->hpd_gpio);
135 if (hdmi->drm_dev) 134 if (hdmi->drm_dev)
136 drm_helper_hpd_irq_event(hdmi->drm_dev); 135 drm_helper_hpd_irq_event(hdmi->drm_dev);
137 } 136 }
@@ -766,13 +765,7 @@ static int sti_hdmi_probe(struct platform_device *pdev)
766 return PTR_ERR(hdmi->clk_audio); 765 return PTR_ERR(hdmi->clk_audio);
767 } 766 }
768 767
769 hdmi->hpd_gpio = of_get_named_gpio(np, "hdmi,hpd-gpio", 0); 768 hdmi->hpd = readl(hdmi->regs + HDMI_STA) & HDMI_STA_HOT_PLUG;
770 if (hdmi->hpd_gpio < 0) {
771 DRM_ERROR("Failed to get hdmi hpd-gpio\n");
772 return -EIO;
773 }
774
775 hdmi->hpd = gpio_get_value(hdmi->hpd_gpio);
776 769
777 init_waitqueue_head(&hdmi->wait_event); 770 init_waitqueue_head(&hdmi->wait_event);
778 771
diff --git a/drivers/gpu/drm/sti/sti_hdmi.h b/drivers/gpu/drm/sti/sti_hdmi.h
index d00a3e0d807f..3d22390e1f3b 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.h
+++ b/drivers/gpu/drm/sti/sti_hdmi.h
@@ -14,6 +14,9 @@
14#define HDMI_STA 0x0010 14#define HDMI_STA 0x0010
15#define HDMI_STA_DLL_LCK BIT(5) 15#define HDMI_STA_DLL_LCK BIT(5)
16 16
17#define HDMI_STA_HOT_PLUG_SHIFT 4
18#define HDMI_STA_HOT_PLUG (1 << HDMI_STA_HOT_PLUG_SHIFT)
19
17struct sti_hdmi; 20struct sti_hdmi;
18 21
19struct hdmi_phy_ops { 22struct hdmi_phy_ops {
@@ -37,7 +40,6 @@ struct hdmi_phy_ops {
37 * @irq_status: interrupt status register 40 * @irq_status: interrupt status register
38 * @phy_ops: phy start/stop operations 41 * @phy_ops: phy start/stop operations
39 * @enabled: true if hdmi is enabled else false 42 * @enabled: true if hdmi is enabled else false
40 * @hpd_gpio: hdmi hot plug detect gpio number
41 * @hpd: hot plug detect status 43 * @hpd: hot plug detect status
42 * @wait_event: wait event 44 * @wait_event: wait event
43 * @event_received: wait event status 45 * @event_received: wait event status
@@ -57,7 +59,6 @@ struct sti_hdmi {
57 u32 irq_status; 59 u32 irq_status;
58 struct hdmi_phy_ops *phy_ops; 60 struct hdmi_phy_ops *phy_ops;
59 bool enabled; 61 bool enabled;
60 int hpd_gpio;
61 bool hpd; 62 bool hpd;
62 wait_queue_head_t wait_event; 63 wait_queue_head_t wait_event;
63 bool event_received; 64 bool event_received;