Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: sti: remove gpio for HDMI hot plug detection

gpio used for HDMI hot plug detection is useless,
HDMI_STI register contains an hot plug detection status bit.
Fix binding documentation.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

+5 -13
-2
Documentation/devicetree/bindings/gpu/st,stih4xx.txt
··· 68 68 number of clocks may depend of the SoC type. 69 69 - clock-names: names of the clocks listed in clocks property in the same 70 70 order. 71 - - hdmi,hpd-gpio: gpio id to detect if an hdmi cable is plugged or not. 72 71 - ddc: phandle of an I2C controller used for DDC EDID probing 73 72 74 73 sti-hda: ··· 173 174 interrupt-names = "irq"; 174 175 clock-names = "pix", "tmds", "phy", "audio"; 175 176 clocks = <&clockgen_c_vcc CLK_S_PIX_HDMI>, <&clockgen_c_vcc CLK_S_TMDS_HDMI>, <&clockgen_c_vcc CLK_S_HDMI_REJECT_PLL>, <&clockgen_b1 CLK_S_PCM_0>; 176 - hdmi,hpd-gpio = <&PIO2 5>; 177 177 }; 178 178 179 179 sti-hda@fe85a000 {
+2 -9
drivers/gpu/drm/sti/sti_hdmi.c
··· 130 130 131 131 /* Hot plug/unplug IRQ */ 132 132 if (hdmi->irq_status & HDMI_INT_HOT_PLUG) { 133 - /* read gpio to get the status */ 134 - hdmi->hpd = gpio_get_value(hdmi->hpd_gpio); 133 + hdmi->hpd = readl(hdmi->regs + HDMI_STA) & HDMI_STA_HOT_PLUG; 135 134 if (hdmi->drm_dev) 136 135 drm_helper_hpd_irq_event(hdmi->drm_dev); 137 136 } ··· 765 766 return PTR_ERR(hdmi->clk_audio); 766 767 } 767 768 768 - hdmi->hpd_gpio = of_get_named_gpio(np, "hdmi,hpd-gpio", 0); 769 - if (hdmi->hpd_gpio < 0) { 770 - DRM_ERROR("Failed to get hdmi hpd-gpio\n"); 771 - return -EIO; 772 - } 773 - 774 - hdmi->hpd = gpio_get_value(hdmi->hpd_gpio); 769 + hdmi->hpd = readl(hdmi->regs + HDMI_STA) & HDMI_STA_HOT_PLUG; 775 770 776 771 init_waitqueue_head(&hdmi->wait_event); 777 772
+3 -2
drivers/gpu/drm/sti/sti_hdmi.h
··· 14 14 #define HDMI_STA 0x0010 15 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 + 17 20 struct sti_hdmi; 18 21 19 22 struct hdmi_phy_ops { ··· 40 37 * @irq_status: interrupt status register 41 38 * @phy_ops: phy start/stop operations 42 39 * @enabled: true if hdmi is enabled else false 43 - * @hpd_gpio: hdmi hot plug detect gpio number 44 40 * @hpd: hot plug detect status 45 41 * @wait_event: wait event 46 42 * @event_received: wait event status ··· 59 57 u32 irq_status; 60 58 struct hdmi_phy_ops *phy_ops; 61 59 bool enabled; 62 - int hpd_gpio; 63 60 bool hpd; 64 61 wait_queue_head_t wait_event; 65 62 bool event_received;