video: tegra: dc: power optimize DC and host1x clk
[linux-2.6.git] / drivers / video / tegra / dc / hdmi.c
index 55d9163..9f5968f 100644 (file)
@@ -1462,10 +1462,7 @@ static void tegra_dc_hdmi_detect_worker(struct work_struct *work)
                container_of(to_delayed_work(work), struct tegra_dc_hdmi_data, work);
        struct tegra_dc *dc = hdmi->dc;
 
-       tegra_dc_enable(dc);
-       msleep(5);
        if (!tegra_dc_hdmi_detect(dc)) {
-               tegra_dc_disable(dc);
                tegra_fb_update_monspecs(dc->fb, NULL, NULL);
 
                dc->connected = false;
@@ -1623,21 +1620,11 @@ static int tegra_dc_hdmi_init(struct tegra_dc *dc)
        }
 #endif
 
-       /* TODO: support non-hotplug */
-       if (request_irq(gpio_to_irq(dc->out->hotplug_gpio), tegra_dc_hdmi_irq,
-                       IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
-                       dev_name(&dc->ndev->dev), dc)) {
-               dev_err(&dc->ndev->dev, "hdmi: request_irq %d failed\n",
-                       gpio_to_irq(dc->out->hotplug_gpio));
-               err = -EBUSY;
-               goto err_put_clock;
-       }
-
        hdmi->edid = tegra_edid_create(dc->out->dcc_bus);
        if (IS_ERR_OR_NULL(hdmi->edid)) {
                dev_err(&dc->ndev->dev, "hdmi: can't create edid\n");
                err = PTR_ERR(hdmi->edid);
-               goto err_free_irq;
+               goto err_put_clock;
        }
 
 #ifdef CONFIG_TEGRA_NVHDCP
@@ -1692,14 +1679,23 @@ static int tegra_dc_hdmi_init(struct tegra_dc *dc)
 
        tegra_dc_hdmi_debug_create(hdmi);
 
+       /* TODO: support non-hotplug */
+       if (request_irq(gpio_to_irq(dc->out->hotplug_gpio), tegra_dc_hdmi_irq,
+               IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+               dev_name(&dc->ndev->dev), dc)) {
+               dev_err(&dc->ndev->dev, "hdmi: request_irq %d failed\n",
+                       gpio_to_irq(dc->out->hotplug_gpio));
+               err = -EBUSY;
+               goto err_nvhdcp_destroy;
+       }
+
        return 0;
 
-#ifdef CONFIG_TEGRA_NVHDCP
+err_nvhdcp_destroy:
+       if (hdmi->nvhdcp)
+               tegra_nvhdcp_destroy(hdmi->nvhdcp);
 err_edid_destroy:
        tegra_edid_destroy(hdmi->edid);
-#endif
-err_free_irq:
-       free_irq(gpio_to_irq(dc->out->hotplug_gpio), dc);
 err_put_clock:
 #if !defined(CONFIG_ARCH_TEGRA_2x_SOC)
        if (!IS_ERR_OR_NULL(hdmi->hda2hdmi_clk))