upload tizen1.0 source
[kernel/linux-2.6.36.git] / arch / arm / mach-s5pv310 / slp7_cmc623.c
1 /*
2  * CMC623 Setting table for SLP7 Machine.
3  *
4  * Author: InKi Dae  <inki.dae@samsung.com>
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation; either version 2 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19  */
20
21 #include <plat/mdnie.h>
22
23 #define SCR_C8_TN       0x0000  /* kb R SCR */
24 #define SCR_C9_TN       0x3000  /* gc R */
25 #define SCR_CA_TN       0xffff  /* rm R */
26 #define SCR_CB_TN       0xffd0  /* yw R */
27 #define SCR_CC_TN       0x0040  /* kb G */
28 #define SCR_CD_TN       0xffff  /* gc G */
29 #define SCR_CE_TN       0x0000  /* rm G */
30 #define SCR_CF_MSB16_TN 0xf000  /* yw G */
31 #define SCR_D0_TN       0x00a0  /* kb B */
32 #define SCR_D1_TN       0x00ff  /* gc B */
33 #define SCR_D2_TN       0x00ff  /* rm B */
34 #define SCR_D3_TN       0x00d0  /* yw B */
35 #define SCR_CC_DMB_TN   0x0040  /* kb G */
36
37 static const unsigned short cmc623_video_tn[] = {
38         0x0000, 0x0000,         /* BANK 0 */
39         0x0001, 0x0060,         /* SCR LABC */
40         0x002c, 0x0fff,         /* DNR bypass 0x003C */
41         0x002d, 0x1900,         /* DNR bypass 0x0a08 */
42         0x002e, 0x0000,         /* DNR bypass 0x1010 */
43         0x002f, 0x00ff,         /* DNR bypass 0x0400 */
44         0x003A, 0x000D,         /* HDTR DE CS */
45         0x003B, 0x03ff,         /* DE SHARPNESS */
46         0x003C, 0x0000,         /* NOISE LEVEL */
47         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
48         0x00c8, SCR_C8_TN,
49         0x00c9, SCR_C9_TN,
50         0x00ca, SCR_CA_TN,
51         0x00cb, SCR_CB_TN,
52         0x00cc, SCR_CC_TN,
53         0x00cd, SCR_CD_TN,
54         0x00ce, SCR_CE_TN,
55         0x00d0, SCR_D0_TN,
56         0x00d1, SCR_D1_TN,
57         0x00d2, SCR_D2_TN,
58         0x00d3, SCR_D3_TN,
59         END_CMD, 0x0000,
60 };
61
62 static const unsigned short cmc623_video_cabc_tn[] = {
63         0x0000, 0x0000,         /* BANK 0 */
64         0x0001, 0x0070,         /* SCR LABC CABC */
65         0x002c, 0x0fff,         /* DNR bypass 0x003C */
66         0x002d, 0x1900,         /* DNR bypass 0x0a08 */
67         0x002e, 0x0000,         /* DNR bypass 0x1010 */
68         0x002f, 0x00ff,         /* DNR bypass 0x0400 */
69         0x003A, 0x000D,         /* HDTR DE CS */
70         0x003B, 0x03ff,         /* DE SHARPNESS */
71         0x003C, 0x0000,         /* NOISE LEVEL */
72         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
73         0x0072, 0x0000,         /* CABC Dgain */
74         0x0073, 0x0000,
75         0x0074, 0x0000,
76         0x0075, 0x0000,
77         0x007C, 0x0002,         /* Dynamic LCD */
78         0x00c8, SCR_C8_TN,
79         0x00c9, SCR_C9_TN,
80         0x00ca, SCR_CA_TN,
81         0x00cb, SCR_CB_TN,
82         0x00cc, SCR_CC_TN,
83         0x00cd, SCR_CD_TN,
84         0x00ce, SCR_CE_TN,
85         0x00d0, SCR_D0_TN,
86         0x00d1, SCR_D1_TN,
87         0x00d2, SCR_D2_TN,
88         0x00d3, SCR_D3_TN,
89         END_CMD, 0x0000,
90 };
91
92 static const unsigned short cmc623_camera_tn[]= {
93         0x0000, 0x0000,         /* BANK 0 */
94         0x0001, 0x0060,         /* SCR LABC */
95         0x002c, 0x0fff,         /* DNR bypass 0x003C */
96         0x002d, 0x1900,         /* DNR bypass 0x0a08 */
97         0x002e, 0x0000,         /* DNR bypass 0x1010 */
98         0x002f, 0x00ff,         /* DNR bypass 0x0400 */
99         0x003A, 0x000D,         /* HDTR DE CS */
100         0x003B, 0x03ff,         /* DE SHARPNESS */
101         0x003C, 0x0000,         /* NOISE LEVEL */
102         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
103         0x00c8, SCR_C8_TN,
104         0x00c9, SCR_C9_TN,
105         0x00ca, SCR_CA_TN,
106         0x00cb, SCR_CB_TN,
107         0x00cc, SCR_CC_TN,
108         0x00cd, SCR_CD_TN,
109         0x00ce, SCR_CE_TN,
110         0x00d0, SCR_D0_TN,
111         0x00d1, SCR_D1_TN,
112         0x00d2, SCR_D2_TN,
113         0x00d3, SCR_D3_TN,
114         END_CMD, 0x0000,
115 };
116
117 static const unsigned short cmc623_camera_cabc_tn[] = {
118         0x0000, 0x0000,         /* BANK 0 */
119         0x0001, 0x0070,         /* SCR LABC CABC */
120         0x002c, 0x0fff,         /* DNR bypass {0x003C */
121         0x002d, 0x1900,         /* DNR bypass {0x0a08 */
122         0x002e, 0x0000,         /* DNR bypass {0x1010 */
123         0x002f, 0x00ff,         /* DNR bypass {0x0400 */
124         0x003A, 0x000D,         /* HDTR DE CS */
125         0x003B, 0x03ff,         /* DE SHARPNESS */
126         0x003C, 0x0000,         /* NOISE LEVEL */
127         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
128         0x0072, 0x0000,         /* CABC Dgain */
129         0x0073, 0x0000,
130         0x0074, 0x0000,
131         0x0075, 0x0000,
132         0x007C, 0x0002,         /* Dynamic LCD */
133         0x00c8, SCR_C8_TN,
134         0x00c9, SCR_C9_TN,
135         0x00ca, SCR_CA_TN,
136         0x00cb, SCR_CB_TN,
137         0x00cc, SCR_CC_TN,
138         0x00cd, SCR_CD_TN,
139         0x00ce, SCR_CE_TN,
140         0x00d0, SCR_D0_TN,
141         0x00d1, SCR_D1_TN,
142         0x00d2, SCR_D2_TN,
143         0x00d3, SCR_D3_TN,
144         END_CMD, 0x0000,
145 };
146
147 static const unsigned short cmc623_ui_tn[] = {
148         0x0000, 0x0000,         /* BANK 0 */
149         0x0001, 0x0060,         /* SCR LABC */
150         0x002c, 0x0fff,         /* DNR bypass 0x003C */
151         0x002d, 0x1900,         /* DNR bypass 0x0a08 */
152         0x002e, 0x0000,         /* DNR bypass 0x1010 */
153         0x002f, 0x00ff,         /* DNR bypass 0x0400 */
154         0x003A, 0x0009,         /* HDTR (DE D) CS */
155         0x003B, 0x03ff,         /* DE SHARPNESS */
156         0x003C, 0x0000,         /* NOISE LEVEL */
157         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
158         0x00c8, SCR_C8_TN,
159         0x00c9, SCR_C9_TN,
160         0x00ca, SCR_CA_TN,
161         0x00cb, SCR_CB_TN,
162         0x00cc, SCR_CC_TN,
163         0x00cd, SCR_CD_TN,
164         0x00ce, SCR_CE_TN,
165         0x00d0, SCR_D0_TN,
166         0x00d1, SCR_D1_TN,
167         0x00d2, SCR_D2_TN,
168         0x00d3, SCR_D3_TN,
169         END_CMD, 0x0000,
170 };
171
172 static const unsigned short cmc623_ui_cabc_tn[] = {
173         0x0000, 0x0000,         /* BANK 0 */
174         0x0001, 0x0070,         /* SCR LABC CABC */
175         0x002c, 0x0fff,         /* DNR bypass 0x003C */
176         0x002d, 0x1900,         /* DNR bypass 0x0a08 */
177         0x002e, 0x0000,         /* DNR bypass 0x1010 */
178         0x002f, 0x00ff,         /* DNR bypass 0x0400 */
179         0x003A, 0x0009,         /* HDTR (DE D) CS */
180         0x003B, 0x03ff,         /* DE SHARPNESS */
181         0x003C, 0x0000,         /* NOISE LEVEL */
182         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
183         0x0072, 0x0000,         /* CABC Dgain */
184         0x0073, 0x0000,
185         0x0074, 0x0000,
186         0x0075, 0x0000,
187         0x007C, 0x0002,         /* Dynamic LCD */
188         0x00c8, SCR_C8_TN,
189         0x00c9, SCR_C9_TN,
190         0x00ca, SCR_CA_TN,
191         0x00cb, SCR_CB_TN,
192         0x00cc, SCR_CC_TN,
193         0x00cd, SCR_CD_TN,
194         0x00ce, SCR_CE_TN,
195         0x00d0, SCR_D0_TN,
196         0x00d1, SCR_D1_TN,
197         0x00d2, SCR_D2_TN,
198         0x00d3, SCR_D3_TN,
199         END_CMD, 0x0000,
200 };
201
202 static const unsigned short cmc623_vt_tn[] = {
203         0x0000, 0x0000,         /* BANK 0 */
204         0x0001, 0x0060,         /* SCR LABC */
205         0x002c, 0x0fff,         /* DNR bypass,dir_th   0x003c */
206         0x002d, 0x19ff,         /* DNR dir_num,decont7 0x0a08 */
207         0x002e, 0xff16,         /* DNR decont5,mask_th 0x1010 */
208         0x002F, 0x0000,         /* DNR block_th        0x0400 */
209         0x003A, 0x000D,         /* HDTR DE CS */
210         0x003B, 0x03ff,         /* DE SHARPNESS */
211         0x003C, 0x0000,         /* NOISE LEVEL */
212         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
213         0x00c8, SCR_C8_TN,
214         0x00c9, SCR_C9_TN,
215         0x00ca, SCR_CA_TN,
216         0x00cb, SCR_CB_TN,
217         0x00cc, SCR_CC_TN,
218         0x00cd, SCR_CD_TN,
219         0x00ce, SCR_CE_TN,
220         0x00d0, SCR_D0_TN,
221         0x00d1, SCR_D1_TN,
222         0x00d2, SCR_D2_TN,
223         0x00d3, SCR_D3_TN,
224         END_CMD, 0x0000,
225 };
226
227 static const unsigned short cmc623_vt_cabc_tn[] = {
228         0x0000, 0x0000,         /* BANK 0 */
229         0x0001, 0x0070,         /* SCR LABC CABC */
230         0x002c, 0x0fff,         /* DNR bypass,dir_th 0x003c */
231         0x002d, 0x19ff,         /* DNR dir_num,decont7 0x0a08 */
232         0x002e, 0xff16,         /* DNR decont5,mask_th 0x1010 */
233         0x002F, 0x0000,         /* DNR block_th 0x0400 */
234         0x003A, 0x000D,         /* HDTR DE CS */
235         0x003B, 0x03ff,         /* DE SHARPNESS */
236         0x003C, 0x0000,         /* NOISE LEVEL */
237         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
238         0x0072, 0x0000,         /* CABC Dgain */
239         0x0073, 0x0000,
240         0x0074, 0x0000,
241         0x0075, 0x0000,
242         0x007C, 0x0002,         /* Dynamic LCD */
243         0x00c8, SCR_C8_TN,
244         0x00c9, SCR_C9_TN,
245         0x00ca, SCR_CA_TN,
246         0x00cb, SCR_CB_TN,
247         0x00cc, SCR_CC_TN,
248         0x00cd, SCR_CD_TN,
249         0x00ce, SCR_CE_TN,
250         0x00d0, SCR_D0_TN,
251         0x00d1, SCR_D1_TN,
252         0x00d2, SCR_D2_TN,
253         0x00d3, SCR_D3_TN,
254         END_CMD, 0x0000,
255 };
256
257 static const unsigned short cmc623_dmb_tn[] = {
258         0x0000, 0x0000,         /* BANK 0 */
259         0x0001, 0x0060,         /* SCR LABC */
260         0x002c, 0x003c,         /* DNR bypass,dir_th   0x003c */
261         0x002d, 0x0a08,         /* DNR dir_num,decont7 0x0a08 */
262         0x002e, 0x1010,         /* DNR decont5,mask_th 0x1010 */
263         0x002F, 0x0400,         /* DNR block_th        0x0400 */
264         0x003A, 0x000D,         /* HDTR DE CS */
265         0x003B, 0x03ff,         /* DE SHARPNESS */
266         0x003C, 0x0000,         /* NOISE LEVEL */
267         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
268         0x00c8, SCR_C8_TN,
269         0x00c9, SCR_C9_TN,
270         0x00ca, SCR_CA_TN,
271         0x00cb, SCR_CB_TN,
272         0x00cc, SCR_CC_DMB_TN,
273         0x00cd, SCR_CD_TN,
274         0x00ce, SCR_CE_TN,
275         0x00d0, SCR_D0_TN,
276         0x00d1, SCR_D1_TN,
277         0x00d2, SCR_D2_TN,
278         0x00d3, SCR_D3_TN,
279         END_CMD, 0x0000,
280 };
281
282 static const unsigned short cmc623_dmb_cabc_tn[] = {
283         0x0000, 0x0000,         /* BANK 0 */
284         0x0001, 0x0070,         /* SCR LABC CABC */
285         0x002c, 0x003c,         /* DNR bypass,dir_th   0x003c */
286         0x002d, 0x0a08,         /* DNR dir_num,decont7 0x0a08 */
287         0x002e, 0x1010,         /* DNR decont5,mask_th 0x1010 */
288         0x002F, 0x0400,         /* DNR block_th        0x0400 */
289         0x003A, 0x000D,         /* HDTR DE CS */
290         0x003B, 0x03ff,         /* DE SHARPNESS */
291         0x003C, 0x0000,         /* NOISE LEVEL */
292         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
293         0x0072, 0x0000,         /* CABC Dgain */
294         0x0073, 0x0000,
295         0x0074, 0x0000,
296         0x0075, 0x0000,
297         0x007C, 0x0002,         /* Dynamic LCD */
298         0x00c8, SCR_C8_TN,
299         0x00c9, SCR_C9_TN,
300         0x00ca, SCR_CA_TN,
301         0x00cb, SCR_CB_TN,
302         0x00cc, SCR_CC_DMB_TN,
303         0x00cd, SCR_CD_TN,
304         0x00ce, SCR_CE_TN,
305         0x00d0, SCR_D0_TN,
306         0x00d1, SCR_D1_TN,
307         0x00d2, SCR_D2_TN,
308         0x00d3, SCR_D3_TN,
309         END_CMD, 0x0000,
310 };
311
312 static const unsigned short cmc623_gallery_tn[] = {
313         0x0000, 0x0000,         /* BANK 0 */
314         0x0001, 0x0060,         /* SCR LABC */
315         0x002c, 0x0fff,         /* DNR bypass 0x003C */
316         0x002d, 0x1900,         /* DNR bypass 0x0a08 */
317         0x002e, 0x0000,         /* DNR bypass 0x1010 */
318         0x002f, 0x00ff,         /* DNR bypass 0x0400 */
319         0x003A, 0x000D,         /* HDTR DE CS */
320         0x003B, 0x03ff,         /* DE SHARPNESS */
321         0x003C, 0x0000,         /* NOISE LEVEL */
322         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
323         0x00c8, SCR_C8_TN,
324         0x00c9, SCR_C9_TN,
325         0x00ca, SCR_CA_TN,
326         0x00cb, SCR_CB_TN,
327         0x00cc, SCR_CC_TN,
328         0x00cd, SCR_CD_TN,
329         0x00ce, SCR_CE_TN,
330         0x00d0, SCR_D0_TN,
331         0x00d1, SCR_D1_TN,
332         0x00d2, SCR_D2_TN,
333         0x00d3, SCR_D3_TN,
334         END_CMD, 0x0000,
335 };
336
337 static const unsigned short cmc623_gallery_cabc_tn[] = {
338         0x0000, 0x0000,         /* BANK 0 */
339         0x0001, 0x0070,         /* SCR LABC CABC */
340         0x002c, 0x0fff,         /* DNR bypass 0x003C */
341         0x002d, 0x1900,         /* DNR bypass 0x0a08 */
342         0x002e, 0x0000,         /* DNR bypass 0x1010 */
343         0x002f, 0x00ff,         /* DNR bypass 0x0400 */
344         0x003A, 0x000D,         /* HDTR DE CS */
345         0x003B, 0x03ff,         /* DE SHARPNESS */
346         0x003C, 0x0000,         /* NOISE LEVEL */
347         0x0042, 0x0000,         /* DE TH (MAX DIFF) */
348         0x0072, 0x0000,         /* CABC Dgain */
349         0x0073, 0x0000,
350         0x0074, 0x0000,
351         0x0075, 0x0000,
352         0x007C, 0x0002,         /* Dynamic LCD */
353         0x00c8, SCR_C8_TN,
354         0x00c9, SCR_C9_TN,
355         0x00ca, SCR_CA_TN,
356         0x00cb, SCR_CB_TN,
357         0x00cc, SCR_CC_TN,
358         0x00cd, SCR_CD_TN,
359         0x00ce, SCR_CE_TN,
360         0x00d0, SCR_D0_TN,
361         0x00d1, SCR_D1_TN,
362         0x00d2, SCR_D2_TN,
363         0x00d3, SCR_D3_TN,
364         END_CMD, 0x0000,
365 };
366
367 const struct mdnie_tables cmc623_tables = {
368         .tables[CMC623_MODE_UI]         = (unsigned short *)&cmc623_ui_tn,
369         .tables[CMC623_MODE_VIDEO]      = (unsigned short *)&cmc623_video_tn,
370         .tables[CMC623_MODE_CAMERA]     = (unsigned short *)&cmc623_camera_tn,
371         .tables[CMC623_MODE_VT]         = (unsigned short *)&cmc623_vt_tn,
372         .tables[CMC623_MODE_DMB]        = (unsigned short *)&cmc623_dmb_tn,
373         .tables[CMC623_MODE_GALLERY]    = (unsigned short *)&cmc623_gallery_tn,
374
375         /* not used yet. */
376         .cabc_tables[CMC623_MODE_UI]            =
377                 (unsigned short *)&cmc623_ui_cabc_tn,
378         .cabc_tables[CMC623_MODE_VIDEO]         =
379                 (unsigned short *)&cmc623_video_cabc_tn,
380         .cabc_tables[CMC623_MODE_CAMERA]        =
381                 (unsigned short *)&cmc623_camera_cabc_tn,
382         .cabc_tables[CMC623_MODE_VT]            =
383                 (unsigned short *)&cmc623_vt_cabc_tn,
384         .cabc_tables[CMC623_MODE_DMB]           =
385                 (unsigned short *)&cmc623_dmb_cabc_tn,
386         .cabc_tables[CMC623_MODE_GALLERY]       =
387                 (unsigned short *)&cmc623_gallery_cabc_tn,
388 };