From 3ded215725510cdfdb2050fd5e27f025bea0cb0d Mon Sep 17 00:00:00 2001 From: Zheng Yang Date: Thu, 26 Mar 2015 16:18:38 +0800 Subject: [PATCH] HDMI: rockchip-hdmiv2: Set i2c5_hdmi to gpio mode when suspend and reset it to hdmi ddc mode when system resume. Signed-off-by: Zheng Yang --- .../video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c index af8c8d1e966a..fe23627ac46c 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c @@ -250,6 +250,7 @@ static int rockchip_hdmiv2_fb_event_notify(struct notifier_block *self, int blank_mode = *((int *)event->data); struct hdmi *hdmi = hdmi_dev->hdmi; struct delayed_work *delay_work; + struct pinctrl_state *gpio_state; if (action == FB_EARLY_EVENT_BLANK) { switch (blank_mode) { @@ -265,6 +266,8 @@ static int rockchip_hdmiv2_fb_event_notify(struct notifier_block *self, if (delay_work) flush_delayed_work(delay_work); rockchip_hdmiv2_clk_disable(hdmi_dev); + gpio_state = pinctrl_lookup_state(hdmi_dev->dev->pins->p, "gpio"); + pinctrl_select_state(hdmi_dev->dev->pins->p, gpio_state); } break; } @@ -273,6 +276,8 @@ static int rockchip_hdmiv2_fb_event_notify(struct notifier_block *self, case FB_BLANK_UNBLANK: HDMIDBG("resume hdmi\n"); if (hdmi->sleep) { + pinctrl_select_state(hdmi_dev->dev->pins->p, + hdmi_dev->dev->pins->default_state); rockchip_hdmiv2_clk_enable(hdmi_dev); rockchip_hdmiv2_dev_initial(hdmi_dev); if (hdmi->ops->hdcp_power_on_cb) -- 2.34.1