aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-08-22 06:16:24 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-30 09:16:41 -0400
commitb44e45825dbe30f32c770b98c38555b6bd331760 (patch)
treed465a3954443a86e6c0ee1e688b93b78b9c8cbaf /drivers/video
parent8d88767a4377171752c22ac39bcb2b505eb751da (diff)
OMAP: DSS2: HDMI: change regn definition
regn divider is currently programmed to the registers without change, but when calculating clock frequencies it is used as regn+1. To make this similar to how DSI handles the dividers this patch changes the regn value to be used as such for calculations, but the value programmed to registers is regn-1. This simplifies the clock frequency calculations, makes it similar to DSI, and also allows us to use regn value 0 as undefined. Cc: Mythri P K <mythripk@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/hdmi.c6
-rw-r--r--drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 52731b5e10f0..4752137b226a 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -60,7 +60,7 @@
60 60
61#define OMAP_HDMI_TIMINGS_NB 34 61#define OMAP_HDMI_TIMINGS_NB 34
62 62
63#define HDMI_DEFAULT_REGN 15 63#define HDMI_DEFAULT_REGN 16
64#define HDMI_DEFAULT_REGM2 1 64#define HDMI_DEFAULT_REGM2 1
65 65
66static struct { 66static struct {
@@ -426,7 +426,7 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
426 else 426 else
427 pi->regn = dssdev->clocks.hdmi.regn; 427 pi->regn = dssdev->clocks.hdmi.regn;
428 428
429 refclk = clkin / (pi->regn + 1); 429 refclk = clkin / pi->regn;
430 430
431 /* 431 /*
432 * multiplier is pixel_clk/ref_clk 432 * multiplier is pixel_clk/ref_clk
@@ -452,7 +452,7 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
452 * is greater than 1000MHz 452 * is greater than 1000MHz
453 */ 453 */
454 pi->dcofreq = phy > 1000 * 100; 454 pi->dcofreq = phy > 1000 * 100;
455 pi->regsd = ((pi->regm * clkin / 10) / ((pi->regn + 1) * 250) + 5) / 10; 455 pi->regsd = ((pi->regm * clkin / 10) / (pi->regn * 250) + 5) / 10;
456 456
457 /* Set the reference clock to sysclk reference */ 457 /* Set the reference clock to sysclk reference */
458 pi->refsel = HDMI_REFSEL_SYSCLK; 458 pi->refsel = HDMI_REFSEL_SYSCLK;
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
index cb3a2d6753de..403c66241477 100644
--- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
+++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
@@ -92,7 +92,7 @@ static int hdmi_pll_init(struct hdmi_ip_data *ip_data)
92 92
93 r = hdmi_read_reg(pll_base, PLLCTRL_CFG1); 93 r = hdmi_read_reg(pll_base, PLLCTRL_CFG1);
94 r = FLD_MOD(r, fmt->regm, 20, 9); /* CFG1_PLL_REGM */ 94 r = FLD_MOD(r, fmt->regm, 20, 9); /* CFG1_PLL_REGM */
95 r = FLD_MOD(r, fmt->regn, 8, 1); /* CFG1_PLL_REGN */ 95 r = FLD_MOD(r, fmt->regn - 1, 8, 1); /* CFG1_PLL_REGN */
96 96
97 hdmi_write_reg(pll_base, PLLCTRL_CFG1, r); 97 hdmi_write_reg(pll_base, PLLCTRL_CFG1, r);
98 98