2 * linux/drivers/video/omap2/dss/dispc.h
4 * Copyright (C) 2011 Texas Instruments
5 * Author: Archit Taneja <archit@ti.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published by
10 * the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef __OMAP2_DISPC_REG_H
22 #define __OMAP2_DISPC_REG_H
24 /* DISPC common registers */
25 #define DISPC_REVISION 0x0000
26 #define DISPC_SYSCONFIG 0x0010
27 #define DISPC_SYSSTATUS 0x0014
28 #define DISPC_IRQSTATUS 0x0018
29 #define DISPC_IRQENABLE 0x001C
30 #define DISPC_CONTROL 0x0040
31 #define DISPC_CONFIG 0x0044
32 #define DISPC_CAPABLE 0x0048
33 #define DISPC_LINE_STATUS 0x005C
34 #define DISPC_LINE_NUMBER 0x0060
35 #define DISPC_GLOBAL_ALPHA 0x0074
36 #define DISPC_CONTROL2 0x0238
37 #define DISPC_CONFIG2 0x0620
38 #define DISPC_DIVISOR 0x0804
40 /* DISPC overlay registers */
41 #define DISPC_OVL_BA0(n) (DISPC_OVL_BASE(n) + \
43 #define DISPC_OVL_BA1(n) (DISPC_OVL_BASE(n) + \
45 #define DISPC_OVL_BA0_UV(n) (DISPC_OVL_BASE(n) + \
46 DISPC_BA0_UV_OFFSET(n))
47 #define DISPC_OVL_BA1_UV(n) (DISPC_OVL_BASE(n) + \
48 DISPC_BA1_UV_OFFSET(n))
49 #define DISPC_OVL_POSITION(n) (DISPC_OVL_BASE(n) + \
51 #define DISPC_OVL_SIZE(n) (DISPC_OVL_BASE(n) + \
53 #define DISPC_OVL_ATTRIBUTES(n) (DISPC_OVL_BASE(n) + \
55 #define DISPC_OVL_ATTRIBUTES2(n) (DISPC_OVL_BASE(n) + \
56 DISPC_ATTR2_OFFSET(n))
57 #define DISPC_OVL_FIFO_THRESHOLD(n) (DISPC_OVL_BASE(n) + \
58 DISPC_FIFO_THRESH_OFFSET(n))
59 #define DISPC_OVL_FIFO_SIZE_STATUS(n) (DISPC_OVL_BASE(n) + \
60 DISPC_FIFO_SIZE_STATUS_OFFSET(n))
61 #define DISPC_OVL_ROW_INC(n) (DISPC_OVL_BASE(n) + \
62 DISPC_ROW_INC_OFFSET(n))
63 #define DISPC_OVL_PIXEL_INC(n) (DISPC_OVL_BASE(n) + \
64 DISPC_PIX_INC_OFFSET(n))
65 #define DISPC_OVL_WINDOW_SKIP(n) (DISPC_OVL_BASE(n) + \
66 DISPC_WINDOW_SKIP_OFFSET(n))
67 #define DISPC_OVL_TABLE_BA(n) (DISPC_OVL_BASE(n) + \
68 DISPC_TABLE_BA_OFFSET(n))
69 #define DISPC_OVL_FIR(n) (DISPC_OVL_BASE(n) + \
71 #define DISPC_OVL_FIR2(n) (DISPC_OVL_BASE(n) + \
73 #define DISPC_OVL_PICTURE_SIZE(n) (DISPC_OVL_BASE(n) + \
74 DISPC_PIC_SIZE_OFFSET(n))
75 #define DISPC_OVL_ACCU0(n) (DISPC_OVL_BASE(n) + \
76 DISPC_ACCU0_OFFSET(n))
77 #define DISPC_OVL_ACCU1(n) (DISPC_OVL_BASE(n) + \
78 DISPC_ACCU1_OFFSET(n))
79 #define DISPC_OVL_ACCU2_0(n) (DISPC_OVL_BASE(n) + \
80 DISPC_ACCU2_0_OFFSET(n))
81 #define DISPC_OVL_ACCU2_1(n) (DISPC_OVL_BASE(n) + \
82 DISPC_ACCU2_1_OFFSET(n))
83 #define DISPC_OVL_FIR_COEF_H(n, i) (DISPC_OVL_BASE(n) + \
84 DISPC_FIR_COEF_H_OFFSET(n, i))
85 #define DISPC_OVL_FIR_COEF_HV(n, i) (DISPC_OVL_BASE(n) + \
86 DISPC_FIR_COEF_HV_OFFSET(n, i))
87 #define DISPC_OVL_FIR_COEF_H2(n, i) (DISPC_OVL_BASE(n) + \
88 DISPC_FIR_COEF_H2_OFFSET(n, i))
89 #define DISPC_OVL_FIR_COEF_HV2(n, i) (DISPC_OVL_BASE(n) + \
90 DISPC_FIR_COEF_HV2_OFFSET(n, i))
91 #define DISPC_OVL_CONV_COEF(n, i) (DISPC_OVL_BASE(n) + \
92 DISPC_CONV_COEF_OFFSET(n, i))
93 #define DISPC_OVL_FIR_COEF_V(n, i) (DISPC_OVL_BASE(n) + \
94 DISPC_FIR_COEF_V_OFFSET(n, i))
95 #define DISPC_OVL_FIR_COEF_V2(n, i) (DISPC_OVL_BASE(n) + \
96 DISPC_FIR_COEF_V2_OFFSET(n, i))
97 #define DISPC_OVL_PRELOAD(n) (DISPC_OVL_BASE(n) + \
98 DISPC_PRELOAD_OFFSET(n))
100 /* DISPC manager/channel specific registers */
101 static inline u16 DISPC_DEFAULT_COLOR(enum omap_channel channel)
104 case OMAP_DSS_CHANNEL_LCD:
106 case OMAP_DSS_CHANNEL_DIGIT:
108 case OMAP_DSS_CHANNEL_LCD2:
115 static inline u16 DISPC_TRANS_COLOR(enum omap_channel channel)
118 case OMAP_DSS_CHANNEL_LCD:
120 case OMAP_DSS_CHANNEL_DIGIT:
122 case OMAP_DSS_CHANNEL_LCD2:
129 static inline u16 DISPC_TIMING_H(enum omap_channel channel)
132 case OMAP_DSS_CHANNEL_LCD:
134 case OMAP_DSS_CHANNEL_DIGIT:
136 case OMAP_DSS_CHANNEL_LCD2:
143 static inline u16 DISPC_TIMING_V(enum omap_channel channel)
146 case OMAP_DSS_CHANNEL_LCD:
148 case OMAP_DSS_CHANNEL_DIGIT:
150 case OMAP_DSS_CHANNEL_LCD2:
157 static inline u16 DISPC_POL_FREQ(enum omap_channel channel)
160 case OMAP_DSS_CHANNEL_LCD:
162 case OMAP_DSS_CHANNEL_DIGIT:
164 case OMAP_DSS_CHANNEL_LCD2:
171 static inline u16 DISPC_DIVISORo(enum omap_channel channel)
174 case OMAP_DSS_CHANNEL_LCD:
176 case OMAP_DSS_CHANNEL_DIGIT:
178 case OMAP_DSS_CHANNEL_LCD2:
185 /* Named as DISPC_SIZE_LCD, DISPC_SIZE_DIGIT and DISPC_SIZE_LCD2 in TRM */
186 static inline u16 DISPC_SIZE_MGR(enum omap_channel channel)
189 case OMAP_DSS_CHANNEL_LCD:
191 case OMAP_DSS_CHANNEL_DIGIT:
193 case OMAP_DSS_CHANNEL_LCD2:
200 static inline u16 DISPC_DATA_CYCLE1(enum omap_channel channel)
203 case OMAP_DSS_CHANNEL_LCD:
205 case OMAP_DSS_CHANNEL_DIGIT:
207 case OMAP_DSS_CHANNEL_LCD2:
214 static inline u16 DISPC_DATA_CYCLE2(enum omap_channel channel)
217 case OMAP_DSS_CHANNEL_LCD:
219 case OMAP_DSS_CHANNEL_DIGIT:
221 case OMAP_DSS_CHANNEL_LCD2:
228 static inline u16 DISPC_DATA_CYCLE3(enum omap_channel channel)
231 case OMAP_DSS_CHANNEL_LCD:
233 case OMAP_DSS_CHANNEL_DIGIT:
235 case OMAP_DSS_CHANNEL_LCD2:
242 static inline u16 DISPC_CPR_COEF_R(enum omap_channel channel)
245 case OMAP_DSS_CHANNEL_LCD:
247 case OMAP_DSS_CHANNEL_DIGIT:
249 case OMAP_DSS_CHANNEL_LCD2:
256 static inline u16 DISPC_CPR_COEF_G(enum omap_channel channel)
259 case OMAP_DSS_CHANNEL_LCD:
261 case OMAP_DSS_CHANNEL_DIGIT:
263 case OMAP_DSS_CHANNEL_LCD2:
270 static inline u16 DISPC_CPR_COEF_B(enum omap_channel channel)
273 case OMAP_DSS_CHANNEL_LCD:
275 case OMAP_DSS_CHANNEL_DIGIT:
277 case OMAP_DSS_CHANNEL_LCD2:
284 /* DISPC overlay register base addresses */
285 static inline u16 DISPC_OVL_BASE(enum omap_plane plane)
290 case OMAP_DSS_VIDEO1:
292 case OMAP_DSS_VIDEO2:
299 /* DISPC overlay register offsets */
300 static inline u16 DISPC_BA0_OFFSET(enum omap_plane plane)
304 case OMAP_DSS_VIDEO1:
305 case OMAP_DSS_VIDEO2:
312 static inline u16 DISPC_BA1_OFFSET(enum omap_plane plane)
316 case OMAP_DSS_VIDEO1:
317 case OMAP_DSS_VIDEO2:
324 static inline u16 DISPC_BA0_UV_OFFSET(enum omap_plane plane)
329 case OMAP_DSS_VIDEO1:
331 case OMAP_DSS_VIDEO2:
338 static inline u16 DISPC_BA1_UV_OFFSET(enum omap_plane plane)
343 case OMAP_DSS_VIDEO1:
345 case OMAP_DSS_VIDEO2:
352 static inline u16 DISPC_POS_OFFSET(enum omap_plane plane)
356 case OMAP_DSS_VIDEO1:
357 case OMAP_DSS_VIDEO2:
364 static inline u16 DISPC_SIZE_OFFSET(enum omap_plane plane)
368 case OMAP_DSS_VIDEO1:
369 case OMAP_DSS_VIDEO2:
376 static inline u16 DISPC_ATTR_OFFSET(enum omap_plane plane)
381 case OMAP_DSS_VIDEO1:
382 case OMAP_DSS_VIDEO2:
389 static inline u16 DISPC_ATTR2_OFFSET(enum omap_plane plane)
394 case OMAP_DSS_VIDEO1:
396 case OMAP_DSS_VIDEO2:
403 static inline u16 DISPC_FIFO_THRESH_OFFSET(enum omap_plane plane)
408 case OMAP_DSS_VIDEO1:
409 case OMAP_DSS_VIDEO2:
416 static inline u16 DISPC_FIFO_SIZE_STATUS_OFFSET(enum omap_plane plane)
421 case OMAP_DSS_VIDEO1:
422 case OMAP_DSS_VIDEO2:
429 static inline u16 DISPC_ROW_INC_OFFSET(enum omap_plane plane)
434 case OMAP_DSS_VIDEO1:
435 case OMAP_DSS_VIDEO2:
442 static inline u16 DISPC_PIX_INC_OFFSET(enum omap_plane plane)
447 case OMAP_DSS_VIDEO1:
448 case OMAP_DSS_VIDEO2:
455 static inline u16 DISPC_WINDOW_SKIP_OFFSET(enum omap_plane plane)
460 case OMAP_DSS_VIDEO1:
461 case OMAP_DSS_VIDEO2:
468 static inline u16 DISPC_TABLE_BA_OFFSET(enum omap_plane plane)
473 case OMAP_DSS_VIDEO1:
474 case OMAP_DSS_VIDEO2:
481 static inline u16 DISPC_FIR_OFFSET(enum omap_plane plane)
486 case OMAP_DSS_VIDEO1:
487 case OMAP_DSS_VIDEO2:
494 static inline u16 DISPC_FIR2_OFFSET(enum omap_plane plane)
499 case OMAP_DSS_VIDEO1:
501 case OMAP_DSS_VIDEO2:
508 static inline u16 DISPC_PIC_SIZE_OFFSET(enum omap_plane plane)
513 case OMAP_DSS_VIDEO1:
514 case OMAP_DSS_VIDEO2:
522 static inline u16 DISPC_ACCU0_OFFSET(enum omap_plane plane)
527 case OMAP_DSS_VIDEO1:
528 case OMAP_DSS_VIDEO2:
535 static inline u16 DISPC_ACCU2_0_OFFSET(enum omap_plane plane)
540 case OMAP_DSS_VIDEO1:
542 case OMAP_DSS_VIDEO2:
549 static inline u16 DISPC_ACCU1_OFFSET(enum omap_plane plane)
554 case OMAP_DSS_VIDEO1:
555 case OMAP_DSS_VIDEO2:
562 static inline u16 DISPC_ACCU2_1_OFFSET(enum omap_plane plane)
567 case OMAP_DSS_VIDEO1:
569 case OMAP_DSS_VIDEO2:
576 /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
577 static inline u16 DISPC_FIR_COEF_H_OFFSET(enum omap_plane plane, u16 i)
582 case OMAP_DSS_VIDEO1:
583 case OMAP_DSS_VIDEO2:
584 return 0x0034 + i * 0x8;
590 /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
591 static inline u16 DISPC_FIR_COEF_H2_OFFSET(enum omap_plane plane, u16 i)
596 case OMAP_DSS_VIDEO1:
597 return 0x058C + i * 0x8;
598 case OMAP_DSS_VIDEO2:
599 return 0x0568 + i * 0x8;
605 /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
606 static inline u16 DISPC_FIR_COEF_HV_OFFSET(enum omap_plane plane, u16 i)
611 case OMAP_DSS_VIDEO1:
612 case OMAP_DSS_VIDEO2:
613 return 0x0038 + i * 0x8;
619 /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
620 static inline u16 DISPC_FIR_COEF_HV2_OFFSET(enum omap_plane plane, u16 i)
625 case OMAP_DSS_VIDEO1:
626 return 0x0590 + i * 8;
627 case OMAP_DSS_VIDEO2:
628 return 0x056C + i * 0x8;
634 /* coef index i = {0, 1, 2, 3, 4,} */
635 static inline u16 DISPC_CONV_COEF_OFFSET(enum omap_plane plane, u16 i)
640 case OMAP_DSS_VIDEO1:
641 case OMAP_DSS_VIDEO2:
642 return 0x0074 + i * 0x4;
648 /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
649 static inline u16 DISPC_FIR_COEF_V_OFFSET(enum omap_plane plane, u16 i)
654 case OMAP_DSS_VIDEO1:
655 return 0x0124 + i * 0x4;
656 case OMAP_DSS_VIDEO2:
657 return 0x00B4 + i * 0x4;
663 /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
664 static inline u16 DISPC_FIR_COEF_V2_OFFSET(enum omap_plane plane, u16 i)
669 case OMAP_DSS_VIDEO1:
670 return 0x05CC + i * 0x4;
671 case OMAP_DSS_VIDEO2:
672 return 0x05A8 + i * 0x4;
678 static inline u16 DISPC_PRELOAD_OFFSET(enum omap_plane plane)
683 case OMAP_DSS_VIDEO1:
685 case OMAP_DSS_VIDEO2: