summaryrefslogtreecommitdiff
path: root/drivers/video/omap2/dss/hdmi.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-08-22 13:02:52 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-30 16:16:36 +0300
commit8d88767a4377171752c22ac39bcb2b505eb751da (patch)
tree0de05a263e976824e7f4a6e1f1d8ffb3ca37753e /drivers/video/omap2/dss/hdmi.c
parent9eaaf2076dac213c034c69051dd7a625cd41f56e (diff)
downloadlinux-3.10-8d88767a4377171752c22ac39bcb2b505eb751da.tar.gz
linux-3.10-8d88767a4377171752c22ac39bcb2b505eb751da.tar.bz2
linux-3.10-8d88767a4377171752c22ac39bcb2b505eb751da.zip
OMAP: DSS2: HDMI: use default dividers
Use default regn and regm2 dividers in the hdmi driver if the board file does not define them. Cc: Mythri P K <mythripk@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/hdmi.c')
-rw-r--r--drivers/video/omap2/dss/hdmi.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 8cef940b501..52731b5e10f 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -60,6 +60,9 @@
#define OMAP_HDMI_TIMINGS_NB 34
+#define HDMI_DEFAULT_REGN 15
+#define HDMI_DEFAULT_REGM2 1
+
static struct {
struct mutex lock;
struct omap_display_platform_data *pdata;
@@ -418,7 +421,11 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
* Input clock is predivided by N + 1
* out put of which is reference clk
*/
- pi->regn = dssdev->clocks.hdmi.regn;
+ if (dssdev->clocks.hdmi.regn == 0)
+ pi->regn = HDMI_DEFAULT_REGN;
+ else
+ pi->regn = dssdev->clocks.hdmi.regn;
+
refclk = clkin / (pi->regn + 1);
/*
@@ -426,7 +433,11 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
* Multiplying by 100 to avoid fractional part removal
*/
pi->regm = (phy * 100 / (refclk)) / 100;
- pi->regm2 = dssdev->clocks.hdmi.regm2;
+
+ if (dssdev->clocks.hdmi.regm2 == 0)
+ pi->regm2 = HDMI_DEFAULT_REGM2;
+ else
+ pi->regm2 = dssdev->clocks.hdmi.regm2;
/*
* fractional multiplier is remainder of the difference between