summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/hdmi.c
diff options
context:
space:
mode:
authorKevin Huang <kevinh@nvidia.com>2011-10-25 15:29:23 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:49:48 -0800
commit1ae80d7ee8f90aa1889957d3126384628c0187a4 (patch)
tree2a00939509b5dcd47b21c7eeb05131e0bf1cb419 /drivers/video/tegra/dc/hdmi.c
parente1f0b5d69f5ad86b96285361eeb49ec03e54799e (diff)
video: tegra: hdmi: Add support to HDMI test in driver.
Test function is invoked by hdmi test module to test DC1, HDMI and EDID modules. Bug 834332 Reviewed-on: http://git-master/r/56482 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> (cherry picked from commit 8a2ec9a20d88db2f96e17cb7136d81560b989542) Change-Id: I196802fda78a753391298b0c3b6874cedbf1e197 Reviewed-on: http://git-master/r/60467 Reviewed-by: Kevin Huang (Eng-SW) <kevinh@nvidia.com> Tested-by: Kevin Huang (Eng-SW) <kevinh@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Rebase-Id: Raea2dcac0ecfca42b8a2a56461828bcd1c7d055f
Diffstat (limited to 'drivers/video/tegra/dc/hdmi.c')
-rw-r--r--drivers/video/tegra/dc/hdmi.c73
1 files changed, 59 insertions, 14 deletions
diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c
index 708d989b473d..39b5d0272624 100644
--- a/drivers/video/tegra/dc/hdmi.c
+++ b/drivers/video/tegra/dc/hdmi.c
@@ -349,7 +349,7 @@ const struct tegra_hdmi_audio_config tegra_hdmi_audio_88_2k[] = {
{25200000, 11760, 26250, 25000},
{27000000, 11760, 28125, 25000},
{74250000, 9408, 61875, 20000},
- {148500000, 9408, 123750,20000},
+ {148500000, 9408, 123750, 20000},
{0, 0, 0},
};
@@ -734,6 +734,63 @@ static bool tegra_dc_hdmi_hpd(struct tegra_dc *dc)
(sense == TEGRA_DC_OUT_HOTPLUG_LOW && !level);
}
+
+void tegra_dc_hdmi_detect_config(struct tegra_dc *dc,
+ struct fb_monspecs *specs)
+{
+ struct tegra_dc_hdmi_data *hdmi = tegra_dc_get_outdata(dc);
+
+ /* monitors like to lie about these but they are still useful for
+ * detecting aspect ratios
+ */
+ dc->out->h_size = specs->max_x * 1000;
+ dc->out->v_size = specs->max_y * 1000;
+
+ hdmi->dvi = !(specs->misc & FB_MISC_HDMI);
+
+ 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);
+}
+
+/* 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)
+{
+ int err;
+ struct fb_monspecs specs;
+ struct tegra_dc_hdmi_data *hdmi = tegra_dc_get_outdata(dc);
+
+ if (!dc || !hdmi || !edid_ptr) {
+ 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;
+ }
+
+ 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);
+
+ return true;
+
+fail:
+ hdmi->eld_retrieved = false;
+ tegra_nvhdcp_set_plug(hdmi->nvhdcp, 0);
+ return false;
+}
+EXPORT_SYMBOL(tegra_dc_hdmi_detect_test);
+
static bool tegra_dc_hdmi_detect(struct tegra_dc *dc)
{
struct tegra_dc_hdmi_data *hdmi = tegra_dc_get_outdata(dc);
@@ -755,20 +812,8 @@ static bool tegra_dc_hdmi_detect(struct tegra_dc *dc)
goto fail;
}
hdmi->eld_retrieved = true;
- /* monitors like to lie about these but they are still useful for
- * detecting aspect ratios
- */
- dc->out->h_size = specs.max_x * 1000;
- dc->out->v_size = specs.max_y * 1000;
-
- hdmi->dvi = !(specs.misc & FB_MISC_HDMI);
-
- 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);
+ tegra_dc_hdmi_detect_config(dc, &specs);
return true;