X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fvideo%2Faty%2Fmach64_gx.c;h=2045639cb671b1ecded8b03f2104ff868a8741d6;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=f85f0a052784a471a7973407186dbd682e0900d6;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/video/aty/mach64_gx.c b/drivers/video/aty/mach64_gx.c index f85f0a052..2045639cb 100644 --- a/drivers/video/aty/mach64_gx.c +++ b/drivers/video/aty/mach64_gx.c @@ -121,7 +121,7 @@ static int aty_set_dac_514(const struct fb_info *info, } static int aty_var_to_pll_514(const struct fb_info *info, u32 vclk_per, - u8 bpp, union aty_pll *pll) + u32 bpp, union aty_pll *pll) { /* * FIXME: use real calculations instead of using fixed values from the old @@ -149,8 +149,7 @@ static int aty_var_to_pll_514(const struct fb_info *info, u32 vclk_per, }; int i; - for (i = 0; i < sizeof(RGB514_clocks) / sizeof(*RGB514_clocks); - i++) + for (i = 0; i < ARRAY_SIZE(RGB514_clocks); i++) if (vclk_per <= RGB514_clocks[i].limit) { pll->ibm514.m = RGB514_clocks[i].m; pll->ibm514.n = RGB514_clocks[i].n; @@ -253,9 +252,9 @@ static int aty_set_dac_ATI68860_B(const struct fb_info *info, temp = aty_ld_8(DAC_CNTL, par); aty_st_8(DAC_CNTL, temp | DAC_EXT_SEL_RS2 | DAC_EXT_SEL_RS3, par); - if (info->fix.smem_len < MEM_SIZE_1M) + if (info->fix.smem_len < ONE_MB) mask = 0x04; - else if (info->fix.smem_len == MEM_SIZE_1M) + else if (info->fix.smem_len == ONE_MB) mask = 0x08; else mask = 0x0C; @@ -339,8 +338,8 @@ const struct aty_dac_ops aty_dac_att21c498 = { * ATI 18818 / ICS 2595 Clock Chip */ -static int aty_var_to_pll_18818(const struct fb_info *info, - u32 vclk_per, u8 bpp, union aty_pll *pll) +static int aty_var_to_pll_18818(const struct fb_info *info, u32 vclk_per, + u32 bpp, union aty_pll *pll) { u32 MHz100; /* in 0.01 MHz */ u32 program_bits; @@ -495,8 +494,8 @@ const struct aty_pll_ops aty_pll_ati18818_1 = { * STG 1703 Clock Chip */ -static int aty_var_to_pll_1703(const struct fb_info *info, - u32 vclk_per, u8 bpp, union aty_pll *pll) +static int aty_var_to_pll_1703(const struct fb_info *info, u32 vclk_per, + u32 bpp, union aty_pll *pll) { u32 mhz100; /* in 0.01 MHz */ u32 program_bits; @@ -611,8 +610,8 @@ const struct aty_pll_ops aty_pll_stg1703 = { * Chrontel 8398 Clock Chip */ -static int aty_var_to_pll_8398(const struct fb_info *info, - u32 vclk_per, u8 bpp, union aty_pll *pll) +static int aty_var_to_pll_8398(const struct fb_info *info, u32 vclk_per, + u32 bpp, union aty_pll *pll) { u32 tempA, tempB, fOut, longMHz100, diff, preDiff; @@ -653,7 +652,7 @@ static int aty_var_to_pll_8398(const struct fb_info *info, for (m = MIN_M; m <= MAX_M; m++) { for (n = MIN_N; n <= MAX_N; n++) { - tempA = (14.31818 * 65536); + tempA = 938356; /* 14.31818 * 65536 */ tempA *= (n + 8); /* 43..256 */ tempB = twoToKth * 256; tempB *= (m + 2); /* 4..32 */ @@ -736,7 +735,7 @@ const struct aty_pll_ops aty_pll_ch8398 = { */ static int aty_var_to_pll_408(const struct fb_info *info, u32 vclk_per, - u8 bpp, union aty_pll *pll) + u32 bpp, union aty_pll *pll) { u32 mhz100; /* in 0.01 MHz */ u32 program_bits;