From a32c85a5d149823f71d74fa5c69ae211812280b3 Mon Sep 17 00:00:00 2001 From: Zheng Yang Date: Fri, 1 Aug 2014 13:36:25 +0800 Subject: [PATCH] rk3036 hdmi: When system power up, hdmi irq will be enabled twice for hwc will call fb unblack notifier. So if hdmi is not in suspend mode, it is no need to call rk3036_hdmi_early_resume when fb unblank event is triggered. --- .../rockchip/hdmi/chips/rk3036/rk3036_hdmi.c | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/drivers/video/rockchip/hdmi/chips/rk3036/rk3036_hdmi.c b/drivers/video/rockchip/hdmi/chips/rk3036/rk3036_hdmi.c index d51a3f83baac..df8333b5ba8f 100755 --- a/drivers/video/rockchip/hdmi/chips/rk3036/rk3036_hdmi.c +++ b/drivers/video/rockchip/hdmi/chips/rk3036/rk3036_hdmi.c @@ -141,24 +141,25 @@ static void rk3036_hdmi_early_suspend(void) flush_delayed_work(&hdmi_drv->delay_work); mutex_lock(&hdmi_drv->enable_mutex); - hdmi_drv->suspend = 1; - if (!hdmi_drv->enable) { + if (!hdmi_drv->suspend) { + hdmi_drv->suspend = 1; + if (!hdmi_drv->enable) { + mutex_unlock(&hdmi_drv->enable_mutex); + return; + } + + if (hdmi_drv->irq) + disable_irq(hdmi_drv->irq); + mutex_unlock(&hdmi_drv->enable_mutex); - return; + hdmi_drv->command = HDMI_CONFIG_ENABLE; + init_completion(&hdmi_drv->complete); + hdmi_drv->wait = 1; + queue_delayed_work(hdmi_drv->workqueue, &hdmi_drv->delay_work, 0); + wait_for_completion_interruptible_timeout(&hdmi_drv->complete, + msecs_to_jiffies(5000)); + flush_delayed_work(&hdmi_drv->delay_work); } - - if (hdmi_drv->irq) - disable_irq(hdmi_drv->irq); - - mutex_unlock(&hdmi_drv->enable_mutex); - hdmi_drv->command = HDMI_CONFIG_ENABLE; - init_completion(&hdmi_drv->complete); - hdmi_drv->wait = 1; - queue_delayed_work(hdmi_drv->workqueue, &hdmi_drv->delay_work, 0); - wait_for_completion_interruptible_timeout(&hdmi_drv->complete, - msecs_to_jiffies(5000)); - flush_delayed_work(&hdmi_drv->delay_work); - } static void rk3036_hdmi_early_resume(void) @@ -168,16 +169,17 @@ static void rk3036_hdmi_early_resume(void) hdmi_dbg(hdmi_drv->dev, "hdmi exit early resume\n"); mutex_lock(&hdmi_drv->enable_mutex); - - hdmi_drv->suspend = 0; - rk3036_hdmi_initial(hdmi_drv); - if (hdmi_drv->enable && hdmi_drv->irq) { - enable_irq(hdmi_drv->irq); - rk3036_hdmi_irq(hdmi_drv); + if (hdmi_drv->suspend) { + hdmi_drv->suspend = 0; + rk3036_hdmi_initial(hdmi_drv); + if (hdmi_drv->enable && hdmi_drv->irq) { + enable_irq(hdmi_drv->irq); + rk3036_hdmi_irq(hdmi_drv); + } + + queue_delayed_work(hdmi_drv->workqueue, &hdmi_drv->delay_work, + msecs_to_jiffies(10)); } - - queue_delayed_work(hdmi_drv->workqueue, &hdmi_drv->delay_work, - msecs_to_jiffies(10)); mutex_unlock(&hdmi_drv->enable_mutex); } -- 2.34.1