diff options
Diffstat (limited to 'drivers/video/tegra/dc/hdmi.c')
-rw-r--r-- | drivers/video/tegra/dc/hdmi.c | 9 |
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) |