aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/pm2fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/pm2fb.c')
-rw-r--r--drivers/video/pm2fb.c52
1 files changed, 37 insertions, 15 deletions
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index 2c7dccbd5250..6f634e3ae60d 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -462,21 +462,43 @@ static void set_memclock(struct pm2fb_par* par, u32 clk)
462 int i; 462 int i;
463 unsigned char m, n, p; 463 unsigned char m, n, p;
464 464
465 pm2_mnp(clk, &m, &n, &p); 465 switch (par->type) {
466 WAIT_FIFO(par, 10); 466 case PM2_TYPE_PERMEDIA2V:
467 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_3, 6); 467 pm2v_mnp(clk/2, &m, &n, &p);
468 wmb(); 468 WAIT_FIFO(par, 8);
469 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_1, m); 469 pm2_WR(par, PM2VR_RD_INDEX_HIGH, PM2VI_RD_MCLK_CONTROL >> 8);
470 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_2, n); 470 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_CONTROL, 0);
471 wmb(); 471 wmb();
472 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_3, 8|p); 472 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_PRESCALE, m);
473 wmb(); 473 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_FEEDBACK, n);
474 pm2_RDAC_RD(par, PM2I_RD_MEMORY_CLOCK_STATUS); 474 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_POSTSCALE, p);
475 rmb(); 475 wmb();
476 for (i = 256; 476 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_CONTROL, 1);
477 i && !(pm2_RD(par, PM2R_RD_INDEXED_DATA) & PM2F_PLL_LOCKED); 477 rmb();
478 i--) 478 for (i = 256;
479 ; 479 i && !(pm2_RDAC_RD(par, PM2VI_RD_MCLK_CONTROL) & 2);
480 i--)
481 ;
482 pm2_WR(par, PM2VR_RD_INDEX_HIGH, 0);
483 break;
484 case PM2_TYPE_PERMEDIA2:
485 pm2_mnp(clk, &m, &n, &p);
486 WAIT_FIFO(par, 10);
487 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_3, 6);
488 wmb();
489 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_1, m);
490 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_2, n);
491 wmb();
492 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_3, 8|p);
493 wmb();
494 pm2_RDAC_RD(par, PM2I_RD_MEMORY_CLOCK_STATUS);
495 rmb();
496 for (i = 256;
497 i && !(pm2_RD(par, PM2R_RD_INDEXED_DATA) & PM2F_PLL_LOCKED);
498 i--)
499 ;
500 break;
501 }
480} 502}
481 503
482static void set_pixclock(struct pm2fb_par* par, u32 clk) 504static void set_pixclock(struct pm2fb_par* par, u32 clk)