summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/hdmi.c
diff options
context:
space:
mode:
authorKevin Huang <kevinh@nvidia.com>2012-12-28 17:11:52 -0800
committerSimone Willett <swillett@nvidia.com>2013-04-11 20:09:36 -0700
commitadc35652d05ce188d5414f5eedf621141e277c8f (patch)
treed358d21a65d49a74d495cbf934602984ee8f287b /drivers/video/tegra/dc/hdmi.c
parent71155af296d98fdff15377dda58389d62ad0f574 (diff)
video: tegra: hdmi: support custom tmds config.
provide the support to set the tmds config according to board file. Bug 1204008 Change-Id: I44babc372d6fc4319c1dca32c34b775f4b6a1f80 Signed-off-by: Kevin Huang <kevinh@nvidia.com> (cherry picked from commit 70206460df252616577b0a0a69884becb66c999d) Reviewed-on: http://git-master/r/215136 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/hdmi.c')
-rw-r--r--drivers/video/tegra/dc/hdmi.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c
index 7391307a4c9c..98ee16c170a4 100644
--- a/drivers/video/tegra/dc/hdmi.c
+++ b/drivers/video/tegra/dc/hdmi.c
@@ -93,6 +93,7 @@ struct tegra_dc_hdmi_data {
#ifdef CONFIG_SWITCH
struct switch_dev hpd_switch;
#endif
+ struct tegra_hdmi_out info;
spinlock_t suspend_lock;
bool suspended;
@@ -107,16 +108,6 @@ struct tegra_dc_hdmi_data {
struct tegra_dc_hdmi_data *dc_hdmi;
-/* table of electrical settings, must be in acending order. */
-struct tdms_config {
- int pclk;
- u32 pll0;
- u32 pll1;
- u32 pe_current; /* pre-emphasis */
- u32 drive_current;
- u32 peak_current; /* for TEGRA_11x_SOC */
-};
-
#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
const struct tdms_config tdms_config[] = {
{ /* 480p modes */
@@ -1026,6 +1017,7 @@ static int tegra_dc_hdmi_init(struct tegra_dc *dc)
struct clk *clk = NULL;
struct clk *disp1_clk = NULL;
struct clk *disp2_clk = NULL;
+ struct tegra_hdmi_out *hdmi_out = NULL;
int err;
hdmi = kzalloc(sizeof(*hdmi), GFP_KERNEL);
@@ -1099,6 +1091,11 @@ static int tegra_dc_hdmi_init(struct tegra_dc *dc)
}
#endif
+ /* Get the pointer of board file settings */
+ hdmi_out = dc->pdata->default_out->hdmi_out;
+ if (hdmi_out)
+ memcpy(&hdmi->info, hdmi_out, sizeof(hdmi->info));
+
hdmi->edid = tegra_edid_create(dc->out->dcc_bus);
if (IS_ERR_OR_NULL(hdmi->edid)) {
dev_err(&dc->ndev->dev, "hdmi: can't create edid\n");
@@ -1900,11 +1897,22 @@ static void tegra_dc_hdmi_enable(struct tegra_dc *dc)
tegra_dc_hdmi_setup_audio_infoframe(dc, hdmi->dvi);
- /* TMDS CONFIG */
- for (i = 0; i < ARRAY_SIZE(tdms_config); i++) {
- if (dc->mode.pclk <= tdms_config[i].pclk) {
- tegra_dc_hdmi_setup_tdms(hdmi, &tdms_config[i]);
- break;
+ /* Set tdms config. Set it to custom values provided in board file;
+ * otherwise, set it to default values. */
+ if (hdmi->info.tdms_config && hdmi->info.n_tdms_config) {
+ for (i = 0; i < hdmi->info.n_tdms_config; i++) {
+ if (dc->mode.pclk <= hdmi->info.tdms_config[i].pclk) {
+ tegra_dc_hdmi_setup_tdms(hdmi,
+ &hdmi->info.tdms_config[i]);
+ break;
+ }
+ }
+ } else {
+ for (i = 0; i < ARRAY_SIZE(tdms_config); i++) {
+ if (dc->mode.pclk <= tdms_config[i].pclk) {
+ tegra_dc_hdmi_setup_tdms(hdmi, &tdms_config[i]);
+ break;
+ }
}
}