rk3288 hdmi: add iomux to gpio and pull down when suspend
authorzwl <zwl@rock-chips.com>
Fri, 6 Jun 2014 00:49:13 +0000 (08:49 +0800)
committerzwl <zwl@rock-chips.com>
Fri, 6 Jun 2014 00:49:30 +0000 (08:49 +0800)
arch/arm/boot/dts/rk3288-pinctrl.dtsi
drivers/video/rockchip/hdmi/chips/rk3288/rk3288_hdmi.c

index 85982b9a5bbd4d40f3b6600e4b9df59504a57070..960f2ec8cb5d8e5265d8804729881b2d58a7d5b5 100755 (executable)
 
                        i2c5_gpio: i2c5-gpio {
                                rockchip,pins = <FUNC_TO_GPIO(EDPHDMII2C_SDA)>, <FUNC_TO_GPIO(EDPHDMII2C_SCL)>;
+                               rockchip,pull = <VALUE_PULL_DOWN>;
                                rockchip,drive = <VALUE_DRV_DEFAULT>;
                        };
                };
index ced94b12f8ecc42bbfb0900e8c77cafbd69eb7dc..3811283c1b96dcfe55502ff0a9ed917819f61e1d 100644 (file)
@@ -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;