video: tegra: add debouncing to hdmi hotplug
authorErik Gilling <konkers@android.com>
Mon, 11 Apr 2011 22:15:15 +0000 (15:15 -0700)
committerErik Gilling <konkers@android.com>
Wed, 13 Apr 2011 00:50:11 +0000 (17:50 -0700)
Change-Id: Ic998e183e79faabc36d96720dcbae2640e8cf419
Signed-off-by: Erik Gilling <konkers@android.com>
drivers/video/tegra/dc/hdmi.c

index 8ae17f97ab6fc6db28700369b8e4559ed8092f34..ba2dc19072f997f9d9689e034230d07e5fe312ad 100644 (file)
@@ -494,10 +494,13 @@ static irqreturn_t tegra_dc_hdmi_irq(int irq, void *ptr)
        if (hdmi->suspended) {
                hdmi->hpd_pending = true;
        } else {
+               cancel_delayed_work(&hdmi->work);
                if (tegra_dc_hdmi_hpd(dc))
-                       schedule_delayed_work(&hdmi->work, msecs_to_jiffies(100));
+                       queue_delayed_work(system_nrt_wq, &hdmi->work,
+                                          msecs_to_jiffies(100));
                else
-                       schedule_delayed_work(&hdmi->work, msecs_to_jiffies(0));
+                       queue_delayed_work(system_nrt_wq, &hdmi->work,
+                                          msecs_to_jiffies(30));
        }
        spin_unlock_irqrestore(&hdmi->suspend_lock, flags);
 
@@ -524,9 +527,11 @@ static void tegra_dc_hdmi_resume(struct tegra_dc *dc)
        hdmi->suspended = false;
        if (hdmi->hpd_pending) {
                if (tegra_dc_hdmi_hpd(dc))
-                       schedule_delayed_work(&hdmi->work, msecs_to_jiffies(100));
+                       queue_delayed_work(system_nrt_wq, &hdmi->work,
+                                          msecs_to_jiffies(100));
                else
-                       schedule_delayed_work(&hdmi->work, msecs_to_jiffies(0));
+                       queue_delayed_work(system_nrt_wq, &hdmi->work,
+                                          msecs_to_jiffies(30));
                hdmi->hpd_pending = false;
        }
        spin_unlock_irqrestore(&hdmi->suspend_lock, flags);