From 7c772ad707f4369db6284aadb59cea7f11c70f33 Mon Sep 17 00:00:00 2001 From: zwl Date: Fri, 6 Jun 2014 08:49:13 +0800 Subject: [PATCH] rk3288 hdmi: add iomux to gpio and pull down when suspend --- arch/arm/boot/dts/rk3288-pinctrl.dtsi | 1 + drivers/video/rockchip/hdmi/chips/rk3288/rk3288_hdmi.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/rk3288-pinctrl.dtsi b/arch/arm/boot/dts/rk3288-pinctrl.dtsi index 85982b9a5bbd..960f2ec8cb5d 100755 --- a/arch/arm/boot/dts/rk3288-pinctrl.dtsi +++ b/arch/arm/boot/dts/rk3288-pinctrl.dtsi @@ -399,6 +399,7 @@ i2c5_gpio: i2c5-gpio { rockchip,pins = , ; + rockchip,pull = ; rockchip,drive = ; }; }; diff --git a/drivers/video/rockchip/hdmi/chips/rk3288/rk3288_hdmi.c b/drivers/video/rockchip/hdmi/chips/rk3288/rk3288_hdmi.c index ced94b12f8ec..3811283c1b96 100644 --- a/drivers/video/rockchip/hdmi/chips/rk3288/rk3288_hdmi.c +++ b/drivers/video/rockchip/hdmi/chips/rk3288/rk3288_hdmi.c @@ -280,6 +280,7 @@ static int rk3288_hdmi_drv_init(struct hdmi *hdmi_drv) static void rk3288_hdmi_early_suspend(void) { struct hdmi *hdmi_drv = &hdmi_dev->driver; + struct pinctrl_state *gpio_state; if (hdmi_drv->suspend) return; @@ -302,6 +303,10 @@ static void rk3288_hdmi_early_suspend(void) wait_for_completion_interruptible_timeout(&hdmi_drv->complete, msecs_to_jiffies(5000)); flush_delayed_work(&hdmi_drv->delay_work); + + /* iomux to gpio and pull down when suspend */ + gpio_state = pinctrl_lookup_state(hdmi_dev->dev->pins->p, "gpio"); + pinctrl_select_state(hdmi_dev->dev->pins->p, gpio_state); rk3288_hdmi_clk_disable(hdmi_dev); return; } @@ -314,6 +319,9 @@ static void rk3288_hdmi_early_resume(void) return; hdmi_dbg(hdmi_drv->dev, "hdmi enter early resume\n"); + /* iomux to default state for hdmi use when resume */ + pinctrl_select_state(hdmi_dev->dev->pins->p, + hdmi_dev->dev->pins->default_state); rk3288_hdmi_clk_enable(hdmi_dev); mutex_lock(&hdmi_drv->enable_mutex); hdmi_drv->suspend = 0; -- 2.34.1