diff options
author | Murthy, Raghuveer <raghuveer.murthy@ti.com> | 2011-03-03 10:27:59 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-03-11 08:46:29 -0500 |
commit | ce7fa5eb1e815e79e4dd5db42d0d1f8c9d96925b (patch) | |
tree | 411345171ad2f54af2e547f97c4718d9551c9e6f /drivers/video/omap2/dss/dispc.c | |
parent | 5c6366e14d9d4466ae34a1ccbc08dd8738909c1f (diff) |
OMAP: DSS2: Renaming register macro DISPC_DIVISOR(ch)
The OMAP4 DISPC_DIVISOR1 is backward compatible to OMAP3xxx DISPC_DIVISOR.
However DISPC_DIVISOR is also provided in OMAP4, to control DISPC_CORE_CLK
independent of Primary and Secondary display clocks.
Renamed DISPC_DIVISOR(ch) to DISPC_DIVISORo(ch), to facilitate introduction
of DISPC_DIVISOR register, which is specific for OMAP4. OMAP4 has 3 registers
DISPC_DIVISOR, DISPC_DIVISOR1 and DISPC_DIVISOR2.
Also updated, all the usages of DISPC_DIVISOR(ch) to DISPC_DIVISORo(ch).
Use DISPC_DIVISORo(ch) when DISPC_DIVISOR1 or DISPC_DIVISOR2 has to be
configured
OMAP4 TRM uses DISPC_DIVISORo generically to refer to DISPC_DIVISOR1 and
DISPC_DIVISOR2
Signed-off-by: Raghuveer Murthy <raghuveer.murthy@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dispc.c')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 9fb11c17623f..a3dff5ffdcbb 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -73,7 +73,7 @@ struct dispc_reg { u16 idx; }; | |||
73 | #define DISPC_TIMING_H(ch) DISPC_REG(ch != 2 ? 0x0064 : 0x0400) | 73 | #define DISPC_TIMING_H(ch) DISPC_REG(ch != 2 ? 0x0064 : 0x0400) |
74 | #define DISPC_TIMING_V(ch) DISPC_REG(ch != 2 ? 0x0068 : 0x0404) | 74 | #define DISPC_TIMING_V(ch) DISPC_REG(ch != 2 ? 0x0068 : 0x0404) |
75 | #define DISPC_POL_FREQ(ch) DISPC_REG(ch != 2 ? 0x006C : 0x0408) | 75 | #define DISPC_POL_FREQ(ch) DISPC_REG(ch != 2 ? 0x006C : 0x0408) |
76 | #define DISPC_DIVISOR(ch) DISPC_REG(ch != 2 ? 0x0070 : 0x040C) | 76 | #define DISPC_DIVISORo(ch) DISPC_REG(ch != 2 ? 0x0070 : 0x040C) |
77 | #define DISPC_GLOBAL_ALPHA DISPC_REG(0x0074) | 77 | #define DISPC_GLOBAL_ALPHA DISPC_REG(0x0074) |
78 | #define DISPC_SIZE_DIG DISPC_REG(0x0078) | 78 | #define DISPC_SIZE_DIG DISPC_REG(0x0078) |
79 | #define DISPC_SIZE_LCD(ch) DISPC_REG(ch != 2 ? 0x007C : 0x03CC) | 79 | #define DISPC_SIZE_LCD(ch) DISPC_REG(ch != 2 ? 0x007C : 0x03CC) |
@@ -128,6 +128,7 @@ struct dispc_reg { u16 idx; }; | |||
128 | 128 | ||
129 | #define DISPC_VID_PRELOAD(n) DISPC_REG(0x230 + (n)*0x04) | 129 | #define DISPC_VID_PRELOAD(n) DISPC_REG(0x230 + (n)*0x04) |
130 | 130 | ||
131 | #define DISPC_DIVISOR DISPC_REG(0x0804) | ||
131 | 132 | ||
132 | #define DISPC_IRQ_MASK_ERROR (DISPC_IRQ_GFX_FIFO_UNDERFLOW | \ | 133 | #define DISPC_IRQ_MASK_ERROR (DISPC_IRQ_GFX_FIFO_UNDERFLOW | \ |
133 | DISPC_IRQ_OCP_ERR | \ | 134 | DISPC_IRQ_OCP_ERR | \ |
@@ -231,7 +232,7 @@ void dispc_save_context(void) | |||
231 | SR(TIMING_H(0)); | 232 | SR(TIMING_H(0)); |
232 | SR(TIMING_V(0)); | 233 | SR(TIMING_V(0)); |
233 | SR(POL_FREQ(0)); | 234 | SR(POL_FREQ(0)); |
234 | SR(DIVISOR(0)); | 235 | SR(DIVISORo(0)); |
235 | SR(GLOBAL_ALPHA); | 236 | SR(GLOBAL_ALPHA); |
236 | SR(SIZE_DIG); | 237 | SR(SIZE_DIG); |
237 | SR(SIZE_LCD(0)); | 238 | SR(SIZE_LCD(0)); |
@@ -243,7 +244,7 @@ void dispc_save_context(void) | |||
243 | SR(TIMING_H(2)); | 244 | SR(TIMING_H(2)); |
244 | SR(TIMING_V(2)); | 245 | SR(TIMING_V(2)); |
245 | SR(POL_FREQ(2)); | 246 | SR(POL_FREQ(2)); |
246 | SR(DIVISOR(2)); | 247 | SR(DIVISORo(2)); |
247 | SR(CONFIG2); | 248 | SR(CONFIG2); |
248 | } | 249 | } |
249 | 250 | ||
@@ -390,7 +391,7 @@ void dispc_restore_context(void) | |||
390 | RR(TIMING_H(0)); | 391 | RR(TIMING_H(0)); |
391 | RR(TIMING_V(0)); | 392 | RR(TIMING_V(0)); |
392 | RR(POL_FREQ(0)); | 393 | RR(POL_FREQ(0)); |
393 | RR(DIVISOR(0)); | 394 | RR(DIVISORo(0)); |
394 | RR(GLOBAL_ALPHA); | 395 | RR(GLOBAL_ALPHA); |
395 | RR(SIZE_DIG); | 396 | RR(SIZE_DIG); |
396 | RR(SIZE_LCD(0)); | 397 | RR(SIZE_LCD(0)); |
@@ -401,7 +402,7 @@ void dispc_restore_context(void) | |||
401 | RR(TIMING_H(2)); | 402 | RR(TIMING_H(2)); |
402 | RR(TIMING_V(2)); | 403 | RR(TIMING_V(2)); |
403 | RR(POL_FREQ(2)); | 404 | RR(POL_FREQ(2)); |
404 | RR(DIVISOR(2)); | 405 | RR(DIVISORo(2)); |
405 | RR(CONFIG2); | 406 | RR(CONFIG2); |
406 | } | 407 | } |
407 | 408 | ||
@@ -2316,7 +2317,7 @@ static void dispc_set_lcd_divisor(enum omap_channel channel, u16 lck_div, | |||
2316 | BUG_ON(pck_div < 2); | 2317 | BUG_ON(pck_div < 2); |
2317 | 2318 | ||
2318 | enable_clocks(1); | 2319 | enable_clocks(1); |
2319 | dispc_write_reg(DISPC_DIVISOR(channel), | 2320 | dispc_write_reg(DISPC_DIVISORo(channel), |
2320 | FLD_VAL(lck_div, 23, 16) | FLD_VAL(pck_div, 7, 0)); | 2321 | FLD_VAL(lck_div, 23, 16) | FLD_VAL(pck_div, 7, 0)); |
2321 | enable_clocks(0); | 2322 | enable_clocks(0); |
2322 | } | 2323 | } |
@@ -2325,7 +2326,7 @@ static void dispc_get_lcd_divisor(enum omap_channel channel, int *lck_div, | |||
2325 | int *pck_div) | 2326 | int *pck_div) |
2326 | { | 2327 | { |
2327 | u32 l; | 2328 | u32 l; |
2328 | l = dispc_read_reg(DISPC_DIVISOR(channel)); | 2329 | l = dispc_read_reg(DISPC_DIVISORo(channel)); |
2329 | *lck_div = FLD_GET(l, 23, 16); | 2330 | *lck_div = FLD_GET(l, 23, 16); |
2330 | *pck_div = FLD_GET(l, 7, 0); | 2331 | *pck_div = FLD_GET(l, 7, 0); |
2331 | } | 2332 | } |
@@ -2351,7 +2352,7 @@ unsigned long dispc_lclk_rate(enum omap_channel channel) | |||
2351 | unsigned long r; | 2352 | unsigned long r; |
2352 | u32 l; | 2353 | u32 l; |
2353 | 2354 | ||
2354 | l = dispc_read_reg(DISPC_DIVISOR(channel)); | 2355 | l = dispc_read_reg(DISPC_DIVISORo(channel)); |
2355 | 2356 | ||
2356 | lcd = FLD_GET(l, 23, 16); | 2357 | lcd = FLD_GET(l, 23, 16); |
2357 | 2358 | ||
@@ -2366,7 +2367,7 @@ unsigned long dispc_pclk_rate(enum omap_channel channel) | |||
2366 | unsigned long r; | 2367 | unsigned long r; |
2367 | u32 l; | 2368 | u32 l; |
2368 | 2369 | ||
2369 | l = dispc_read_reg(DISPC_DIVISOR(channel)); | 2370 | l = dispc_read_reg(DISPC_DIVISORo(channel)); |
2370 | 2371 | ||
2371 | lcd = FLD_GET(l, 23, 16); | 2372 | lcd = FLD_GET(l, 23, 16); |
2372 | pcd = FLD_GET(l, 7, 0); | 2373 | pcd = FLD_GET(l, 7, 0); |
@@ -2483,7 +2484,7 @@ void dispc_dump_regs(struct seq_file *s) | |||
2483 | DUMPREG(DISPC_TIMING_H(0)); | 2484 | DUMPREG(DISPC_TIMING_H(0)); |
2484 | DUMPREG(DISPC_TIMING_V(0)); | 2485 | DUMPREG(DISPC_TIMING_V(0)); |
2485 | DUMPREG(DISPC_POL_FREQ(0)); | 2486 | DUMPREG(DISPC_POL_FREQ(0)); |
2486 | DUMPREG(DISPC_DIVISOR(0)); | 2487 | DUMPREG(DISPC_DIVISORo(0)); |
2487 | DUMPREG(DISPC_GLOBAL_ALPHA); | 2488 | DUMPREG(DISPC_GLOBAL_ALPHA); |
2488 | DUMPREG(DISPC_SIZE_DIG); | 2489 | DUMPREG(DISPC_SIZE_DIG); |
2489 | DUMPREG(DISPC_SIZE_LCD(0)); | 2490 | DUMPREG(DISPC_SIZE_LCD(0)); |
@@ -2495,7 +2496,7 @@ void dispc_dump_regs(struct seq_file *s) | |||
2495 | DUMPREG(DISPC_TIMING_H(2)); | 2496 | DUMPREG(DISPC_TIMING_H(2)); |
2496 | DUMPREG(DISPC_TIMING_V(2)); | 2497 | DUMPREG(DISPC_TIMING_V(2)); |
2497 | DUMPREG(DISPC_POL_FREQ(2)); | 2498 | DUMPREG(DISPC_POL_FREQ(2)); |
2498 | DUMPREG(DISPC_DIVISOR(2)); | 2499 | DUMPREG(DISPC_DIVISORo(2)); |
2499 | DUMPREG(DISPC_SIZE_LCD(2)); | 2500 | DUMPREG(DISPC_SIZE_LCD(2)); |
2500 | } | 2501 | } |
2501 | 2502 | ||
@@ -2737,8 +2738,8 @@ int dispc_get_clock_div(enum omap_channel channel, | |||
2737 | 2738 | ||
2738 | fck = dispc_fclk_rate(); | 2739 | fck = dispc_fclk_rate(); |
2739 | 2740 | ||
2740 | cinfo->lck_div = REG_GET(DISPC_DIVISOR(channel), 23, 16); | 2741 | cinfo->lck_div = REG_GET(DISPC_DIVISORo(channel), 23, 16); |
2741 | cinfo->pck_div = REG_GET(DISPC_DIVISOR(channel), 7, 0); | 2742 | cinfo->pck_div = REG_GET(DISPC_DIVISORo(channel), 7, 0); |
2742 | 2743 | ||
2743 | cinfo->lck = fck / cinfo->lck_div; | 2744 | cinfo->lck = fck / cinfo->lck_div; |
2744 | cinfo->pck = cinfo->lck / cinfo->pck_div; | 2745 | cinfo->pck = cinfo->lck / cinfo->pck_div; |