summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Huang <kevinh@nvidia.com>2011-10-11 12:24:46 -0700
committerSimone Willett <swillett@nvidia.com>2011-10-13 10:44:01 -0700
commit1e7c1f19763b7eb801d28c1134a212c856cefca4 (patch)
treeca1f727eee7e1aa70813db466b9a8dbfa9f5b96a
parent036969082d6571a26572cfe80f62144be87e732b (diff)
video: tegra: hdmi: Add option to disable HDMI in test function.
Bug 834332 Change-Id: I2f8bfdfd0856d55cc6c2663e968f7330c5a6d8ac Reviewed-on: http://git-master/r/57362 Reviewed-by: Kevin Huang (Eng-SW) <kevinh@nvidia.com> Tested-by: Kevin Huang (Eng-SW) <kevinh@nvidia.com> Reviewed-by: Jon Mayo <jmayo@nvidia.com>
-rw-r--r--drivers/video/tegra/dc/hdmi.c44
-rw-r--r--drivers/video/tegra/dc/hdmi.h4
2 files changed, 34 insertions, 14 deletions
diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c
index db56e817a5e0..d00d8c94cb90 100644
--- a/drivers/video/tegra/dc/hdmi.c
+++ b/drivers/video/tegra/dc/hdmi.c
@@ -764,31 +764,47 @@ bool tegra_dc_hdmi_detect_config(struct tegra_dc *dc,
}
/* This function is used to enable DC1 and HDMI for the purpose of testing. */
-bool tegra_dc_hdmi_detect_test(struct tegra_dc *dc, unsigned char *edid_ptr)
+bool tegra_dc_hdmi_detect_test(struct tegra_dc *dc,
+ unsigned char *edid_ptr, u32 flags)
{
int err;
struct fb_monspecs specs;
struct tegra_dc_hdmi_data *hdmi = tegra_dc_get_outdata(dc);
- if (!dc || !hdmi || !edid_ptr) {
+ if (!dc || !hdmi) {
dev_err(&dc->ndev->dev, "HDMI test failed to get arguments.\n");
return false;
}
- err = tegra_edid_get_monspecs_test(hdmi->edid, &specs, edid_ptr);
- if (err < 0) {
- dev_err(&dc->ndev->dev, "error reading edid\n");
- goto fail;
- }
+ if (flags && HDMI_TEST_HDMI_ON) {
+ if (!edid_ptr) {
+ dev_err(&dc->ndev->dev, "HDMI test failed."
+ " Please pass edid to test.\n");
+ return false;
+ }
- err = tegra_edid_get_eld(hdmi->edid, &hdmi->eld);
- if (err < 0) {
- dev_err(&dc->ndev->dev, "error populating eld\n");
- goto fail;
- }
- hdmi->eld_retrieved = true;
+ err = tegra_edid_get_monspecs_test(hdmi->edid, &specs,
+ edid_ptr);
+ if (err < 0) {
+ dev_err(&dc->ndev->dev, "error reading edid\n");
+ goto fail;
+ }
- tegra_dc_hdmi_detect_config(dc, &specs);
+ err = tegra_edid_get_eld(hdmi->edid, &hdmi->eld);
+ if (err < 0) {
+ dev_err(&dc->ndev->dev, "error populating eld\n");
+ goto fail;
+ }
+ hdmi->eld_retrieved = true;
+
+ tegra_dc_hdmi_detect_config(dc, &specs);
+ } else {
+ tegra_dc_disable(dc);
+ tegra_fb_update_monspecs(dc->fb, NULL, NULL);
+
+ dc->connected = false;
+ tegra_dc_ext_process_hotplug(dc->ndev->id);
+ }
return true;
diff --git a/drivers/video/tegra/dc/hdmi.h b/drivers/video/tegra/dc/hdmi.h
index 702ab16e87f0..c57b5830f293 100644
--- a/drivers/video/tegra/dc/hdmi.h
+++ b/drivers/video/tegra/dc/hdmi.h
@@ -29,6 +29,10 @@
#define HDMI_INFOFRAME_TYPE_MPEG_SRC 0x85
#define HDMI_INFOFRAME_TYPE_NTSC_VBI 0x86
+/* Define HDMI test flags */
+#define HDMI_TEST_HDMI_OFF (0 << 0)
+#define HDMI_TEST_HDMI_ON (1 << 0)
+
/* all fields little endian */
struct hdmi_avi_infoframe {
/* PB0 */