diff options
author | Ville Syrjala <syrjala@sci.fi> | 2007-05-08 03:39:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:32 -0400 |
commit | b4e124c138558a0cff51398ddff9a8e44ed0b529 (patch) | |
tree | e1a639605283cc9b55d51d81fae54e330a84e34c /drivers/video/aty/atyfb_base.c | |
parent | 94f45bcd1c29e773b6bf189ef7b9a3437d016320 (diff) |
atyfb: reorganize clock init
Reorganize atyfb clock init code so command line clock overrides are effective
for all chips. The old code would silently ignore some of the command line
clock overrides with some chips.
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/aty/atyfb_base.c')
-rw-r--r-- | drivers/video/aty/atyfb_base.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index a92e02aa8d18..b61ab3b4c922 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -2297,20 +2297,6 @@ static int __devinit aty_init(struct fb_info *info) | |||
2297 | par->pll_limits.xclk = 53; | 2297 | par->pll_limits.xclk = 53; |
2298 | } | 2298 | } |
2299 | #endif | 2299 | #endif |
2300 | if (pll) | ||
2301 | par->pll_limits.pll_max = pll; | ||
2302 | if (mclk) | ||
2303 | par->pll_limits.mclk = mclk; | ||
2304 | if (xclk) | ||
2305 | par->pll_limits.xclk = xclk; | ||
2306 | |||
2307 | aty_calc_mem_refresh(par, par->pll_limits.xclk); | ||
2308 | par->pll_per = 1000000/par->pll_limits.pll_max; | ||
2309 | par->mclk_per = 1000000/par->pll_limits.mclk; | ||
2310 | par->xclk_per = 1000000/par->pll_limits.xclk; | ||
2311 | |||
2312 | par->ref_clk_per = 1000000000000ULL / 14318180; | ||
2313 | xtal = "14.31818"; | ||
2314 | 2300 | ||
2315 | #ifdef CONFIG_FB_ATY_GX | 2301 | #ifdef CONFIG_FB_ATY_GX |
2316 | if (!M64_HAS(INTEGRATED)) { | 2302 | if (!M64_HAS(INTEGRATED)) { |
@@ -2392,7 +2378,25 @@ static int __devinit aty_init(struct fb_info *info) | |||
2392 | if (par->pll_limits.mclk == 67 && par->ram_type < SDRAM) | 2378 | if (par->pll_limits.mclk == 67 && par->ram_type < SDRAM) |
2393 | par->pll_limits.mclk = 63; | 2379 | par->pll_limits.mclk = 63; |
2394 | } | 2380 | } |
2381 | #endif | ||
2395 | 2382 | ||
2383 | /* Allow command line to override clocks. */ | ||
2384 | if (pll) | ||
2385 | par->pll_limits.pll_max = pll; | ||
2386 | if (mclk) | ||
2387 | par->pll_limits.mclk = mclk; | ||
2388 | if (xclk) | ||
2389 | par->pll_limits.xclk = xclk; | ||
2390 | |||
2391 | aty_calc_mem_refresh(par, par->pll_limits.xclk); | ||
2392 | par->pll_per = 1000000/par->pll_limits.pll_max; | ||
2393 | par->mclk_per = 1000000/par->pll_limits.mclk; | ||
2394 | par->xclk_per = 1000000/par->pll_limits.xclk; | ||
2395 | |||
2396 | par->ref_clk_per = 1000000000000ULL / 14318180; | ||
2397 | xtal = "14.31818"; | ||
2398 | |||
2399 | #ifdef CONFIG_FB_ATY_CT | ||
2396 | if (M64_HAS(GTB_DSP)) { | 2400 | if (M64_HAS(GTB_DSP)) { |
2397 | u8 pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par); | 2401 | u8 pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par); |
2398 | 2402 | ||