aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/pm2fb.c
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2007-05-08 03:39:32 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:32 -0400
commite5d809d774fc8aa76899bde3235afb046728feed (patch)
tree853cbef657a2a4d9d543a09971ba2aa6e3ba31ad /drivers/video/pm2fb.c
parentf1c15f938d810b5eb38c85a28e5e9d2af07d135a (diff)
pm2fb: Permedia 2V memory clock setting
Permedia 2V uses its own registers to set a memory clock. The patch adds these registers and uses them in the set_memclock() function. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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)