aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/aty/atyfb_base.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index d1e50072228a..9ea75f18169c 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2350,11 +2350,7 @@ static int __devinit aty_init(struct fb_info *info, const char *name)
2350 const char *ramname = NULL, *xtal; 2350 const char *ramname = NULL, *xtal;
2351 int gtb_memsize, has_var = 0; 2351 int gtb_memsize, has_var = 0;
2352 struct fb_var_screeninfo var; 2352 struct fb_var_screeninfo var;
2353 u8 pll_ref_div;
2354 u32 i; 2353 u32 i;
2355#if defined(CONFIG_PPC)
2356 int sense;
2357#endif
2358 2354
2359 init_waitqueue_head(&par->vblank.wait); 2355 init_waitqueue_head(&par->vblank.wait);
2360 spin_lock_init(&par->int_lock); 2356 spin_lock_init(&par->int_lock);
@@ -2464,18 +2460,21 @@ static int __devinit aty_init(struct fb_info *info, const char *name)
2464 par->pll_limits.mclk = 63; 2460 par->pll_limits.mclk = 63;
2465 } 2461 }
2466 2462
2467 if (M64_HAS(GTB_DSP) 2463 if (M64_HAS(GTB_DSP)) {
2468 && (pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par))) { 2464 u8 pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par);
2469 int diff1, diff2; 2465
2470 diff1 = 510 * 14 / pll_ref_div - par->pll_limits.pll_max; 2466 if (pll_ref_div) {
2471 diff2 = 510 * 29 / pll_ref_div - par->pll_limits.pll_max; 2467 int diff1, diff2;
2472 if (diff1 < 0) 2468 diff1 = 510 * 14 / pll_ref_div - par->pll_limits.pll_max;
2473 diff1 = -diff1; 2469 diff2 = 510 * 29 / pll_ref_div - par->pll_limits.pll_max;
2474 if (diff2 < 0) 2470 if (diff1 < 0)
2475 diff2 = -diff2; 2471 diff1 = -diff1;
2476 if (diff2 < diff1) { 2472 if (diff2 < 0)
2477 par->ref_clk_per = 1000000000000ULL / 29498928; 2473 diff2 = -diff2;
2478 xtal = "29.498928"; 2474 if (diff2 < diff1) {
2475 par->ref_clk_per = 1000000000000ULL / 29498928;
2476 xtal = "29.498928";
2477 }
2479 } 2478 }
2480 } 2479 }
2481#endif /* CONFIG_FB_ATY_CT */ 2480#endif /* CONFIG_FB_ATY_CT */
@@ -2668,6 +2667,7 @@ static int __devinit aty_init(struct fb_info *info, const char *name)
2668 has_var = 1; 2667 has_var = 1;
2669 } else { 2668 } else {
2670 if (default_vmode == VMODE_CHOOSE) { 2669 if (default_vmode == VMODE_CHOOSE) {
2670 int sense;
2671 if (M64_HAS(G3_PB_1024x768)) 2671 if (M64_HAS(G3_PB_1024x768))
2672 /* G3 PowerBook with 1024x768 LCD */ 2672 /* G3 PowerBook with 1024x768 LCD */
2673 default_vmode = VMODE_1024_768_60; 2673 default_vmode = VMODE_1024_768_60;
@@ -3711,6 +3711,8 @@ static int __devinit atyfb_atari_probe(void)
3711 3711
3712#endif /* CONFIG_ATARI */ 3712#endif /* CONFIG_ATARI */
3713 3713
3714#ifdef CONFIG_PCI
3715
3714static void __devexit atyfb_remove(struct fb_info *info) 3716static void __devexit atyfb_remove(struct fb_info *info)
3715{ 3717{
3716 struct atyfb_par *par = (struct atyfb_par *) info->par; 3718 struct atyfb_par *par = (struct atyfb_par *) info->par;
@@ -3758,7 +3760,6 @@ static void __devexit atyfb_remove(struct fb_info *info)
3758 framebuffer_release(info); 3760 framebuffer_release(info);
3759} 3761}
3760 3762
3761#ifdef CONFIG_PCI
3762 3763
3763static void __devexit atyfb_pci_remove(struct pci_dev *pdev) 3764static void __devexit atyfb_pci_remove(struct pci_dev *pdev)
3764{ 3765{