From f21385a807eeb331f5f65ffac7d5713d72254c26 Mon Sep 17 00:00:00 2001 From: Manjula Gupta Date: Mon, 1 Aug 2011 16:55:13 +0530 Subject: video: tegra: dc: Update hdmi hot-plug status on resume - Update the upper layer about hdmi removal in suspended state. - Removes the redundant variable hpd_pending. Bug 857122 Bug 872278 Change-Id: I0876f50f6d40401b92e4fd36463437a667580f48 Reviewed-on: http://git-master/r/44326 Reviewed-on: http://git-master/r/51008 Reviewed-by: Annamaria Pyreddy Tested-by: Annamaria Pyreddy --- drivers/video/tegra/dc/hdmi.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c index c58f6e706b85..9850ddc14ec2 100644 --- a/drivers/video/tegra/dc/hdmi.c +++ b/drivers/video/tegra/dc/hdmi.c @@ -64,7 +64,6 @@ struct tegra_dc_hdmi_data { spinlock_t suspend_lock; bool suspended; - bool hpd_pending; bool dvi; }; @@ -624,9 +623,7 @@ static irqreturn_t tegra_dc_hdmi_irq(int irq, void *ptr) unsigned long flags; spin_lock_irqsave(&hdmi->suspend_lock, flags); - if (hdmi->suspended) { - hdmi->hpd_pending = true; - } else { + if (!hdmi->suspended) { cancel_delayed_work(&hdmi->work); if (tegra_dc_hdmi_hpd(dc)) queue_delayed_work(system_nrt_wq, &hdmi->work, @@ -658,18 +655,14 @@ static void tegra_dc_hdmi_resume(struct tegra_dc *dc) spin_lock_irqsave(&hdmi->suspend_lock, flags); hdmi->suspended = false; - if (hdmi->hpd_pending) { - if (tegra_dc_hdmi_hpd(dc)) - queue_delayed_work(system_nrt_wq, &hdmi->work, - msecs_to_jiffies(100)); - else - queue_delayed_work(system_nrt_wq, &hdmi->work, - msecs_to_jiffies(30)); - hdmi->hpd_pending = false; - } else if (tegra_dc_hdmi_hpd(dc)) { /* Check for HDMI Peripheral */ + + if (tegra_dc_hdmi_hpd(dc)) queue_delayed_work(system_nrt_wq, &hdmi->work, - msecs_to_jiffies(100)); - } + msecs_to_jiffies(100)); + else + queue_delayed_work(system_nrt_wq, &hdmi->work, + msecs_to_jiffies(30)); + spin_unlock_irqrestore(&hdmi->suspend_lock, flags); tegra_nvhdcp_resume(hdmi->nvhdcp); } @@ -780,7 +773,6 @@ static int tegra_dc_hdmi_init(struct tegra_dc *dc) hdmi->disp1_clk = disp1_clk; hdmi->disp2_clk = disp2_clk; hdmi->suspended = false; - hdmi->hpd_pending = false; spin_lock_init(&hdmi->suspend_lock); hdmi->hpd_switch.name = "hdmi"; -- cgit v1.2.3