aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/matrox/g450_pll.c23
-rw-r--r--drivers/video/matrox/matroxfb_DAC1064.h2
-rw-r--r--drivers/video/matrox/matroxfb_base.h2
3 files changed, 25 insertions, 2 deletions
diff --git a/drivers/video/matrox/g450_pll.c b/drivers/video/matrox/g450_pll.c
index 8073a73f6f35..440272ad10e7 100644
--- a/drivers/video/matrox/g450_pll.c
+++ b/drivers/video/matrox/g450_pll.c
@@ -316,14 +316,24 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll,
316 case M_PIXEL_PLL_B: 316 case M_PIXEL_PLL_B:
317 case M_PIXEL_PLL_C: 317 case M_PIXEL_PLL_C:
318 { 318 {
319 u_int8_t tmp; 319 u_int8_t tmp, xpwrctrl;
320 unsigned long flags; 320 unsigned long flags;
321 321
322 matroxfb_DAC_lock_irqsave(flags); 322 matroxfb_DAC_lock_irqsave(flags);
323
324 xpwrctrl = matroxfb_DAC_in(PMINFO M1064_XPWRCTRL);
325 matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, xpwrctrl & ~M1064_XPWRCTRL_PANELPDN);
326 mga_outb(M_SEQ_INDEX, M_SEQ1);
327 mga_outb(M_SEQ_DATA, mga_inb(M_SEQ_DATA) | M_SEQ1_SCROFF);
323 tmp = matroxfb_DAC_in(PMINFO M1064_XPIXCLKCTRL); 328 tmp = matroxfb_DAC_in(PMINFO M1064_XPIXCLKCTRL);
329 tmp |= M1064_XPIXCLKCTRL_DIS;
324 if (!(tmp & M1064_XPIXCLKCTRL_PLL_UP)) { 330 if (!(tmp & M1064_XPIXCLKCTRL_PLL_UP)) {
325 matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp | M1064_XPIXCLKCTRL_PLL_UP); 331 tmp |= M1064_XPIXCLKCTRL_PLL_UP;
326 } 332 }
333 matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp);
334 matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL, 0);
335 matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, xpwrctrl);
336
327 matroxfb_DAC_unlock_irqrestore(flags); 337 matroxfb_DAC_unlock_irqrestore(flags);
328 } 338 }
329 { 339 {
@@ -418,6 +428,15 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll,
418 frequency to higher - with <= lowest wins, while 428 frequency to higher - with <= lowest wins, while
419 with < highest one wins */ 429 with < highest one wins */
420 if (delta <= deltaarray[idx-1]) { 430 if (delta <= deltaarray[idx-1]) {
431 /* all else being equal except VCO,
432 * choose VCO not near (within 1/16th or so) VCOmin
433 * (freqs near VCOmin aren't as stable)
434 */
435 if (delta == deltaarray[idx-1]
436 && vco != g450_mnp2vco(PMINFO mnparray[idx-1])
437 && vco < (pi->vcomin * 17 / 16)) {
438 break;
439 }
421 mnparray[idx] = mnparray[idx-1]; 440 mnparray[idx] = mnparray[idx-1];
422 deltaarray[idx] = deltaarray[idx-1]; 441 deltaarray[idx] = deltaarray[idx-1];
423 } else { 442 } else {
diff --git a/drivers/video/matrox/matroxfb_DAC1064.h b/drivers/video/matrox/matroxfb_DAC1064.h
index 2e7238aa2432..56513a5d220b 100644
--- a/drivers/video/matrox/matroxfb_DAC1064.h
+++ b/drivers/video/matrox/matroxfb_DAC1064.h
@@ -40,6 +40,7 @@ void DAC1064_global_restore(WPMINFO2);
40#define M1064_XCURCOL1RED 0x0C 40#define M1064_XCURCOL1RED 0x0C
41#define M1064_XCURCOL1GREEN 0x0D 41#define M1064_XCURCOL1GREEN 0x0D
42#define M1064_XCURCOL1BLUE 0x0E 42#define M1064_XCURCOL1BLUE 0x0E
43#define M1064_XDVICLKCTRL 0x0F
43#define M1064_XCURCOL2RED 0x10 44#define M1064_XCURCOL2RED 0x10
44#define M1064_XCURCOL2GREEN 0x11 45#define M1064_XCURCOL2GREEN 0x11
45#define M1064_XCURCOL2BLUE 0x12 46#define M1064_XCURCOL2BLUE 0x12
@@ -144,6 +145,7 @@ void DAC1064_global_restore(WPMINFO2);
144#define M1064_XVIDPLLN 0x8F 145#define M1064_XVIDPLLN 0x8F
145 146
146#define M1064_XPWRCTRL 0xA0 147#define M1064_XPWRCTRL 0xA0
148#define M1064_XPWRCTRL_PANELPDN 0x04
147 149
148#define M1064_XPANMODE 0xA2 150#define M1064_XPANMODE 0xA2
149 151
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h
index 3a3e1804c56a..b71737178d0d 100644
--- a/drivers/video/matrox/matroxfb_base.h
+++ b/drivers/video/matrox/matroxfb_base.h
@@ -672,6 +672,8 @@ void matroxfb_unregister_driver(struct matroxfb_driver* drv);
672 672
673#define M_SEQ_INDEX 0x1FC4 673#define M_SEQ_INDEX 0x1FC4
674#define M_SEQ_DATA 0x1FC5 674#define M_SEQ_DATA 0x1FC5
675#define M_SEQ1 0x01
676#define M_SEQ1_SCROFF 0x20
675 677
676#define M_MISC_REG_READ 0x1FCC 678#define M_MISC_REG_READ 0x1FCC
677 679