diff options
author | Robert Morell <rmorell@nvidia.com> | 2011-03-03 15:04:19 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:48:12 -0800 |
commit | 07eb94c5e3f1aa57e3087c6fd9e60536d539286b (patch) | |
tree | d6e726c167350dd68d37ecb235ecdb0e6c735a5b | |
parent | 707fbea6f8769e3d50e3cb32ea4d29329f25bc0d (diff) |
video: tegra: Wire up output connectedness
This makes the core dc driver keep track of whether a particular input
in enabled. It is up to the output ops to maintain the connected status
if a detect op is plugged in, otherwise it is assumed that the output is
always connected.
bug 818525
Original-Change-Id: I794d7e2db347f63bbb1a7d80bca1a53d9d10c210
Signed-off-by: Robert Morell <rmorell@nvidia.com>
Reviewed-on: http://git-master/r/40522
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: Rfeeae486b6a39b95d9f1d95b697132b476735f50
-rw-r--r-- | arch/arm/mach-tegra/include/mach/dc.h | 1 | ||||
-rw-r--r-- | drivers/video/tegra/dc/dc.c | 8 | ||||
-rw-r--r-- | drivers/video/tegra/dc/dc_priv.h | 1 | ||||
-rw-r--r-- | drivers/video/tegra/dc/ext/control.c | 8 | ||||
-rw-r--r-- | drivers/video/tegra/dc/hdmi.c | 2 |
5 files changed, 18 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/include/mach/dc.h b/arch/arm/mach-tegra/include/mach/dc.h index c6f71af86623..bddab09b55de 100644 --- a/arch/arm/mach-tegra/include/mach/dc.h +++ b/arch/arm/mach-tegra/include/mach/dc.h @@ -441,6 +441,7 @@ struct tegra_dc_platform_data { struct tegra_dc *tegra_dc_get_dc(unsigned idx); struct tegra_dc_win *tegra_dc_get_window(struct tegra_dc *dc, unsigned win); +bool tegra_dc_get_connected(struct tegra_dc *); void tegra_dc_enable(struct tegra_dc *dc); void tegra_dc_disable(struct tegra_dc *dc); diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 976770ce8e74..7f671ece3447 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -527,6 +527,12 @@ static int get_topmost_window(u32 *depths, unsigned long *wins) return best; } +bool tegra_dc_get_connected(struct tegra_dc *dc) +{ + return dc->connected; +} +EXPORT_SYMBOL(tegra_dc_get_connected); + static u32 blend_topwin(u32 flags) { if (flags & TEGRA_WIN_FLAG_BLEND_COVERAGE) @@ -2434,6 +2440,8 @@ static int tegra_dc_probe(struct nvhost_device *ndev) if (dc->out_ops && dc->out_ops->detect) dc->out_ops->detect(dc); + else + dc->connected = true; tegra_dc_create_sysfs(&dc->ndev->dev); diff --git a/drivers/video/tegra/dc/dc_priv.h b/drivers/video/tegra/dc/dc_priv.h index e7e86cc9f11f..fd156a7dcb71 100644 --- a/drivers/video/tegra/dc/dc_priv.h +++ b/drivers/video/tegra/dc/dc_priv.h @@ -83,6 +83,7 @@ struct tegra_dc { int emc_clk_rate; int new_emc_clk_rate; + bool connected; bool enabled; bool suspended; diff --git a/drivers/video/tegra/dc/ext/control.c b/drivers/video/tegra/dc/ext/control.c index 65d302f7af58..aab7db45f039 100644 --- a/drivers/video/tegra/dc/ext/control.c +++ b/drivers/video/tegra/dc/ext/control.c @@ -36,6 +36,8 @@ int tegra_dc_ext_process_hotplug(int output) static int get_output_properties(struct tegra_dc_ext_control_output_properties *properties) { + struct tegra_dc *dc; + /* TODO: this should be more dynamic */ if (properties->handle > 2) return -EINVAL; @@ -43,17 +45,19 @@ get_output_properties(struct tegra_dc_ext_control_output_properties *properties) switch (properties->handle) { case 0: properties->type = TEGRA_DC_EXT_LVDS; - properties->connected = 1; break; case 1: properties->type = TEGRA_DC_EXT_HDMI; - properties->connected = 1; break; default: return -EINVAL; } + properties->associated_head = properties->handle; + dc = tegra_dc_get_dc(properties->associated_head); + properties->connected = tegra_dc_get_connected(dc); + return 0; } diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c index bb912d9ff4f0..20d9ec8246ae 100644 --- a/drivers/video/tegra/dc/hdmi.c +++ b/drivers/video/tegra/dc/hdmi.c @@ -745,6 +745,7 @@ static bool tegra_dc_hdmi_detect(struct tegra_dc *dc) tegra_fb_update_monspecs(dc->fb, &specs, tegra_dc_hdmi_mode_filter); dev_info(&dc->ndev->dev, "display detected\n"); + dc->connected = true; tegra_dc_ext_process_hotplug(dc->ndev->id); return true; @@ -768,6 +769,7 @@ static void tegra_dc_hdmi_detect_worker(struct work_struct *work) tegra_dc_disable(dc); tegra_fb_update_monspecs(dc->fb, NULL, NULL); + dc->connected = false; tegra_dc_ext_process_hotplug(dc->ndev->id); } } |