summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/hdmi.c
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:51:56 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:51:56 -0800
commit68529c0f36074be88ee937634fb9433e69c96388 (patch)
tree00c842c0eff6a2b946e1c11a1bdf2d632535e0a7 /drivers/video/tegra/dc/hdmi.c
parentf9a10833c7a12ce1244685eba88848bb88bbd43f (diff)
parent3ac6e2e8106ac304c56b9435c907b2b3bda27a09 (diff)
Merge branch 'korg-android-tegra-3.1' into after-upstream-android
Conflicts: arch/arm/mach-tegra/Kconfig arch/arm/mach-tegra/board-ventana.c drivers/misc/Kconfig drivers/video/tegra/dc/hdmi.c Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/hdmi.c')
-rw-r--r--drivers/video/tegra/dc/hdmi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c
index 90a3fa103135..7df65f275041 100644
--- a/drivers/video/tegra/dc/hdmi.c
+++ b/drivers/video/tegra/dc/hdmi.c
@@ -26,6 +26,7 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
+#include <linux/switch.h>
#include <linux/workqueue.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
@@ -80,6 +81,8 @@ struct tegra_dc_hdmi_data {
struct clk *hda2codec_clk;
struct clk *hda2hdmi_clk;
+ struct switch_dev hpd_switch;
+
spinlock_t suspend_lock;
bool suspended;
bool eld_retrieved;
@@ -752,6 +755,7 @@ void tegra_dc_hdmi_detect_config(struct tegra_dc *dc,
hdmi->dvi = !(specs->misc & FB_MISC_HDMI);
tegra_fb_update_monspecs(dc->fb, specs, tegra_dc_hdmi_mode_filter);
+ switch_set_state(&hdmi->hpd_switch, 1);
dev_info(&dc->ndev->dev, "display detected\n");
dc->connected = true;
@@ -822,6 +826,7 @@ static bool tegra_dc_hdmi_detect(struct tegra_dc *dc)
fail:
hdmi->eld_retrieved = false;
+ switch_set_state(&hdmi->hpd_switch, 0);
tegra_nvhdcp_set_plug(hdmi->nvhdcp, 0);
return false;
}
@@ -1015,6 +1020,9 @@ static int tegra_dc_hdmi_init(struct tegra_dc *dc)
hdmi->audio_source = AUTO;
spin_lock_init(&hdmi->suspend_lock);
+ hdmi->hpd_switch.name = "hdmi";
+ switch_dev_register(&hdmi->hpd_switch);
+
dc->out->depth = 24;
tegra_dc_set_outdata(dc, hdmi);
@@ -1067,6 +1075,7 @@ static void tegra_dc_hdmi_destroy(struct tegra_dc *dc)
free_irq(gpio_to_irq(dc->out->hotplug_gpio), dc);
cancel_delayed_work_sync(&hdmi->work);
+ switch_dev_unregister(&hdmi->hpd_switch);
iounmap(hdmi->base);
release_resource(hdmi->base_res);
#if !defined(CONFIG_ARCH_TEGRA_2x_SOC)