30 #include <linux/kernel.h>
33 #include <linux/slab.h>
34 #include <linux/string.h>
36 #include <linux/module.h>
38 #include <asm/uaccess.h>
39 #include <video/w100fb.h>
45 static void w100_suspend(
u32 mode);
46 static void w100_vsync(
void);
48 static void w100_pwm_setup(
struct w100fb_par*);
49 static void w100_init_clocks(
struct w100fb_par*);
50 static void w100_setup_memory(
struct w100fb_par*);
52 static void w100_set_dispregs(
struct w100fb_par*);
53 static void w100_update_enable(
void);
54 static void w100_update_disable(
void);
55 static void calc_hsync(
struct w100fb_par *par);
56 static void w100_init_graphic_engine(
struct w100fb_par *par);
60 #define MAX_PALETTES 16
62 #define W100_SUSPEND_EXTMEM 0
63 #define W100_SUSPEND_ALL 1
65 #define BITS_PER_PIXEL 16
68 static void *remapped_base;
69 static void *remapped_regs;
70 static void *remapped_fbuf;
72 #define REMAPPED_FB_LEN 0x15ffff
77 #define W100_FB_BASE MEM_EXT_BASE_VALUE
104 w100_update_disable();
105 w100_set_dispregs(par);
106 w100_update_enable();
113 static DEVICE_ATTR(flip, 0644, flip_show, flip_store);
119 param =
readl(remapped_regs + regs);
120 printk(
"Read Register 0x%08lX: 0x%08lX\n", regs, param);
129 sscanf(buf,
"%lx %lx", ®s, ¶m);
131 if (regs <= 0x2000) {
132 printk(
"Write Register 0x%08lX: 0x%08lX\n", regs, param);
133 writel(param, remapped_regs + regs);
157 printk(
"w100fb: Using fast system clock (if possible)\n");
160 printk(
"w100fb: Using normal system clock\n");
163 w100_init_clocks(par);
169 static DEVICE_ATTR(fastpllclk, 0644, fastpllclk_show, fastpllclk_store);
188 static void w100fb_clear_screen(
struct w100fb_par *par)
207 if (info->
var.grayscale)
208 red = green = blue = (19595 * red + 38470 * green + 7471 *
blue) >> 16;
217 val = (red & 0xf800) | ((green & 0xfc00) >> 5) | ((blue & 0xf800) >> 11);
228 static int w100fb_blank(
int blank_mode,
struct fb_info *info)
258 static void w100_fifo_wait(
int entries)
263 for (i = 0; i < 2000000; i++) {
265 if (
status.f.cmdfifo_avail >= entries)
273 static int w100fb_sync(
struct fb_info *info)
278 for (i = 0; i < 2000000; i++) {
289 static void w100_init_graphic_engine(
struct w100fb_par *par)
309 dp_cntl.f.dst_x_dir = 1;
310 dp_cntl.f.dst_y_dir = 1;
311 dp_cntl.f.src_x_dir = 1;
312 dp_cntl.f.src_y_dir = 1;
313 dp_cntl.f.dst_major_x = 1;
314 dp_cntl.f.src_major_x = 1;
318 gmc.f.gmc_src_pitch_offset_cntl = 1;
319 gmc.f.gmc_dst_pitch_offset_cntl = 1;
320 gmc.f.gmc_src_clipping = 1;
321 gmc.f.gmc_dst_clipping = 1;
323 gmc.f.gmc_dst_datatype = 3;
325 gmc.f.gmc_byte_pix_order = 1;
326 gmc.f.gmc_default_sel = 0;
329 gmc.f.gmc_clr_cmp_fcn_dis = 1;
330 gmc.f.gmc_wr_msk_dis = 1;
334 dp_datatype.val = dp_mix.val = 0;
335 dp_datatype.f.dp_dst_datatype = gmc.f.gmc_dst_datatype;
336 dp_datatype.f.dp_brush_datatype = gmc.f.gmc_brush_datatype;
337 dp_datatype.f.dp_src2_type = 0;
338 dp_datatype.f.dp_src2_datatype = gmc.f.gmc_src_datatype;
339 dp_datatype.f.dp_src_datatype = gmc.f.gmc_src_datatype;
340 dp_datatype.f.dp_byte_pix_order = gmc.f.gmc_byte_pix_order;
343 dp_mix.f.dp_src_source = gmc.f.gmc_dp_src_source;
344 dp_mix.f.dp_src2_source = 1;
345 dp_mix.f.dp_rop3 = gmc.f.gmc_rop3;
346 dp_mix.f.dp_op = gmc.f.gmc_dp_op;
351 static void w100fb_fillrect(
struct fb_info *info,
377 static void w100fb_copyarea(
struct fb_info *info,
380 u32 dx = area->
dx, dy = area->
dy,
sx = area->
sx, sy = area->
sy;
407 static void w100fb_activate_var(
struct w100fb_par *par)
412 w100_setup_memory(par);
413 w100_init_clocks(par);
414 w100fb_clear_screen(par);
417 w100_update_disable();
419 w100_set_dispregs(par);
420 w100_update_enable();
421 w100_init_graphic_engine(par);
434 static struct w100_mode *w100fb_get_mode(
struct w100fb_par *par,
unsigned int *
x,
unsigned int *
y,
int saveval)
438 unsigned int best_x = 0xffffffff, best_y = 0xffffffff;
441 for (i = 0 ; i < par->
mach->num_modes ; i++) {
442 if (modelist[i].
xres >= *x && modelist[i].
yres >= *y &&
443 modelist[i].
xres < best_x && modelist[i].
yres < best_y) {
444 best_x = modelist[
i].
xres;
445 best_y = modelist[
i].
yres;
447 }
else if(modelist[i].
xres >= *y && modelist[i].
yres >= *x &&
448 modelist[i].
xres < best_y && modelist[i].
yres < best_x) {
449 best_x = modelist[
i].
yres;
450 best_y = modelist[
i].
xres;
455 if (mode && saveval) {
473 if(!w100fb_get_mode(par, &var->
xres, &var->
yres, 1))
490 var->
red.offset = 11;
492 var->
green.offset = 5;
493 var->
green.length = 6;
494 var->
blue.offset = 0;
495 var->
blue.length = 5;
514 static int w100fb_set_par(
struct fb_info *info)
521 par->
mode = w100fb_get_mode(par, &par->
xres, &par->
yres, 0);
524 info->
fix.ypanstep = 0;
525 info->
fix.ywrapstep = 0;
531 info->
fix.smem_len = par->
mach->mem->size+1;
538 w100fb_activate_var(par);
547 static struct fb_ops w100fb_ops = {
549 .fb_check_var = w100fb_check_var,
550 .fb_set_par = w100fb_set_par,
551 .fb_setcolreg = w100fb_setcolreg,
552 .fb_blank = w100fb_blank,
553 .fb_fillrect = w100fb_fillrect,
554 .fb_copyarea = w100fb_copyarea,
556 .fb_sync = w100fb_sync,
560 static void w100fb_save_vidmem(
struct w100fb_par *par)
565 memsize=par->
mach->mem->size;
578 static void w100fb_restore_vidmem(
struct w100fb_par *par)
583 memsize=par->
mach->mem->size;
599 struct fb_info *info = platform_get_drvdata(dev);
603 w100fb_save_vidmem(par);
614 struct fb_info *info = platform_get_drvdata(dev);
619 w100fb_activate_var(par);
620 w100fb_restore_vidmem(par);
628 #define w100fb_suspend NULL
629 #define w100fb_resume NULL
647 if (remapped_base ==
NULL)
652 if (remapped_regs ==
NULL)
663 printk(
"Unknown imageon chip ID\n");
671 if (remapped_fbuf ==
NULL)
681 platform_set_drvdata(pdev, info);
683 inf = pdev->
dev.platform_data;
702 info->
fbops = &w100fb_ops;
711 info->
fix.type_aux = 0;
724 info->
var.xres = par->
mode->yres;
725 info->
var.yres = par->
mode->xres;
728 info->
var.xres = par->
mode->xres;
729 info->
var.yres = par->
mode->yres;
737 info->
var.xres_virtual = info->
var.xres;
738 info->
var.yres_virtual = info->
var.yres;
739 info->
var.pixclock = 0x04;
741 info->
var.grayscale = 0;
742 info->
var.xoffset = info->
var.yoffset = 0;
743 info->
var.accel_flags = 0;
748 if (w100fb_check_var(&info->
var, info) < 0) {
774 if (remapped_fbuf !=
NULL)
776 if (remapped_regs !=
NULL)
778 if (remapped_base !=
NULL)
788 struct fb_info *info = platform_get_drvdata(pdev);
816 static void w100_soft_reset(
void)
825 static void w100_update_disable(
void)
830 disp_db_buf_wr_cntl.
f.db_buf_cntl = 0x1e;
831 disp_db_buf_wr_cntl.f.update_db_buf = 0;
832 disp_db_buf_wr_cntl.f.en_db_buf = 0;
836 static void w100_update_enable(
void)
841 disp_db_buf_wr_cntl.
f.db_buf_cntl = 0x1e;
842 disp_db_buf_wr_cntl.f.update_db_buf = 1;
843 disp_db_buf_wr_cntl.f.en_db_buf = 1;
872 static void w100_hw_init(
struct w100fb_par *par)
891 for (temp32 = 0; temp32 < 10000; temp32++)
900 cif_write_dbg.f.dis_packer_ful_during_rbbm_timeout = 0;
901 cif_write_dbg.f.en_dword_split_to_rbbm = 1;
902 cif_write_dbg.f.dis_timeout_during_rbbm = 1;
906 cif_read_dbg.f.dis_rd_same_byte_to_trig_fetch = 1;
910 cif_cntl.f.dis_system_bits = 1;
911 cif_cntl.f.dis_mr = 1;
912 cif_cntl.f.en_wait_to_compensate_dq_prop_dly = 0;
913 cif_cntl.f.intb_oe = 1;
914 cif_cntl.f.interrupt_active_high = 1;
919 intf_cntl.f.ad_inc_a = 1;
920 intf_cntl.f.ad_inc_b = 1;
921 intf_cntl.f.rd_data_rdy_a = 0;
922 intf_cntl.f.rd_data_rdy_b = 0;
926 cpu_default.f.access_ind_addr_a = 1;
927 cpu_default.f.access_ind_addr_b = 1;
928 cpu_default.f.access_scratch_reg = 1;
929 cpu_default.f.transition_size = 0;
951 temp32 &= 0xff7fffff;
952 temp32 |= 0x00800000;
985 { 50, 0, 1, 0, 0xe0, 56},
986 { 75, 0, 5, 0, 0xde, 37},
987 {100, 0, 7, 0, 0xe0, 28},
988 {125, 0, 9, 0, 0xe0, 22},
989 {150, 0, 11, 0, 0xe0, 17},
996 { 40, 4, 13, 0, 0xe0, 80},
997 { 50, 1, 6, 0, 0xe0, 64},
998 { 57, 2, 11, 0, 0xe0, 53},
999 { 75, 0, 4, 3, 0xe0, 43},
1000 {100, 0, 6, 0, 0xe0, 32},
1001 { 0, 0, 0, 0, 0, 0},
1007 { 72, 1, 8, 0, 0xe0, 48},
1008 { 80, 1, 9, 0, 0xe0, 13},
1009 { 95, 1, 10, 7, 0xe0, 38},
1010 { 96, 1, 11, 0, 0xe0, 36},
1011 { 0, 0, 0, 0, 0, 0},
1014 static struct pll_entries {
1017 } w100_pll_tables[] = {
1018 { 12500000, &xtal_12500000[0] },
1019 { 14318000, &xtal_14318000[0] },
1020 { 16000000, &xtal_16000000[0] },
1026 struct pll_entries *pll_entry = w100_pll_tables;
1029 if (freq == pll_entry->xtal_freq)
1030 return pll_entry->pll_table;
1032 }
while (pll_entry->xtal_freq);
1037 static unsigned int w100_get_testcount(
unsigned int testclk_sel)
1044 clk_test_cntl.f.start_check_freq = 0x0;
1046 clk_test_cntl.f.tstcount_rst = 0x1;
1049 clk_test_cntl.f.tstcount_rst = 0x0;
1053 clk_test_cntl.f.start_check_freq = 0x1;
1061 clk_test_cntl.f.start_check_freq = 0x0;
1064 return clk_test_cntl.f.test_count;
1074 w100_pwr_state.pll_cntl.f.pll_pwdn = 0x0;
1075 w100_pwr_state.pll_cntl.f.pll_reset = 0x0;
1076 w100_pwr_state.pll_cntl.f.pll_tcpoff = 0x1;
1077 w100_pwr_state.pll_cntl.f.pll_pvg = 0x0;
1078 w100_pwr_state.pll_cntl.f.pll_vcofr = 0x0;
1079 w100_pwr_state.pll_cntl.f.pll_ioffset = 0x0;
1080 w100_pwr_state.pll_cntl.f.pll_ring_off = 0x0;
1088 w100_pwr_state.pll_cntl.f.pll_dactal = 0xd;
1092 if (tf80 >= (pll->
tfgoal)) {
1094 w100_pwr_state.pll_cntl.f.pll_dactal = 0x7;
1098 if (tf20 <= (pll->
tfgoal))
1101 if ((w100_pwr_state.pll_cntl.f.pll_vcofr == 0x0) &&
1102 ((w100_pwr_state.pll_cntl.f.pll_pvg == 0x7) ||
1103 (w100_pwr_state.pll_cntl.f.pll_ioffset == 0x0))) {
1105 w100_pwr_state.pll_cntl.f.pll_vcofr = 0x1;
1106 w100_pwr_state.pll_cntl.f.pll_pvg = 0x0;
1107 w100_pwr_state.pll_cntl.f.pll_ioffset = 0x0;
1111 if ((w100_pwr_state.pll_cntl.f.pll_ioffset) < 0x3) {
1112 w100_pwr_state.pll_cntl.f.pll_ioffset += 0x1;
1113 }
else if ((w100_pwr_state.pll_cntl.f.pll_pvg) < 0x7) {
1114 w100_pwr_state.pll_cntl.f.pll_ioffset = 0x0;
1115 w100_pwr_state.pll_cntl.f.pll_pvg += 0x1;
1130 status = w100_pll_adjust(pll);
1134 w100_pwr_state.pll_cntl.f.pll_dactal = 0xa;
1140 w100_pwr_state.pll_cntl.f.pll_tcpoff = 0x0;
1144 w100_pwr_state.pll_cntl.f.pll_dactal = 0x0;
1159 if (w100_pwr_state.auto_mode == 1)
1161 w100_pwr_state.pwrmgt_cntl.f.pwm_fast_noml_hw_en = 0x0;
1162 w100_pwr_state.pwrmgt_cntl.f.pwm_noml_fast_hw_en = 0x0;
1167 w100_pwr_state.sclk_cntl.f.sclk_src_sel =
CLK_SRC_XTAL;
1170 w100_pwr_state.pll_ref_fb_div.f.pll_ref_div = pll->
M;
1171 w100_pwr_state.pll_ref_fb_div.f.pll_fb_div_int = pll->
N_int;
1172 w100_pwr_state.pll_ref_fb_div.f.pll_fb_div_frac = pll->
N_fac;
1173 w100_pwr_state.pll_ref_fb_div.f.pll_lock_time = pll->
lock_time;
1176 w100_pwr_state.pwrmgt_cntl.f.pwm_mode_req = 0;
1179 status = w100_pll_calibration(pll);
1181 if (w100_pwr_state.auto_mode == 1)
1183 w100_pwr_state.pwrmgt_cntl.f.pwm_fast_noml_hw_en = 0x1;
1184 w100_pwr_state.pwrmgt_cntl.f.pwm_noml_fast_hw_en = 0x1;
1191 static int w100_set_pll_freq(
struct w100fb_par *par,
unsigned int freq)
1196 if (freq == pll->
freq) {
1197 return w100_pll_set_clk(pll);
1206 static void w100_pwm_setup(
struct w100fb_par *par)
1208 w100_pwr_state.clk_pin_cntl.f.osc_en = 0x1;
1209 w100_pwr_state.clk_pin_cntl.f.osc_gain = 0x1f;
1210 w100_pwr_state.clk_pin_cntl.f.dont_use_xtalin = 0x0;
1211 w100_pwr_state.clk_pin_cntl.f.xtalin_pm_en = 0x0;
1212 w100_pwr_state.clk_pin_cntl.f.xtalin_dbl_en = par->
mach->xtal_dbl ? 1 : 0;
1213 w100_pwr_state.clk_pin_cntl.f.cg_debug = 0x0;
1216 w100_pwr_state.sclk_cntl.f.sclk_src_sel =
CLK_SRC_XTAL;
1217 w100_pwr_state.sclk_cntl.f.sclk_post_div_fast = 0x0;
1218 w100_pwr_state.sclk_cntl.f.sclk_clkon_hys = 0x3;
1219 w100_pwr_state.sclk_cntl.f.sclk_post_div_slow = 0x0;
1220 w100_pwr_state.sclk_cntl.f.disp_cg_ok2switch_en = 0x0;
1221 w100_pwr_state.sclk_cntl.f.sclk_force_reg = 0x0;
1222 w100_pwr_state.sclk_cntl.f.sclk_force_disp = 0x0;
1223 w100_pwr_state.sclk_cntl.f.sclk_force_mc = 0x0;
1224 w100_pwr_state.sclk_cntl.f.sclk_force_extmc = 0x0;
1225 w100_pwr_state.sclk_cntl.f.sclk_force_cp = 0x0;
1226 w100_pwr_state.sclk_cntl.f.sclk_force_e2 = 0x0;
1227 w100_pwr_state.sclk_cntl.f.sclk_force_e3 = 0x0;
1228 w100_pwr_state.sclk_cntl.f.sclk_force_idct = 0x0;
1229 w100_pwr_state.sclk_cntl.f.sclk_force_bist = 0x0;
1230 w100_pwr_state.sclk_cntl.f.busy_extend_cp = 0x0;
1231 w100_pwr_state.sclk_cntl.f.busy_extend_e2 = 0x0;
1232 w100_pwr_state.sclk_cntl.f.busy_extend_e3 = 0x0;
1233 w100_pwr_state.sclk_cntl.f.busy_extend_idct = 0x0;
1236 w100_pwr_state.pclk_cntl.f.pclk_src_sel =
CLK_SRC_XTAL;
1237 w100_pwr_state.pclk_cntl.f.pclk_post_div = 0x1;
1238 w100_pwr_state.pclk_cntl.f.pclk_force_disp = 0x0;
1241 w100_pwr_state.pll_ref_fb_div.f.pll_ref_div = 0x0;
1242 w100_pwr_state.pll_ref_fb_div.f.pll_fb_div_int = 0x0;
1243 w100_pwr_state.pll_ref_fb_div.f.pll_fb_div_frac = 0x0;
1244 w100_pwr_state.pll_ref_fb_div.f.pll_reset_time = 0x5;
1245 w100_pwr_state.pll_ref_fb_div.f.pll_lock_time = 0xff;
1248 w100_pwr_state.pll_cntl.f.pll_pwdn = 0x1;
1249 w100_pwr_state.pll_cntl.f.pll_reset = 0x1;
1250 w100_pwr_state.pll_cntl.f.pll_pm_en = 0x0;
1251 w100_pwr_state.pll_cntl.f.pll_mode = 0x0;
1252 w100_pwr_state.pll_cntl.f.pll_refclk_sel = 0x0;
1253 w100_pwr_state.pll_cntl.f.pll_fbclk_sel = 0x0;
1254 w100_pwr_state.pll_cntl.f.pll_tcpoff = 0x0;
1255 w100_pwr_state.pll_cntl.f.pll_pcp = 0x4;
1256 w100_pwr_state.pll_cntl.f.pll_pvg = 0x0;
1257 w100_pwr_state.pll_cntl.f.pll_vcofr = 0x0;
1258 w100_pwr_state.pll_cntl.f.pll_ioffset = 0x0;
1259 w100_pwr_state.pll_cntl.f.pll_pecc_mode = 0x0;
1260 w100_pwr_state.pll_cntl.f.pll_pecc_scon = 0x0;
1261 w100_pwr_state.pll_cntl.f.pll_dactal = 0x0;
1262 w100_pwr_state.pll_cntl.f.pll_cp_clip = 0x3;
1263 w100_pwr_state.pll_cntl.f.pll_conf = 0x2;
1264 w100_pwr_state.pll_cntl.f.pll_mbctrl = 0x2;
1265 w100_pwr_state.pll_cntl.f.pll_ring_off = 0x0;
1268 w100_pwr_state.pwrmgt_cntl.f.pwm_enable = 0x0;
1269 w100_pwr_state.pwrmgt_cntl.f.pwm_mode_req = 0x1;
1270 w100_pwr_state.pwrmgt_cntl.f.pwm_wakeup_cond = 0x0;
1271 w100_pwr_state.pwrmgt_cntl.f.pwm_fast_noml_hw_en = 0x0;
1272 w100_pwr_state.pwrmgt_cntl.f.pwm_noml_fast_hw_en = 0x0;
1273 w100_pwr_state.pwrmgt_cntl.f.pwm_fast_noml_cond = 0x1;
1274 w100_pwr_state.pwrmgt_cntl.f.pwm_noml_fast_cond = 0x1;
1275 w100_pwr_state.pwrmgt_cntl.f.pwm_idle_timer = 0xFF;
1276 w100_pwr_state.pwrmgt_cntl.f.pwm_busy_timer = 0xFF;
1279 w100_pwr_state.auto_mode = 0;
1286 static void w100_init_clocks(
struct w100fb_par *par)
1293 w100_pwr_state.sclk_cntl.f.sclk_src_sel = mode->
sysclk_src;
1294 w100_pwr_state.sclk_cntl.f.sclk_post_div_fast = mode->
sysclk_divider;
1295 w100_pwr_state.sclk_cntl.f.sclk_post_div_slow = mode->
sysclk_divider;
1299 static void w100_init_lcd(
struct w100fb_par *par)
1312 active_h_disp.
val = 0;
1317 active_v_disp.val = 0;
1322 graphic_h_disp.val = 0;
1323 graphic_h_disp.f.graphic_h_start=mode->
left_margin;
1327 graphic_v_disp.val = 0;
1361 temp32 |= 0xc0000000;
1366 static void w100_setup_memory(
struct w100fb_par *par)
1393 extmem_location.f.mc_ext_mem_start =
W100_FB_BASE >> 8;
1394 extmem_location.f.mc_ext_mem_top = (
W100_FB_BASE+par->
mach->mem->size) >> 8;
1419 static void w100_set_dispregs(
struct w100fb_par *par)
1425 if (par->
xres == par->
mode->xres) {
1428 offset=(par->
xres * par->
yres) - 1;
1430 divider = par->
mode->pixclk_divider;
1434 offset=par->
xres - 1;
1437 offset=par->
xres * (par->
yres - 1);
1439 divider = par->
mode->pixclk_divider_rotated;
1442 graphic_ctrl.val = 0;
1445 graphic_ctrl.f_w100.color_depth=6;
1446 graphic_ctrl.f_w100.en_crtc=1;
1447 graphic_ctrl.f_w100.en_graphic_req=1;
1448 graphic_ctrl.f_w100.en_graphic_crtc=1;
1449 graphic_ctrl.f_w100.lcd_pclk_on=1;
1450 graphic_ctrl.f_w100.lcd_sclk_on=1;
1451 graphic_ctrl.f_w100.low_power_on=0;
1452 graphic_ctrl.f_w100.req_freq=0;
1453 graphic_ctrl.f_w100.portrait_mode=
rot;
1460 graphic_ctrl.f_w100.total_req_graphic=0xa0;
1467 graphic_ctrl.f_w100.low_power_on=1;
1468 graphic_ctrl.f_w100.req_freq=5;
1472 graphic_ctrl.f_w100.req_freq=4;
1477 graphic_ctrl.f_w100.total_req_graphic=0xf0;
1483 graphic_ctrl.f_w32xx.color_depth=6;
1484 graphic_ctrl.f_w32xx.en_crtc=1;
1485 graphic_ctrl.f_w32xx.en_graphic_req=1;
1486 graphic_ctrl.f_w32xx.en_graphic_crtc=1;
1487 graphic_ctrl.f_w32xx.lcd_pclk_on=1;
1488 graphic_ctrl.f_w32xx.lcd_sclk_on=1;
1489 graphic_ctrl.f_w32xx.low_power_on=0;
1490 graphic_ctrl.f_w32xx.req_freq=0;
1491 graphic_ctrl.f_w32xx.total_req_graphic=par->
mode->xres >> 1;
1492 graphic_ctrl.f_w32xx.portrait_mode=
rot;
1497 w100_pwr_state.pclk_cntl.f.pclk_src_sel = par->
mode->pixclk_src;
1498 w100_pwr_state.pclk_cntl.f.pclk_post_div = divider;
1511 static void calc_hsync(
struct w100fb_par *par)
1513 unsigned long hsync;
1518 hsync=par->
mach->xtal_freq;
1522 hsync /= (w100_pwr_state.pclk_cntl.f.pclk_post_div + 1);
1526 par->
hsync_len = hsync / (crtc_ss.f.ss_end-crtc_ss.f.ss_start);
1531 static void w100_suspend(
u32 mode)
1539 val &= ~(0x00100000);
1544 val &= ~(0x00040000);
1558 val &= ~(0x00000001);
1579 val &= ~(0x00000001);
1586 static void w100_vsync(
void)
1611 while(timeout > 0) {