diff options
author | Sumit Semwal <sumit.semwal@ti.com> | 2010-12-02 06:27:09 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2011-01-10 04:09:54 -0500 |
commit | 8613b0005d315582a988bbeb2249d69df343eb3a (patch) | |
tree | ec414b6cf498ec7a57c2649d20ccbf7f71115a23 | |
parent | d50cd0373ad380fcc7f6fb4e020be4239174756d (diff) |
OMAP: DSS2: Represent DISPC register defines with channel as parameter
On OMAP4, we have a new DISPC channel for Overlay Manager LCD2. There is a set
of regsiters for LCD2 channel similar to the existing LCD channel, like
DISPC_CONTROL2, DISPC_DIVISOR2, DISPC_CONFIG2 and so on.
Introduce new enum members for LCD2 Channel and corresponding Overlay Manager
in display.h.
Represent the following DISPC register defines with channel as a parameter
to differentiate between LCD and LCD2 registers (and also DIGIT in some cases):
DISPC_DEFAULT_COLOR, DISPC_TRANS_COLOR, DISPC_TIMING_H, DISPC_TIMING_V,
DISPC_POL_FREQ, DISPC_DIVISOR, DISPC_SIZE_LCD, DISPC_DATA_CYCLEk,
DISPC_CPR_COEF_R, DISPC_CPR_COEF_G and DISPC_CPR_COEF_B
This parametrization helps in reducing the number of register defines for DISPC.
Replace the existing reads/writes to these registers in this new way.
Also, Introduce defines for registers DISPC_CONTROL2 and DISPC_CONFIG2 which
are used exclusively for LCD2 channel.
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Mukund Mittal <mmittal@ti.com>
Signed-off-by: Samreen <samreen@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
-rw-r--r-- | arch/arm/plat-omap/include/plat/display.h | 2 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 170 |
2 files changed, 84 insertions, 88 deletions
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h index d433baf4e977..586944d8e9e8 100644 --- a/arch/arm/plat-omap/include/plat/display.h +++ b/arch/arm/plat-omap/include/plat/display.h | |||
@@ -64,6 +64,7 @@ enum omap_plane { | |||
64 | enum omap_channel { | 64 | enum omap_channel { |
65 | OMAP_DSS_CHANNEL_LCD = 0, | 65 | OMAP_DSS_CHANNEL_LCD = 0, |
66 | OMAP_DSS_CHANNEL_DIGIT = 1, | 66 | OMAP_DSS_CHANNEL_DIGIT = 1, |
67 | OMAP_DSS_CHANNEL_LCD2 = 2, | ||
67 | }; | 68 | }; |
68 | 69 | ||
69 | enum omap_color_mode { | 70 | enum omap_color_mode { |
@@ -142,6 +143,7 @@ enum omap_dss_display_state { | |||
142 | enum omap_dss_overlay_managers { | 143 | enum omap_dss_overlay_managers { |
143 | OMAP_DSS_OVL_MGR_LCD, | 144 | OMAP_DSS_OVL_MGR_LCD, |
144 | OMAP_DSS_OVL_MGR_TV, | 145 | OMAP_DSS_OVL_MGR_TV, |
146 | OMAP_DSS_OVL_MGR_LCD2, | ||
145 | }; | 147 | }; |
146 | 148 | ||
147 | enum omap_dss_rotation_type { | 149 | enum omap_dss_rotation_type { |
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 4e9ebdecc436..36fadb8e49c3 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -44,34 +44,40 @@ | |||
44 | /* DISPC */ | 44 | /* DISPC */ |
45 | #define DISPC_BASE 0x48050400 | 45 | #define DISPC_BASE 0x48050400 |
46 | 46 | ||
47 | #define DISPC_SZ_REGS SZ_1K | 47 | #define DISPC_SZ_REGS SZ_4K |
48 | 48 | ||
49 | struct dispc_reg { u16 idx; }; | 49 | struct dispc_reg { u16 idx; }; |
50 | 50 | ||
51 | #define DISPC_REG(idx) ((const struct dispc_reg) { idx }) | 51 | #define DISPC_REG(idx) ((const struct dispc_reg) { idx }) |
52 | 52 | ||
53 | /* DISPC common */ | 53 | /* |
54 | * DISPC common registers and | ||
55 | * DISPC channel registers , ch = 0 for LCD, ch = 1 for | ||
56 | * DIGIT, and ch = 2 for LCD2 | ||
57 | */ | ||
54 | #define DISPC_REVISION DISPC_REG(0x0000) | 58 | #define DISPC_REVISION DISPC_REG(0x0000) |
55 | #define DISPC_SYSCONFIG DISPC_REG(0x0010) | 59 | #define DISPC_SYSCONFIG DISPC_REG(0x0010) |
56 | #define DISPC_SYSSTATUS DISPC_REG(0x0014) | 60 | #define DISPC_SYSSTATUS DISPC_REG(0x0014) |
57 | #define DISPC_IRQSTATUS DISPC_REG(0x0018) | 61 | #define DISPC_IRQSTATUS DISPC_REG(0x0018) |
58 | #define DISPC_IRQENABLE DISPC_REG(0x001C) | 62 | #define DISPC_IRQENABLE DISPC_REG(0x001C) |
59 | #define DISPC_CONTROL DISPC_REG(0x0040) | 63 | #define DISPC_CONTROL DISPC_REG(0x0040) |
64 | #define DISPC_CONTROL2 DISPC_REG(0x0238) | ||
60 | #define DISPC_CONFIG DISPC_REG(0x0044) | 65 | #define DISPC_CONFIG DISPC_REG(0x0044) |
66 | #define DISPC_CONFIG2 DISPC_REG(0x0620) | ||
61 | #define DISPC_CAPABLE DISPC_REG(0x0048) | 67 | #define DISPC_CAPABLE DISPC_REG(0x0048) |
62 | #define DISPC_DEFAULT_COLOR0 DISPC_REG(0x004C) | 68 | #define DISPC_DEFAULT_COLOR(ch) DISPC_REG(ch == 0 ? 0x004C : \ |
63 | #define DISPC_DEFAULT_COLOR1 DISPC_REG(0x0050) | 69 | (ch == 1 ? 0x0050 : 0x03AC)) |
64 | #define DISPC_TRANS_COLOR0 DISPC_REG(0x0054) | 70 | #define DISPC_TRANS_COLOR(ch) DISPC_REG(ch == 0 ? 0x0054 : \ |
65 | #define DISPC_TRANS_COLOR1 DISPC_REG(0x0058) | 71 | (ch == 1 ? 0x0058 : 0x03B0)) |
66 | #define DISPC_LINE_STATUS DISPC_REG(0x005C) | 72 | #define DISPC_LINE_STATUS DISPC_REG(0x005C) |
67 | #define DISPC_LINE_NUMBER DISPC_REG(0x0060) | 73 | #define DISPC_LINE_NUMBER DISPC_REG(0x0060) |
68 | #define DISPC_TIMING_H DISPC_REG(0x0064) | 74 | #define DISPC_TIMING_H(ch) DISPC_REG(ch != 2 ? 0x0064 : 0x0400) |
69 | #define DISPC_TIMING_V DISPC_REG(0x0068) | 75 | #define DISPC_TIMING_V(ch) DISPC_REG(ch != 2 ? 0x0068 : 0x0404) |
70 | #define DISPC_POL_FREQ DISPC_REG(0x006C) | 76 | #define DISPC_POL_FREQ(ch) DISPC_REG(ch != 2 ? 0x006C : 0x0408) |
71 | #define DISPC_DIVISOR DISPC_REG(0x0070) | 77 | #define DISPC_DIVISOR(ch) DISPC_REG(ch != 2 ? 0x0070 : 0x040C) |
72 | #define DISPC_GLOBAL_ALPHA DISPC_REG(0x0074) | 78 | #define DISPC_GLOBAL_ALPHA DISPC_REG(0x0074) |
73 | #define DISPC_SIZE_DIG DISPC_REG(0x0078) | 79 | #define DISPC_SIZE_DIG DISPC_REG(0x0078) |
74 | #define DISPC_SIZE_LCD DISPC_REG(0x007C) | 80 | #define DISPC_SIZE_LCD(ch) DISPC_REG(ch != 2 ? 0x007C : 0x03CC) |
75 | 81 | ||
76 | /* DISPC GFX plane */ | 82 | /* DISPC GFX plane */ |
77 | #define DISPC_GFX_BA0 DISPC_REG(0x0080) | 83 | #define DISPC_GFX_BA0 DISPC_REG(0x0080) |
@@ -86,13 +92,12 @@ struct dispc_reg { u16 idx; }; | |||
86 | #define DISPC_GFX_WINDOW_SKIP DISPC_REG(0x00B4) | 92 | #define DISPC_GFX_WINDOW_SKIP DISPC_REG(0x00B4) |
87 | #define DISPC_GFX_TABLE_BA DISPC_REG(0x00B8) | 93 | #define DISPC_GFX_TABLE_BA DISPC_REG(0x00B8) |
88 | 94 | ||
89 | #define DISPC_DATA_CYCLE1 DISPC_REG(0x01D4) | 95 | #define DISPC_DATA_CYCLE1(ch) DISPC_REG(ch != 2 ? 0x01D4 : 0x03C0) |
90 | #define DISPC_DATA_CYCLE2 DISPC_REG(0x01D8) | 96 | #define DISPC_DATA_CYCLE2(ch) DISPC_REG(ch != 2 ? 0x01D8 : 0x03C4) |
91 | #define DISPC_DATA_CYCLE3 DISPC_REG(0x01DC) | 97 | #define DISPC_DATA_CYCLE3(ch) DISPC_REG(ch != 2 ? 0x01DC : 0x03C8) |
92 | 98 | #define DISPC_CPR_COEF_R(ch) DISPC_REG(ch != 2 ? 0x0220 : 0x03BC) | |
93 | #define DISPC_CPR_COEF_R DISPC_REG(0x0220) | 99 | #define DISPC_CPR_COEF_G(ch) DISPC_REG(ch != 2 ? 0x0224 : 0x03B8) |
94 | #define DISPC_CPR_COEF_G DISPC_REG(0x0224) | 100 | #define DISPC_CPR_COEF_B(ch) DISPC_REG(ch != 2 ? 0x0228 : 0x03B4) |
95 | #define DISPC_CPR_COEF_B DISPC_REG(0x0228) | ||
96 | 101 | ||
97 | #define DISPC_GFX_PRELOAD DISPC_REG(0x022C) | 102 | #define DISPC_GFX_PRELOAD DISPC_REG(0x022C) |
98 | 103 | ||
@@ -217,18 +222,18 @@ void dispc_save_context(void) | |||
217 | SR(IRQENABLE); | 222 | SR(IRQENABLE); |
218 | SR(CONTROL); | 223 | SR(CONTROL); |
219 | SR(CONFIG); | 224 | SR(CONFIG); |
220 | SR(DEFAULT_COLOR0); | 225 | SR(DEFAULT_COLOR(0)); |
221 | SR(DEFAULT_COLOR1); | 226 | SR(DEFAULT_COLOR(1)); |
222 | SR(TRANS_COLOR0); | 227 | SR(TRANS_COLOR(0)); |
223 | SR(TRANS_COLOR1); | 228 | SR(TRANS_COLOR(1)); |
224 | SR(LINE_NUMBER); | 229 | SR(LINE_NUMBER); |
225 | SR(TIMING_H); | 230 | SR(TIMING_H(0)); |
226 | SR(TIMING_V); | 231 | SR(TIMING_V(0)); |
227 | SR(POL_FREQ); | 232 | SR(POL_FREQ(0)); |
228 | SR(DIVISOR); | 233 | SR(DIVISOR(0)); |
229 | SR(GLOBAL_ALPHA); | 234 | SR(GLOBAL_ALPHA); |
230 | SR(SIZE_DIG); | 235 | SR(SIZE_DIG); |
231 | SR(SIZE_LCD); | 236 | SR(SIZE_LCD(0)); |
232 | 237 | ||
233 | SR(GFX_BA0); | 238 | SR(GFX_BA0); |
234 | SR(GFX_BA1); | 239 | SR(GFX_BA1); |
@@ -241,13 +246,13 @@ void dispc_save_context(void) | |||
241 | SR(GFX_WINDOW_SKIP); | 246 | SR(GFX_WINDOW_SKIP); |
242 | SR(GFX_TABLE_BA); | 247 | SR(GFX_TABLE_BA); |
243 | 248 | ||
244 | SR(DATA_CYCLE1); | 249 | SR(DATA_CYCLE1(0)); |
245 | SR(DATA_CYCLE2); | 250 | SR(DATA_CYCLE2(0)); |
246 | SR(DATA_CYCLE3); | 251 | SR(DATA_CYCLE3(0)); |
247 | 252 | ||
248 | SR(CPR_COEF_R); | 253 | SR(CPR_COEF_R(0)); |
249 | SR(CPR_COEF_G); | 254 | SR(CPR_COEF_G(0)); |
250 | SR(CPR_COEF_B); | 255 | SR(CPR_COEF_B(0)); |
251 | 256 | ||
252 | SR(GFX_PRELOAD); | 257 | SR(GFX_PRELOAD); |
253 | 258 | ||
@@ -356,18 +361,18 @@ void dispc_restore_context(void) | |||
356 | /*RR(IRQENABLE);*/ | 361 | /*RR(IRQENABLE);*/ |
357 | /*RR(CONTROL);*/ | 362 | /*RR(CONTROL);*/ |
358 | RR(CONFIG); | 363 | RR(CONFIG); |
359 | RR(DEFAULT_COLOR0); | 364 | RR(DEFAULT_COLOR(0)); |
360 | RR(DEFAULT_COLOR1); | 365 | RR(DEFAULT_COLOR(1)); |
361 | RR(TRANS_COLOR0); | 366 | RR(TRANS_COLOR(0)); |
362 | RR(TRANS_COLOR1); | 367 | RR(TRANS_COLOR(1)); |
363 | RR(LINE_NUMBER); | 368 | RR(LINE_NUMBER); |
364 | RR(TIMING_H); | 369 | RR(TIMING_H(0)); |
365 | RR(TIMING_V); | 370 | RR(TIMING_V(0)); |
366 | RR(POL_FREQ); | 371 | RR(POL_FREQ(0)); |
367 | RR(DIVISOR); | 372 | RR(DIVISOR(0)); |
368 | RR(GLOBAL_ALPHA); | 373 | RR(GLOBAL_ALPHA); |
369 | RR(SIZE_DIG); | 374 | RR(SIZE_DIG); |
370 | RR(SIZE_LCD); | 375 | RR(SIZE_LCD(0)); |
371 | 376 | ||
372 | RR(GFX_BA0); | 377 | RR(GFX_BA0); |
373 | RR(GFX_BA1); | 378 | RR(GFX_BA1); |
@@ -380,13 +385,13 @@ void dispc_restore_context(void) | |||
380 | RR(GFX_WINDOW_SKIP); | 385 | RR(GFX_WINDOW_SKIP); |
381 | RR(GFX_TABLE_BA); | 386 | RR(GFX_TABLE_BA); |
382 | 387 | ||
383 | RR(DATA_CYCLE1); | 388 | RR(DATA_CYCLE1(0)); |
384 | RR(DATA_CYCLE2); | 389 | RR(DATA_CYCLE2(0)); |
385 | RR(DATA_CYCLE3); | 390 | RR(DATA_CYCLE3(0)); |
386 | 391 | ||
387 | RR(CPR_COEF_R); | 392 | RR(CPR_COEF_R(0)); |
388 | RR(CPR_COEF_G); | 393 | RR(CPR_COEF_G(0)); |
389 | RR(CPR_COEF_B); | 394 | RR(CPR_COEF_B(0)); |
390 | 395 | ||
391 | RR(GFX_PRELOAD); | 396 | RR(GFX_PRELOAD); |
392 | 397 | ||
@@ -942,7 +947,7 @@ void dispc_set_lcd_size(u16 width, u16 height) | |||
942 | BUG_ON((width > (1 << 11)) || (height > (1 << 11))); | 947 | BUG_ON((width > (1 << 11)) || (height > (1 << 11))); |
943 | val = FLD_VAL(height - 1, 26, 16) | FLD_VAL(width - 1, 10, 0); | 948 | val = FLD_VAL(height - 1, 26, 16) | FLD_VAL(width - 1, 10, 0); |
944 | enable_clocks(1); | 949 | enable_clocks(1); |
945 | dispc_write_reg(DISPC_SIZE_LCD, val); | 950 | dispc_write_reg(DISPC_SIZE_LCD(OMAP_DSS_CHANNEL_LCD), val); |
946 | enable_clocks(0); | 951 | enable_clocks(0); |
947 | } | 952 | } |
948 | 953 | ||
@@ -1879,25 +1884,20 @@ void dispc_set_loadmode(enum omap_dss_load_mode mode) | |||
1879 | 1884 | ||
1880 | void dispc_set_default_color(enum omap_channel channel, u32 color) | 1885 | void dispc_set_default_color(enum omap_channel channel, u32 color) |
1881 | { | 1886 | { |
1882 | const struct dispc_reg def_reg[] = { DISPC_DEFAULT_COLOR0, | ||
1883 | DISPC_DEFAULT_COLOR1 }; | ||
1884 | |||
1885 | enable_clocks(1); | 1887 | enable_clocks(1); |
1886 | dispc_write_reg(def_reg[channel], color); | 1888 | dispc_write_reg(DISPC_DEFAULT_COLOR(channel), color); |
1887 | enable_clocks(0); | 1889 | enable_clocks(0); |
1888 | } | 1890 | } |
1889 | 1891 | ||
1890 | u32 dispc_get_default_color(enum omap_channel channel) | 1892 | u32 dispc_get_default_color(enum omap_channel channel) |
1891 | { | 1893 | { |
1892 | const struct dispc_reg def_reg[] = { DISPC_DEFAULT_COLOR0, | ||
1893 | DISPC_DEFAULT_COLOR1 }; | ||
1894 | u32 l; | 1894 | u32 l; |
1895 | 1895 | ||
1896 | BUG_ON(channel != OMAP_DSS_CHANNEL_DIGIT && | 1896 | BUG_ON(channel != OMAP_DSS_CHANNEL_DIGIT && |
1897 | channel != OMAP_DSS_CHANNEL_LCD); | 1897 | channel != OMAP_DSS_CHANNEL_LCD); |
1898 | 1898 | ||
1899 | enable_clocks(1); | 1899 | enable_clocks(1); |
1900 | l = dispc_read_reg(def_reg[channel]); | 1900 | l = dispc_read_reg(DISPC_DEFAULT_COLOR(channel)); |
1901 | enable_clocks(0); | 1901 | enable_clocks(0); |
1902 | 1902 | ||
1903 | return l; | 1903 | return l; |
@@ -1907,16 +1907,13 @@ void dispc_set_trans_key(enum omap_channel ch, | |||
1907 | enum omap_dss_trans_key_type type, | 1907 | enum omap_dss_trans_key_type type, |
1908 | u32 trans_key) | 1908 | u32 trans_key) |
1909 | { | 1909 | { |
1910 | const struct dispc_reg tr_reg[] = { | ||
1911 | DISPC_TRANS_COLOR0, DISPC_TRANS_COLOR1 }; | ||
1912 | |||
1913 | enable_clocks(1); | 1910 | enable_clocks(1); |
1914 | if (ch == OMAP_DSS_CHANNEL_LCD) | 1911 | if (ch == OMAP_DSS_CHANNEL_LCD) |
1915 | REG_FLD_MOD(DISPC_CONFIG, type, 11, 11); | 1912 | REG_FLD_MOD(DISPC_CONFIG, type, 11, 11); |
1916 | else /* OMAP_DSS_CHANNEL_DIGIT */ | 1913 | else /* OMAP_DSS_CHANNEL_DIGIT */ |
1917 | REG_FLD_MOD(DISPC_CONFIG, type, 13, 13); | 1914 | REG_FLD_MOD(DISPC_CONFIG, type, 13, 13); |
1918 | 1915 | ||
1919 | dispc_write_reg(tr_reg[ch], trans_key); | 1916 | dispc_write_reg(DISPC_TRANS_COLOR(ch), trans_key); |
1920 | enable_clocks(0); | 1917 | enable_clocks(0); |
1921 | } | 1918 | } |
1922 | 1919 | ||
@@ -1924,9 +1921,6 @@ void dispc_get_trans_key(enum omap_channel ch, | |||
1924 | enum omap_dss_trans_key_type *type, | 1921 | enum omap_dss_trans_key_type *type, |
1925 | u32 *trans_key) | 1922 | u32 *trans_key) |
1926 | { | 1923 | { |
1927 | const struct dispc_reg tr_reg[] = { | ||
1928 | DISPC_TRANS_COLOR0, DISPC_TRANS_COLOR1 }; | ||
1929 | |||
1930 | enable_clocks(1); | 1924 | enable_clocks(1); |
1931 | if (type) { | 1925 | if (type) { |
1932 | if (ch == OMAP_DSS_CHANNEL_LCD) | 1926 | if (ch == OMAP_DSS_CHANNEL_LCD) |
@@ -1938,7 +1932,7 @@ void dispc_get_trans_key(enum omap_channel ch, | |||
1938 | } | 1932 | } |
1939 | 1933 | ||
1940 | if (trans_key) | 1934 | if (trans_key) |
1941 | *trans_key = dispc_read_reg(tr_reg[ch]); | 1935 | *trans_key = dispc_read_reg(DISPC_TRANS_COLOR(ch)); |
1942 | enable_clocks(0); | 1936 | enable_clocks(0); |
1943 | } | 1937 | } |
1944 | 1938 | ||
@@ -2119,8 +2113,8 @@ static void _dispc_set_lcd_timings(int hsw, int hfp, int hbp, | |||
2119 | } | 2113 | } |
2120 | 2114 | ||
2121 | enable_clocks(1); | 2115 | enable_clocks(1); |
2122 | dispc_write_reg(DISPC_TIMING_H, timing_h); | 2116 | dispc_write_reg(DISPC_TIMING_H(OMAP_DSS_CHANNEL_LCD), timing_h); |
2123 | dispc_write_reg(DISPC_TIMING_V, timing_v); | 2117 | dispc_write_reg(DISPC_TIMING_V(OMAP_DSS_CHANNEL_LCD), timing_v); |
2124 | enable_clocks(0); | 2118 | enable_clocks(0); |
2125 | } | 2119 | } |
2126 | 2120 | ||
@@ -2161,7 +2155,7 @@ static void dispc_set_lcd_divisor(u16 lck_div, u16 pck_div) | |||
2161 | BUG_ON(pck_div < 2); | 2155 | BUG_ON(pck_div < 2); |
2162 | 2156 | ||
2163 | enable_clocks(1); | 2157 | enable_clocks(1); |
2164 | dispc_write_reg(DISPC_DIVISOR, | 2158 | dispc_write_reg(DISPC_DIVISOR(OMAP_DSS_CHANNEL_LCD), |
2165 | FLD_VAL(lck_div, 23, 16) | FLD_VAL(pck_div, 7, 0)); | 2159 | FLD_VAL(lck_div, 23, 16) | FLD_VAL(pck_div, 7, 0)); |
2166 | enable_clocks(0); | 2160 | enable_clocks(0); |
2167 | } | 2161 | } |
@@ -2169,7 +2163,7 @@ static void dispc_set_lcd_divisor(u16 lck_div, u16 pck_div) | |||
2169 | static void dispc_get_lcd_divisor(int *lck_div, int *pck_div) | 2163 | static void dispc_get_lcd_divisor(int *lck_div, int *pck_div) |
2170 | { | 2164 | { |
2171 | u32 l; | 2165 | u32 l; |
2172 | l = dispc_read_reg(DISPC_DIVISOR); | 2166 | l = dispc_read_reg(DISPC_DIVISOR(OMAP_DSS_CHANNEL_LCD)); |
2173 | *lck_div = FLD_GET(l, 23, 16); | 2167 | *lck_div = FLD_GET(l, 23, 16); |
2174 | *pck_div = FLD_GET(l, 7, 0); | 2168 | *pck_div = FLD_GET(l, 7, 0); |
2175 | } | 2169 | } |
@@ -2195,7 +2189,7 @@ unsigned long dispc_lclk_rate(void) | |||
2195 | unsigned long r; | 2189 | unsigned long r; |
2196 | u32 l; | 2190 | u32 l; |
2197 | 2191 | ||
2198 | l = dispc_read_reg(DISPC_DIVISOR); | 2192 | l = dispc_read_reg(DISPC_DIVISOR(OMAP_DSS_CHANNEL_LCD)); |
2199 | 2193 | ||
2200 | lcd = FLD_GET(l, 23, 16); | 2194 | lcd = FLD_GET(l, 23, 16); |
2201 | 2195 | ||
@@ -2210,7 +2204,7 @@ unsigned long dispc_pclk_rate(void) | |||
2210 | unsigned long r; | 2204 | unsigned long r; |
2211 | u32 l; | 2205 | u32 l; |
2212 | 2206 | ||
2213 | l = dispc_read_reg(DISPC_DIVISOR); | 2207 | l = dispc_read_reg(DISPC_DIVISOR(OMAP_DSS_CHANNEL_LCD)); |
2214 | 2208 | ||
2215 | lcd = FLD_GET(l, 23, 16); | 2209 | lcd = FLD_GET(l, 23, 16); |
2216 | pcd = FLD_GET(l, 7, 0); | 2210 | pcd = FLD_GET(l, 7, 0); |
@@ -2297,19 +2291,19 @@ void dispc_dump_regs(struct seq_file *s) | |||
2297 | DUMPREG(DISPC_CONTROL); | 2291 | DUMPREG(DISPC_CONTROL); |
2298 | DUMPREG(DISPC_CONFIG); | 2292 | DUMPREG(DISPC_CONFIG); |
2299 | DUMPREG(DISPC_CAPABLE); | 2293 | DUMPREG(DISPC_CAPABLE); |
2300 | DUMPREG(DISPC_DEFAULT_COLOR0); | 2294 | DUMPREG(DISPC_DEFAULT_COLOR(0)); |
2301 | DUMPREG(DISPC_DEFAULT_COLOR1); | 2295 | DUMPREG(DISPC_DEFAULT_COLOR(1)); |
2302 | DUMPREG(DISPC_TRANS_COLOR0); | 2296 | DUMPREG(DISPC_TRANS_COLOR(0)); |
2303 | DUMPREG(DISPC_TRANS_COLOR1); | 2297 | DUMPREG(DISPC_TRANS_COLOR(1)); |
2304 | DUMPREG(DISPC_LINE_STATUS); | 2298 | DUMPREG(DISPC_LINE_STATUS); |
2305 | DUMPREG(DISPC_LINE_NUMBER); | 2299 | DUMPREG(DISPC_LINE_NUMBER); |
2306 | DUMPREG(DISPC_TIMING_H); | 2300 | DUMPREG(DISPC_TIMING_H(0)); |
2307 | DUMPREG(DISPC_TIMING_V); | 2301 | DUMPREG(DISPC_TIMING_V(0)); |
2308 | DUMPREG(DISPC_POL_FREQ); | 2302 | DUMPREG(DISPC_POL_FREQ(0)); |
2309 | DUMPREG(DISPC_DIVISOR); | 2303 | DUMPREG(DISPC_DIVISOR(0)); |
2310 | DUMPREG(DISPC_GLOBAL_ALPHA); | 2304 | DUMPREG(DISPC_GLOBAL_ALPHA); |
2311 | DUMPREG(DISPC_SIZE_DIG); | 2305 | DUMPREG(DISPC_SIZE_DIG); |
2312 | DUMPREG(DISPC_SIZE_LCD); | 2306 | DUMPREG(DISPC_SIZE_LCD(0)); |
2313 | 2307 | ||
2314 | DUMPREG(DISPC_GFX_BA0); | 2308 | DUMPREG(DISPC_GFX_BA0); |
2315 | DUMPREG(DISPC_GFX_BA1); | 2309 | DUMPREG(DISPC_GFX_BA1); |
@@ -2323,13 +2317,13 @@ void dispc_dump_regs(struct seq_file *s) | |||
2323 | DUMPREG(DISPC_GFX_WINDOW_SKIP); | 2317 | DUMPREG(DISPC_GFX_WINDOW_SKIP); |
2324 | DUMPREG(DISPC_GFX_TABLE_BA); | 2318 | DUMPREG(DISPC_GFX_TABLE_BA); |
2325 | 2319 | ||
2326 | DUMPREG(DISPC_DATA_CYCLE1); | 2320 | DUMPREG(DISPC_DATA_CYCLE1(0)); |
2327 | DUMPREG(DISPC_DATA_CYCLE2); | 2321 | DUMPREG(DISPC_DATA_CYCLE2(0)); |
2328 | DUMPREG(DISPC_DATA_CYCLE3); | 2322 | DUMPREG(DISPC_DATA_CYCLE3(0)); |
2329 | 2323 | ||
2330 | DUMPREG(DISPC_CPR_COEF_R); | 2324 | DUMPREG(DISPC_CPR_COEF_R(0)); |
2331 | DUMPREG(DISPC_CPR_COEF_G); | 2325 | DUMPREG(DISPC_CPR_COEF_G(0)); |
2332 | DUMPREG(DISPC_CPR_COEF_B); | 2326 | DUMPREG(DISPC_CPR_COEF_B(0)); |
2333 | 2327 | ||
2334 | DUMPREG(DISPC_GFX_PRELOAD); | 2328 | DUMPREG(DISPC_GFX_PRELOAD); |
2335 | 2329 | ||
@@ -2446,7 +2440,7 @@ static void _dispc_set_pol_freq(bool onoff, bool rf, bool ieo, bool ipc, | |||
2446 | l |= FLD_VAL(acb, 7, 0); | 2440 | l |= FLD_VAL(acb, 7, 0); |
2447 | 2441 | ||
2448 | enable_clocks(1); | 2442 | enable_clocks(1); |
2449 | dispc_write_reg(DISPC_POL_FREQ, l); | 2443 | dispc_write_reg(DISPC_POL_FREQ(OMAP_DSS_CHANNEL_LCD), l); |
2450 | enable_clocks(0); | 2444 | enable_clocks(0); |
2451 | } | 2445 | } |
2452 | 2446 | ||
@@ -2537,8 +2531,8 @@ int dispc_get_clock_div(struct dispc_clock_info *cinfo) | |||
2537 | 2531 | ||
2538 | fck = dispc_fclk_rate(); | 2532 | fck = dispc_fclk_rate(); |
2539 | 2533 | ||
2540 | cinfo->lck_div = REG_GET(DISPC_DIVISOR, 23, 16); | 2534 | cinfo->lck_div = REG_GET(DISPC_DIVISOR(OMAP_DSS_CHANNEL_LCD), 23, 16); |
2541 | cinfo->pck_div = REG_GET(DISPC_DIVISOR, 7, 0); | 2535 | cinfo->pck_div = REG_GET(DISPC_DIVISOR(OMAP_DSS_CHANNEL_LCD), 7, 0); |
2542 | 2536 | ||
2543 | cinfo->lck = fck / cinfo->lck_div; | 2537 | cinfo->lck = fck / cinfo->lck_div; |
2544 | cinfo->pck = cinfo->lck / cinfo->pck_div; | 2538 | cinfo->pck = cinfo->lck / cinfo->pck_div; |