upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / media / video / s5p-tv / regs-vmx.h
1 /*
2  * Copyright (c) 2010 Samsung Electronics
3  * http://www.samsung.com/
4  *
5  * Mixer register header file for Samsung Mixer driver
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10 */
11 #ifndef __ASM_ARCH_REGS_VMX_H
12 #define __ASM_ARCH_REGS_VMX_H
13
14 /*
15  * Register part
16  */
17 #define MXR_STATUS                      (0x0000)
18 #define MXR_CFG                         (0x0004)
19 #define MXR_INT_EN                      (0x0008)
20 #define MXR_INT_STATUS                  (0x000C)
21 #define MXR_LAYER_CFG                   (0x0010)
22 #define MXR_VIDEO_CFG                   (0x0014)
23 #define MXR_GRAPHIC0_CFG                (0x0020)
24 #define MXR_GRAPHIC0_BASE               (0x0024)
25 #define MXR_GRAPHIC0_SPAN               (0x0028)
26 #define MXR_GRAPHIC0_SXY                (0x002C)
27 #define MXR_GRAPHIC0_WH                 (0x0030)
28 #define MXR_GRAPHIC0_DXY                (0x0034)
29 #define MXR_GRAPHIC0_BLANK              (0x0038)
30 #define MXR_GRAPHIC1_CFG                (0x0040)
31 #define MXR_GRAPHIC1_BASE               (0x0044)
32 #define MXR_GRAPHIC1_SPAN               (0x0048)
33 #define MXR_GRAPHIC1_SXY                (0x004C)
34 #define MXR_GRAPHIC1_WH                 (0x0050)
35 #define MXR_GRAPHIC1_DXY                (0x0054)
36 #define MXR_GRAPHIC1_BLANK              (0x0058)
37 #define MXR_BG_CFG                      (0x0060)
38 #define MXR_BG_COLOR0                   (0x0064)
39 #define MXR_BG_COLOR1                   (0x0068)
40 #define MXR_BG_COLOR2                   (0x006C)
41 #define MXR_CM_COEFF_Y                  (0x0080)
42 #define MXR_CM_COEFF_CB                 (0x0084)
43 #define MXR_CM_COEFF_CR                 (0x0088)
44 #define MXR_VER                         (0x0100)
45
46 /* for parametrized access to registers */
47 #define MXR_GRAPHIC_CFG(i)              (0x0020 + (i) * 0x20)
48 #define MXR_GRAPHIC_BASE(i)             (0x0024 + (i) * 0x20)
49 #define MXR_GRAPHIC_SPAN(i)             (0x0028 + (i) * 0x20)
50 #define MXR_GRAPHIC_SXY(i)              (0x002C + (i) * 0x20)
51 #define MXR_GRAPHIC_WH(i)               (0x0030 + (i) * 0x20)
52 #define MXR_GRAPHIC_DXY(i)              (0x0034 + (i) * 0x20)
53 #define MXR_GRAPHIC_BLANK(i)            (0x0038 + (i) * 0x20)
54
55 /* Shadow registers */
56 #define MXR_STATUS_S                    (0x2000)
57 #define MXR_CFG_S                       (0x2004)
58 #define MXR_LAYER_CFG_S                 (0x2010)
59 #define MXR_VIDEO_CFG_S                 (0x2014)
60 #define MXR_GRAPHIC0_CFG_S              (0x2020)
61 #define MXR_GRAPHIC0_BASE_S             (0x2024)
62 #define MXR_GRAPHIC0_SPAN_S             (0x2028)
63 #define MXR_GRAPHIC0_SXY_S              (0x202C)
64 #define MXR_GRAPHIC0_WH_S               (0x2030)
65 #define MXR_GRAPHIC0_DXY_S              (0x2034)
66 #define MXR_GRAPHIC0_BLANK_PIXEL_S      (0x2038)
67 #define MXR_GRAPHIC1_CFG_S              (0x2040)
68 #define MXR_GRAPHIC1_BASE_S             (0x2044)
69 #define MXR_GRAPHIC1_SPAN_S             (0x2048)
70 #define MXR_GRAPHIC1_SXY_S              (0x204C)
71 #define MXR_GRAPHIC1_WH_S               (0x2050)
72 #define MXR_GRAPHIC1_DXY_S              (0x2054)
73 #define MXR_GRAPHIC1_BLANK_PIXEL_S      (0x2058)
74 #define MXR_BG_COLOR0_S                 (0x2064)
75 #define MXR_BG_COLOR1_S                 (0x2068)
76 #define MXR_BG_COLOR2_S                 (0x206C)
77
78 /* for parametrized access to shadow registers */
79 #define MXR_GRAPHIC_CFG_S(i)            (0x2020 + (i) * 0x20)
80 #define MXR_GRAPHIC_BASE_S(i)           (0x2024 + (i) * 0x20)
81 #define MXR_GRAPHIC_SPAN_S(i)           (0x2028 + (i) * 0x20)
82 #define MXR_GRAPHIC_SXY_S(i)            (0x202C + (i) * 0x20)
83 #define MXR_GRAPHIC_WH_S(i)             (0x2030 + (i) * 0x20)
84 #define MXR_GRAPHIC_DXY_S(i)            (0x2034 + (i) * 0x20)
85 #define MXR_GRAPHIC_BLANK_S(i)          (0x2038 + (i) * 0x20)
86
87 /*
88  * Bit definition part
89  */
90
91 #define MASK(high_bit, low_bit) \
92         (((2 << ((high_bit) - (low_bit))) - 1) << (low_bit))
93
94 #define MASK_VAL(val, high_bit, low_bit) \
95         (((val) << (low_bit)) & MASK(high_bit, low_bit))
96
97 /* MIXER_STATUS */
98 #define MXR_STATUS_16_BURST             (1 << 7)
99 #define MXR_STATUS_8_BURST              (0 << 7)
100 #define MXR_STATUS_BURST_MASK           (1 << 7)
101 #define MXR_STATUS_LITTLE_ENDIAN        (0 << 3)
102 #define MXR_STATUS_BIG_ENDIAN           (1 << 3)
103 #define MXR_STATUS_SYNC_ENABLE          (1 << 2)
104 #define MXR_STATUS_OPERATING            (0 << 1)
105 #define MXR_STATUS_IDLE_MODE            (1 << 1)
106 #define MXR_STATUS_OPERATION_STATUS     (1 << 1)
107 #define MXR_STATUS_REG_RUN              (1 << 0)
108
109 /* MIXER_CFG */
110 #define MXR_CFG_OUT_YUV444              (0 << 8)
111 #define MXR_CFG_OUT_RGB888              (1 << 8)
112 #define MXR_CFG_DST_TV                  (0 << 7)
113 #define MXR_CFG_DST_HDMI                (1 << 7)
114 #define MXR_CFG_HD_720                  (0 << 6)
115 #define MXR_CFG_HD_1080                 (1 << 6)
116 #define MXR_CFG_GRP1_ENABLE             (1 << 5)
117 #define MXR_CFG_GRP0_ENABLE             (1 << 4)
118 #define MXR_CFG_VP_ENABLE               (1 << 3)
119 #define MXR_CFG_SCAN_INTERLACE          (0 << 2)
120 #define MXR_CFG_SCAN_PROGRASSIVE        (1 << 2)
121 #define MXR_CFG_NTSC                    (0 << 1)
122 #define MXR_CFG_PAL                     (1 << 1)
123 #define MXR_CFG_SD                      (0 << 0)
124 #define MXR_CFG_HD                      (1 << 0)
125 #define MXR_CFG_SCAN_MASK               0x47
126
127 /* MIXER_INT_EN */
128 #define MXR_INT_EN_VSYNC                (1 << 11)
129 #define MXR_INT_EN_VP                   (1 << 10)
130 #define MXR_INT_EN_GRP1                 (1 << 9)
131 #define MXR_INT_EN_GRP0                 (1 << 8)
132 #define MXR_INT_EN_ALL                  (0x0f << 8)
133
134 /* MIXER_INT_STATUS */
135 #define MXR_INT_CLEAR_VSYNC             (1 << 11)
136 #define MXR_INT_STATUS_VP               (1 << 10)
137 #define MXR_INT_STATUS_GRP1             (1 << 9)
138 #define MXR_INT_STATUS_GRP0             (1 << 8)
139 #define MXR_INT_STATUS_VSYNC            (1 << 0)
140
141 /* MIXER_LAYER_CFG */
142 #define MXR_LAYER_CFG_GRP1_VAL(x)       MASK_VAL(x, 11, 8)
143 #define MXR_LAYER_CFG_GRP1_HIDE         MASK_VAL(0, 11, 8)
144 #define MXR_LAYER_CFG_GRP0_VAL(x)       MASK_VAL(x, 7, 4)
145 #define MXR_LAYER_CFG_GRP0_HIDE         MASK_VAL(0, 7, 4)
146 #define MXR_LAYER_CFG_VP_VAL(x)         MASK_VAL(x, 3, 0)
147 #define MXR_LAYER_CFG_VP_HIDE           MASK_VAL(0, 3, 0)
148
149 /* MIXER_VIDEO_CFG */
150 #define MXR_VP_CFG_LIMITER_EN           (1 << 17)
151 #define MXR_VP_CFG_BLEND_EN             (1 << 16)
152 #define MXR_VP_CFG_ALPHA_VAL(x)         MASK_VAL(x, 7, 0)
153
154 /* MIXER_GRAPHICn_CFG */
155 #define MXR_GRP_CFG_COLOR_KEY_DISABLE   (1 << 21)
156 #define MXR_GRP_CFG_BLEND_PRE_MUL       (1 << 20)
157 #define MXR_GRP_CFG_BLEND_NORMAL        (0 << 20)
158 #define MXR_GRP_CFG_WIN_BLEND           (1 << 17)
159 #define MXR_GRP_CFG_PIXEL_BLEND         (1 << 16)
160 #define MXR_GRP_CFG_FORMAT_VAL(x)       MASK_VAL(x, 11, 8)
161 #define MXR_GRP_CFG_FORMAT_MASK         MXR_GRP_CFG_FORMAT_VAL(~0)
162 #define MXR_GRP_CFG_ALPHA_VAL(x)        MASK_VAL(x, 7, 0)
163
164 /* MIXER_GRAPHICn_WH */
165 #define MXR_GRP_WH_H_SCALE(x)           MASK_VAL(x, 28, 28)
166 #define MXR_GRP_WH_V_SCALE(x)           MASK_VAL(x, 12, 12)
167 #define MXR_GRP_WH_WIDTH(x)             MASK_VAL(x, 26, 16)
168 #define MXR_GRP_WH_HEIGHT(x)            MASK_VAL(x, 10, 0)
169
170 /* MIXER_GRAPHICn_XY */
171 #define MXR_GRP_SXY_SX(x)               MASK_VAL(x, 26, 16)
172 #define MXR_GRP_SXY_SY(x)               MASK_VAL(x, 10, 0)
173
174 /* MIXER_GRAPHICn_DXY */
175 #define MXR_GRP_DXY_DX(x)               MASK_VAL(x, 26, 16)
176 #define MXR_GRP_DXY_DY(x)               MASK_VAL(x, 10, 0)
177
178 /* MIXER_BG_CFG, Not supported in S5PV210 */
179 #define MXR_BG_CR_DIHER                 (1 << 19)
180 #define MXR_BG_CB_DIHER                 (1 << 18)
181 #define MXR_BG_Y_DIHER                  (1 << 17)
182
183 /* MIXER_BG_COLOR0/1/2 */
184 #define MXR_BG_Y(x)                     MASK_VAL(x, 23, 16)
185 #define MXR_BG_CB(x)                    MASK_VAL(x, 15, 8)
186 #define MXR_BG_CR(x)                    MASK_VAL(x, 7, 0)
187
188 /* MIXER_CM_COEFF_{Y/CB/CR} */
189 #define MXR_CM_COLOR_WIDE               (1 << 30)
190 #define MXR_CM_COLOR_NARROW             (0 << 30)
191 #define MXR_CM_COEF0(x)                 MASK_VAL(x, 29, 20)
192 #define MXR_CM_COEF1(x)                 MASK_VAL(x, 19, 10)
193 #define MXR_CM_COEF2(x)                 MASK_VAL(x, 9, 0)
194
195 #endif /* __ASM_ARCH_REGS_VMX_H */
196