13 #include <linux/kernel.h>
30 static struct wm_info i810_wm_8_100[] = {
31 { 15, 0x0070c000 }, { 19, 0x0070c000 }, { 25, 0x22003000 },
32 { 28, 0x22003000 }, { 31, 0x22003000 }, { 36, 0x22007000 },
33 { 40, 0x22007000 }, { 45, 0x22007000 }, { 49, 0x22008000 },
34 { 50, 0x22008000 }, { 56, 0x22008000 }, { 65, 0x22008000 },
35 { 75, 0x22008000 }, { 78, 0x22008000 }, { 80, 0x22008000 },
36 { 94, 0x22008000 }, { 96, 0x22107000 }, { 99, 0x22107000 },
37 { 108, 0x22107000 }, { 121, 0x22107000 }, { 128, 0x22107000 },
38 { 132, 0x22109000 }, { 135, 0x22109000 }, { 157, 0x2210b000 },
39 { 162, 0x2210b000 }, { 175, 0x2210b000 }, { 189, 0x2220e000 },
40 { 195, 0x2220e000 }, { 202, 0x2220e000 }, { 204, 0x2220e000 },
41 { 218, 0x2220f000 }, { 229, 0x22210000 }, { 234, 0x22210000 },
44 static struct wm_info i810_wm_16_100[] = {
45 { 15, 0x0070c000 }, { 19, 0x0020c000 }, { 25, 0x22006000 },
46 { 28, 0x22006000 }, { 31, 0x22007000 }, { 36, 0x22007000 },
47 { 40, 0x22007000 }, { 45, 0x22007000 }, { 49, 0x22009000 },
48 { 50, 0x22009000 }, { 56, 0x22108000 }, { 65, 0x2210e000 },
49 { 75, 0x2210e000 }, { 78, 0x2210e000 }, { 80, 0x22210000 },
50 { 94, 0x22210000 }, { 96, 0x22210000 }, { 99, 0x22210000 },
51 { 108, 0x22210000 }, { 121, 0x22210000 }, { 128, 0x22210000 },
52 { 132, 0x22314000 }, { 135, 0x22314000 }, { 157, 0x22415000 },
53 { 162, 0x22416000 }, { 175, 0x22416000 }, { 189, 0x22416000 },
54 { 195, 0x22416000 }, { 202, 0x22416000 }, { 204, 0x22416000 },
55 { 218, 0x22416000 }, { 229, 0x22416000 },
58 static struct wm_info i810_wm_24_100[] = {
59 { 15, 0x0020c000 }, { 19, 0x0040c000 }, { 25, 0x22009000 },
60 { 28, 0x22009000 }, { 31, 0x2200a000 }, { 36, 0x2210c000 },
61 { 40, 0x2210c000 }, { 45, 0x2210c000 }, { 49, 0x22111000 },
62 { 50, 0x22111000 }, { 56, 0x22111000 }, { 65, 0x22214000 },
63 { 75, 0x22214000 }, { 78, 0x22215000 }, { 80, 0x22216000 },
64 { 94, 0x22218000 }, { 96, 0x22418000 }, { 99, 0x22418000 },
65 { 108, 0x22418000 }, { 121, 0x22418000 }, { 128, 0x22419000 },
66 { 132, 0x22519000 }, { 135, 0x4441d000 }, { 157, 0x44419000 },
67 { 162, 0x44419000 }, { 175, 0x44419000 }, { 189, 0x44419000 },
68 { 195, 0x44419000 }, { 202, 0x44419000 }, { 204, 0x44419000 },
71 static struct wm_info i810_wm_8_133[] = {
72 { 15, 0x0070c000 }, { 19, 0x0070c000 }, { 25, 0x22003000 },
73 { 28, 0x22003000 }, { 31, 0x22003000 }, { 36, 0x22007000 },
74 { 40, 0x22007000 }, { 45, 0x22007000 }, { 49, 0x22008000 },
75 { 50, 0x22008000 }, { 56, 0x22008000 }, { 65, 0x22008000 },
76 { 75, 0x22008000 }, { 78, 0x22008000 }, { 80, 0x22008000 },
77 { 94, 0x22008000 }, { 96, 0x22107000 }, { 99, 0x22107000 },
78 { 108, 0x22107000 }, { 121, 0x22107000 }, { 128, 0x22107000 },
79 { 132, 0x22109000 }, { 135, 0x22109000 }, { 157, 0x2210b000 },
80 { 162, 0x2210b000 }, { 175, 0x2210b000 }, { 189, 0x2220e000 },
81 { 195, 0x2220e000 }, { 202, 0x2220e000 }, { 204, 0x2220e000 },
82 { 218, 0x2220f000 }, { 229, 0x22210000 }, { 234, 0x22210000 },
85 static struct wm_info i810_wm_16_133[] = {
86 { 15, 0x0020c000 }, { 19, 0x0020c000 }, { 25, 0x22006000 },
87 { 28, 0x22006000 }, { 31, 0x22007000 }, { 36, 0x22007000 },
88 { 40, 0x22007000 }, { 45, 0x22007000 }, { 49, 0x22009000 },
89 { 50, 0x22009000 }, { 56, 0x22108000 }, { 65, 0x2210e000 },
90 { 75, 0x2210e000 }, { 78, 0x2210e000 }, { 80, 0x22210000 },
91 { 94, 0x22210000 }, { 96, 0x22210000 }, { 99, 0x22210000 },
92 { 108, 0x22210000 }, { 121, 0x22210000 }, { 128, 0x22210000 },
93 { 132, 0x22314000 }, { 135, 0x22314000 }, { 157, 0x22415000 },
94 { 162, 0x22416000 }, { 175, 0x22416000 }, { 189, 0x22416000 },
95 { 195, 0x22416000 }, { 202, 0x22416000 }, { 204, 0x22416000 },
96 { 218, 0x22416000 }, { 229, 0x22416000 },
99 static struct wm_info i810_wm_24_133[] = {
100 { 15, 0x0020c000 }, { 19, 0x00408000 }, { 25, 0x22009000 },
101 { 28, 0x22009000 }, { 31, 0x2200a000 }, { 36, 0x2210c000 },
102 { 40, 0x2210c000 }, { 45, 0x2210c000 }, { 49, 0x22111000 },
103 { 50, 0x22111000 }, { 56, 0x22111000 }, { 65, 0x22214000 },
104 { 75, 0x22214000 }, { 78, 0x22215000 }, { 80, 0x22216000 },
105 { 94, 0x22218000 }, { 96, 0x22418000 }, { 99, 0x22418000 },
106 { 108, 0x22418000 }, { 121, 0x22418000 }, { 128, 0x22419000 },
107 { 132, 0x22519000 }, { 135, 0x4441d000 }, { 157, 0x44419000 },
108 { 162, 0x44419000 }, { 175, 0x44419000 }, { 189, 0x44419000 },
109 { 195, 0x44419000 }, { 202, 0x44419000 }, { 204, 0x44419000 },
127 int n, blank_s, blank_e;
136 par->
regs.cr35 = (
u8) ((n >> 8) & 1);
139 par->
regs.cr01 = (
u8) ((xres >> 3) - 1);
145 blank_s = blank_e - 127;
146 if (blank_s < (xres >> 3))
148 par->
regs.cr02 = (
u8) blank_s;
149 par->
regs.cr03 = (
u8) (blank_e & 0x1F);
150 par->
regs.cr05 = (
u8) ((blank_e & (1 << 5)) << 2);
151 par->
regs.cr39 = (
u8) ((blank_e >> 6) & 1);
161 par->
regs.cr06 = (
u8) (n & 0xFF);
162 par->
regs.cr30 = (
u8) ((n >> 8) & 0x0F);
166 par->
regs.cr10 = (
u8) (n & 0xFF);
167 par->
regs.cr32 = (
u8) ((n >> 8) & 0x0F);
174 par->
regs.cr12 = (
u8) (n & 0xFF);
175 par->
regs.cr31 = (
u8) ((n >> 8) & 0x0F);
181 blank_s = blank_e - 127;
184 par->
regs.cr15 = (
u8) (blank_s & 0xFF);
185 par->
regs.cr33 = (
u8) ((blank_s >> 8) & 0x0F);
186 par->
regs.cr16 = (
u8) (blank_e & 0xFF);
203 par->
regs.cr09 |= 1 << 7;
233 wmark = i810_wm_8_100;
237 wmark = i810_wm_16_100;
242 wmark = i810_wm_24_100;
248 wmark = i810_wm_8_133;
252 wmark = i810_wm_16_133;
257 wmark = i810_wm_24_133;
264 for (i = 0; i <
size; i++) {
265 if (pixclock <= wmark[i].
freq)
266 diff = wmark[
i].
freq - pixclock;
268 diff = pixclock - wmark[
i].
freq;
270 wm_best = wmark[
i].
wm;