diff options
Diffstat (limited to 'drivers/video/aty')
-rw-r--r-- | drivers/video/aty/aty128fb.c | 5 | ||||
-rw-r--r-- | drivers/video/aty/atyfb.h | 9 | ||||
-rw-r--r-- | drivers/video/aty/atyfb_base.c | 199 | ||||
-rw-r--r-- | drivers/video/aty/mach64_ct.c | 47 | ||||
-rw-r--r-- | drivers/video/aty/radeon_i2c.c | 16 | ||||
-rw-r--r-- | drivers/video/aty/radeon_monitor.c | 3 |
6 files changed, 159 insertions, 120 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index 5341462b6b48..2e976ffcde0f 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c | |||
@@ -1333,6 +1333,8 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll, | |||
1333 | if (vclk * 12 < c.ppll_min) | 1333 | if (vclk * 12 < c.ppll_min) |
1334 | vclk = c.ppll_min/12; | 1334 | vclk = c.ppll_min/12; |
1335 | 1335 | ||
1336 | pll->post_divider = -1; | ||
1337 | |||
1336 | /* now, find an acceptable divider */ | 1338 | /* now, find an acceptable divider */ |
1337 | for (i = 0; i < sizeof(post_dividers); i++) { | 1339 | for (i = 0; i < sizeof(post_dividers); i++) { |
1338 | output_freq = post_dividers[i] * vclk; | 1340 | output_freq = post_dividers[i] * vclk; |
@@ -1342,6 +1344,9 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll, | |||
1342 | } | 1344 | } |
1343 | } | 1345 | } |
1344 | 1346 | ||
1347 | if (pll->post_divider < 0) | ||
1348 | return -EINVAL; | ||
1349 | |||
1345 | /* calculate feedback divider */ | 1350 | /* calculate feedback divider */ |
1346 | n = c.ref_divider * output_freq; | 1351 | n = c.ref_divider * output_freq; |
1347 | d = c.ref_clk; | 1352 | d = c.ref_clk; |
diff --git a/drivers/video/aty/atyfb.h b/drivers/video/aty/atyfb.h index b04f49fb976a..f72faff33c0c 100644 --- a/drivers/video/aty/atyfb.h +++ b/drivers/video/aty/atyfb.h | |||
@@ -126,7 +126,6 @@ union aty_pll { | |||
126 | */ | 126 | */ |
127 | 127 | ||
128 | struct atyfb_par { | 128 | struct atyfb_par { |
129 | struct aty_cmap_regs __iomem *aty_cmap_regs; | ||
130 | struct { u8 red, green, blue; } palette[256]; | 129 | struct { u8 red, green, blue; } palette[256]; |
131 | const struct aty_dac_ops *dac_ops; | 130 | const struct aty_dac_ops *dac_ops; |
132 | const struct aty_pll_ops *pll_ops; | 131 | const struct aty_pll_ops *pll_ops; |
@@ -186,6 +185,7 @@ struct atyfb_par { | |||
186 | int mtrr_aper; | 185 | int mtrr_aper; |
187 | int mtrr_reg; | 186 | int mtrr_reg; |
188 | #endif | 187 | #endif |
188 | u32 mem_cntl; | ||
189 | }; | 189 | }; |
190 | 190 | ||
191 | /* | 191 | /* |
@@ -227,7 +227,7 @@ static inline u32 aty_ld_le32(int regindex, const struct atyfb_par *par) | |||
227 | regindex -= 0x800; | 227 | regindex -= 0x800; |
228 | 228 | ||
229 | #ifdef CONFIG_ATARI | 229 | #ifdef CONFIG_ATARI |
230 | return in_le32((volatile u32 *)(par->ati_regbase + regindex)); | 230 | return in_le32(par->ati_regbase + regindex); |
231 | #else | 231 | #else |
232 | return readl(par->ati_regbase + regindex); | 232 | return readl(par->ati_regbase + regindex); |
233 | #endif | 233 | #endif |
@@ -240,7 +240,7 @@ static inline void aty_st_le32(int regindex, u32 val, const struct atyfb_par *pa | |||
240 | regindex -= 0x800; | 240 | regindex -= 0x800; |
241 | 241 | ||
242 | #ifdef CONFIG_ATARI | 242 | #ifdef CONFIG_ATARI |
243 | out_le32((volatile u32 *)(par->ati_regbase + regindex), val); | 243 | out_le32(par->ati_regbase + regindex, val); |
244 | #else | 244 | #else |
245 | writel(val, par->ati_regbase + regindex); | 245 | writel(val, par->ati_regbase + regindex); |
246 | #endif | 246 | #endif |
@@ -253,7 +253,7 @@ static inline void aty_st_le16(int regindex, u16 val, | |||
253 | if (regindex >= 0x400) | 253 | if (regindex >= 0x400) |
254 | regindex -= 0x800; | 254 | regindex -= 0x800; |
255 | #ifdef CONFIG_ATARI | 255 | #ifdef CONFIG_ATARI |
256 | out_le16((volatile u16 *)(par->ati_regbase + regindex), val); | 256 | out_le16(par->ati_regbase + regindex, val); |
257 | #else | 257 | #else |
258 | writel(val, par->ati_regbase + regindex); | 258 | writel(val, par->ati_regbase + regindex); |
259 | #endif | 259 | #endif |
@@ -315,6 +315,7 @@ struct aty_pll_ops { | |||
315 | void (*set_pll) (const struct fb_info * info, const union aty_pll * pll); | 315 | void (*set_pll) (const struct fb_info * info, const union aty_pll * pll); |
316 | void (*get_pll) (const struct fb_info *info, union aty_pll * pll); | 316 | void (*get_pll) (const struct fb_info *info, union aty_pll * pll); |
317 | int (*init_pll) (const struct fb_info * info, union aty_pll * pll); | 317 | int (*init_pll) (const struct fb_info * info, union aty_pll * pll); |
318 | void (*resume_pll)(const struct fb_info *info, union aty_pll *pll); | ||
318 | }; | 319 | }; |
319 | 320 | ||
320 | extern const struct aty_pll_ops aty_pll_ati18818_1; /* ATI 18818 */ | 321 | extern const struct aty_pll_ops aty_pll_ati18818_1; /* ATI 18818 */ |
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index cc4bd8089fe2..f2ebdd880085 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -203,14 +203,6 @@ static void ATIReduceRatio(int *Numerator, int *Denominator) | |||
203 | * The Hardware parameters for each card | 203 | * The Hardware parameters for each card |
204 | */ | 204 | */ |
205 | 205 | ||
206 | struct aty_cmap_regs { | ||
207 | u8 windex; | ||
208 | u8 lut; | ||
209 | u8 mask; | ||
210 | u8 rindex; | ||
211 | u8 cntl; | ||
212 | }; | ||
213 | |||
214 | struct pci_mmap_map { | 206 | struct pci_mmap_map { |
215 | unsigned long voff; | 207 | unsigned long voff; |
216 | unsigned long poff; | 208 | unsigned long poff; |
@@ -249,7 +241,8 @@ static int atyfb_sync(struct fb_info *info); | |||
249 | * Internal routines | 241 | * Internal routines |
250 | */ | 242 | */ |
251 | 243 | ||
252 | static int aty_init(struct fb_info *info, const char *name); | 244 | static int aty_init(struct fb_info *info); |
245 | static void aty_resume_chip(struct fb_info *info); | ||
253 | #ifdef CONFIG_ATARI | 246 | #ifdef CONFIG_ATARI |
254 | static int store_video_par(char *videopar, unsigned char m64_num); | 247 | static int store_video_par(char *videopar, unsigned char m64_num); |
255 | #endif | 248 | #endif |
@@ -406,7 +399,7 @@ static struct { | |||
406 | { PCI_CHIP_MACH64LB, "3D RAGE LT PRO (Mach64 LB, AGP)", 236, 75, 100, 135, ATI_CHIP_264LTPRO }, | 399 | { PCI_CHIP_MACH64LB, "3D RAGE LT PRO (Mach64 LB, AGP)", 236, 75, 100, 135, ATI_CHIP_264LTPRO }, |
407 | { PCI_CHIP_MACH64LD, "3D RAGE LT PRO (Mach64 LD, AGP)", 230, 100, 100, 135, ATI_CHIP_264LTPRO }, | 400 | { PCI_CHIP_MACH64LD, "3D RAGE LT PRO (Mach64 LD, AGP)", 230, 100, 100, 135, ATI_CHIP_264LTPRO }, |
408 | { PCI_CHIP_MACH64LI, "3D RAGE LT PRO (Mach64 LI, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO | M64F_G3_PB_1_1 | M64F_G3_PB_1024x768 }, | 401 | { PCI_CHIP_MACH64LI, "3D RAGE LT PRO (Mach64 LI, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO | M64F_G3_PB_1_1 | M64F_G3_PB_1024x768 }, |
409 | { PCI_CHIP_MACH64LP, "3D RAGE LT PRO (Mach64 LP, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO }, | 402 | { PCI_CHIP_MACH64LP, "3D RAGE LT PRO (Mach64 LP, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO | M64F_G3_PB_1024x768 }, |
410 | { PCI_CHIP_MACH64LQ, "3D RAGE LT PRO (Mach64 LQ, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO }, | 403 | { PCI_CHIP_MACH64LQ, "3D RAGE LT PRO (Mach64 LQ, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO }, |
411 | 404 | ||
412 | { PCI_CHIP_MACH64GM, "3D RAGE XL (Mach64 GM, AGP 2x)", 230, 83, 63, 135, ATI_CHIP_264XL }, | 405 | { PCI_CHIP_MACH64GM, "3D RAGE XL (Mach64 GM, AGP 2x)", 230, 83, 63, 135, ATI_CHIP_264XL }, |
@@ -1495,10 +1488,6 @@ static int atyfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
1495 | else | 1488 | else |
1496 | info->var.accel_flags = 0; | 1489 | info->var.accel_flags = 0; |
1497 | 1490 | ||
1498 | #if 0 /* fbmon is not done. uncomment for 2.5.x -brad */ | ||
1499 | if (!fbmon_valid_timings(pixclock, htotal, vtotal, info)) | ||
1500 | return -EINVAL; | ||
1501 | #endif | ||
1502 | aty_crtc_to_var(&crtc, var); | 1491 | aty_crtc_to_var(&crtc, var); |
1503 | var->pixclock = par->pll_ops->pll_to_var(info, &pll); | 1492 | var->pixclock = par->pll_ops->pll_to_var(info, &pll); |
1504 | return 0; | 1493 | return 0; |
@@ -1937,17 +1926,14 @@ static void atyfb_save_palette(struct atyfb_par *par, int enter) | |||
1937 | aty_st_8(DAC_CNTL, tmp, par); | 1926 | aty_st_8(DAC_CNTL, tmp, par); |
1938 | aty_st_8(DAC_MASK, 0xff, par); | 1927 | aty_st_8(DAC_MASK, 0xff, par); |
1939 | 1928 | ||
1940 | writeb(i, &par->aty_cmap_regs->rindex); | 1929 | aty_st_8(DAC_R_INDEX, i, par); |
1941 | atyfb_save.r[enter][i] = readb(&par->aty_cmap_regs->lut); | 1930 | atyfb_save.r[enter][i] = aty_ld_8(DAC_DATA, par); |
1942 | atyfb_save.g[enter][i] = readb(&par->aty_cmap_regs->lut); | 1931 | atyfb_save.g[enter][i] = aty_ld_8(DAC_DATA, par); |
1943 | atyfb_save.b[enter][i] = readb(&par->aty_cmap_regs->lut); | 1932 | atyfb_save.b[enter][i] = aty_ld_8(DAC_DATA, par); |
1944 | writeb(i, &par->aty_cmap_regs->windex); | 1933 | aty_st_8(DAC_W_INDEX, i, par); |
1945 | writeb(atyfb_save.r[1 - enter][i], | 1934 | aty_st_8(DAC_DATA, atyfb_save.r[1 - enter][i], par); |
1946 | &par->aty_cmap_regs->lut); | 1935 | aty_st_8(DAC_DATA, atyfb_save.g[1 - enter][i], par); |
1947 | writeb(atyfb_save.g[1 - enter][i], | 1936 | aty_st_8(DAC_DATA, atyfb_save.b[1 - enter][i], par); |
1948 | &par->aty_cmap_regs->lut); | ||
1949 | writeb(atyfb_save.b[1 - enter][i], | ||
1950 | &par->aty_cmap_regs->lut); | ||
1951 | } | 1937 | } |
1952 | } | 1938 | } |
1953 | 1939 | ||
@@ -1982,6 +1968,7 @@ static void atyfb_palette(int enter) | |||
1982 | 1968 | ||
1983 | #if defined(CONFIG_PM) && defined(CONFIG_PCI) | 1969 | #if defined(CONFIG_PM) && defined(CONFIG_PCI) |
1984 | 1970 | ||
1971 | #ifdef CONFIG_PPC_PMAC | ||
1985 | /* Power management routines. Those are used for PowerBook sleep. | 1972 | /* Power management routines. Those are used for PowerBook sleep. |
1986 | */ | 1973 | */ |
1987 | static int aty_power_mgmt(int sleep, struct atyfb_par *par) | 1974 | static int aty_power_mgmt(int sleep, struct atyfb_par *par) |
@@ -2038,21 +2025,13 @@ static int aty_power_mgmt(int sleep, struct atyfb_par *par) | |||
2038 | 2025 | ||
2039 | return timeout ? 0 : -EIO; | 2026 | return timeout ? 0 : -EIO; |
2040 | } | 2027 | } |
2028 | #endif | ||
2041 | 2029 | ||
2042 | static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) | 2030 | static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) |
2043 | { | 2031 | { |
2044 | struct fb_info *info = pci_get_drvdata(pdev); | 2032 | struct fb_info *info = pci_get_drvdata(pdev); |
2045 | struct atyfb_par *par = (struct atyfb_par *) info->par; | 2033 | struct atyfb_par *par = (struct atyfb_par *) info->par; |
2046 | 2034 | ||
2047 | #ifndef CONFIG_PPC_PMAC | ||
2048 | /* HACK ALERT ! Once I find a proper way to say to each driver | ||
2049 | * individually what will happen with it's PCI slot, I'll change | ||
2050 | * that. On laptops, the AGP slot is just unclocked, so D2 is | ||
2051 | * expected, while on desktops, the card is powered off | ||
2052 | */ | ||
2053 | return 0; | ||
2054 | #endif /* CONFIG_PPC_PMAC */ | ||
2055 | |||
2056 | if (state.event == pdev->dev.power.power_state.event) | 2035 | if (state.event == pdev->dev.power.power_state.event) |
2057 | return 0; | 2036 | return 0; |
2058 | 2037 | ||
@@ -2070,6 +2049,7 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2070 | par->asleep = 1; | 2049 | par->asleep = 1; |
2071 | par->lock_blank = 1; | 2050 | par->lock_blank = 1; |
2072 | 2051 | ||
2052 | #ifdef CONFIG_PPC_PMAC | ||
2073 | /* Set chip to "suspend" mode */ | 2053 | /* Set chip to "suspend" mode */ |
2074 | if (aty_power_mgmt(1, par)) { | 2054 | if (aty_power_mgmt(1, par)) { |
2075 | par->asleep = 0; | 2055 | par->asleep = 0; |
@@ -2079,6 +2059,9 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2079 | release_console_sem(); | 2059 | release_console_sem(); |
2080 | return -EIO; | 2060 | return -EIO; |
2081 | } | 2061 | } |
2062 | #else | ||
2063 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | ||
2064 | #endif | ||
2082 | 2065 | ||
2083 | release_console_sem(); | 2066 | release_console_sem(); |
2084 | 2067 | ||
@@ -2097,8 +2080,15 @@ static int atyfb_pci_resume(struct pci_dev *pdev) | |||
2097 | 2080 | ||
2098 | acquire_console_sem(); | 2081 | acquire_console_sem(); |
2099 | 2082 | ||
2083 | #ifdef CONFIG_PPC_PMAC | ||
2100 | if (pdev->dev.power.power_state.event == 2) | 2084 | if (pdev->dev.power.power_state.event == 2) |
2101 | aty_power_mgmt(0, par); | 2085 | aty_power_mgmt(0, par); |
2086 | #else | ||
2087 | pci_set_power_state(pdev, PCI_D0); | ||
2088 | #endif | ||
2089 | |||
2090 | aty_resume_chip(info); | ||
2091 | |||
2102 | par->asleep = 0; | 2092 | par->asleep = 0; |
2103 | 2093 | ||
2104 | /* Restore display */ | 2094 | /* Restore display */ |
@@ -2344,24 +2334,16 @@ static int __devinit atyfb_get_timings_from_lcd(struct atyfb_par *par, | |||
2344 | } | 2334 | } |
2345 | #endif /* defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD) */ | 2335 | #endif /* defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD) */ |
2346 | 2336 | ||
2347 | static int __devinit aty_init(struct fb_info *info, const char *name) | 2337 | static int __devinit aty_init(struct fb_info *info) |
2348 | { | 2338 | { |
2349 | struct atyfb_par *par = (struct atyfb_par *) info->par; | 2339 | struct atyfb_par *par = (struct atyfb_par *) info->par; |
2350 | const char *ramname = NULL, *xtal; | 2340 | const char *ramname = NULL, *xtal; |
2351 | int gtb_memsize, has_var = 0; | 2341 | int gtb_memsize, has_var = 0; |
2352 | struct fb_var_screeninfo var; | 2342 | struct fb_var_screeninfo var; |
2353 | u8 pll_ref_div; | ||
2354 | u32 i; | ||
2355 | #if defined(CONFIG_PPC) | ||
2356 | int sense; | ||
2357 | #endif | ||
2358 | 2343 | ||
2359 | init_waitqueue_head(&par->vblank.wait); | 2344 | init_waitqueue_head(&par->vblank.wait); |
2360 | spin_lock_init(&par->int_lock); | 2345 | spin_lock_init(&par->int_lock); |
2361 | 2346 | ||
2362 | par->aty_cmap_regs = | ||
2363 | (struct aty_cmap_regs __iomem *) (par->ati_regbase + 0xc0); | ||
2364 | |||
2365 | #ifdef CONFIG_PPC_PMAC | 2347 | #ifdef CONFIG_PPC_PMAC |
2366 | /* The Apple iBook1 uses non-standard memory frequencies. We detect it | 2348 | /* The Apple iBook1 uses non-standard memory frequencies. We detect it |
2367 | * and set the frequency manually. */ | 2349 | * and set the frequency manually. */ |
@@ -2464,18 +2446,21 @@ static int __devinit aty_init(struct fb_info *info, const char *name) | |||
2464 | par->pll_limits.mclk = 63; | 2446 | par->pll_limits.mclk = 63; |
2465 | } | 2447 | } |
2466 | 2448 | ||
2467 | if (M64_HAS(GTB_DSP) | 2449 | if (M64_HAS(GTB_DSP)) { |
2468 | && (pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par))) { | 2450 | u8 pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par); |
2469 | int diff1, diff2; | 2451 | |
2470 | diff1 = 510 * 14 / pll_ref_div - par->pll_limits.pll_max; | 2452 | if (pll_ref_div) { |
2471 | diff2 = 510 * 29 / pll_ref_div - par->pll_limits.pll_max; | 2453 | int diff1, diff2; |
2472 | if (diff1 < 0) | 2454 | diff1 = 510 * 14 / pll_ref_div - par->pll_limits.pll_max; |
2473 | diff1 = -diff1; | 2455 | diff2 = 510 * 29 / pll_ref_div - par->pll_limits.pll_max; |
2474 | if (diff2 < 0) | 2456 | if (diff1 < 0) |
2475 | diff2 = -diff2; | 2457 | diff1 = -diff1; |
2476 | if (diff2 < diff1) { | 2458 | if (diff2 < 0) |
2477 | par->ref_clk_per = 1000000000000ULL / 29498928; | 2459 | diff2 = -diff2; |
2478 | xtal = "29.498928"; | 2460 | if (diff2 < diff1) { |
2461 | par->ref_clk_per = 1000000000000ULL / 29498928; | ||
2462 | xtal = "29.498928"; | ||
2463 | } | ||
2479 | } | 2464 | } |
2480 | } | 2465 | } |
2481 | #endif /* CONFIG_FB_ATY_CT */ | 2466 | #endif /* CONFIG_FB_ATY_CT */ |
@@ -2485,10 +2470,10 @@ static int __devinit aty_init(struct fb_info *info, const char *name) | |||
2485 | if(par->pll_ops->get_pll) | 2470 | if(par->pll_ops->get_pll) |
2486 | par->pll_ops->get_pll(info, &saved_pll); | 2471 | par->pll_ops->get_pll(info, &saved_pll); |
2487 | 2472 | ||
2488 | i = aty_ld_le32(MEM_CNTL, par); | 2473 | par->mem_cntl = aty_ld_le32(MEM_CNTL, par); |
2489 | gtb_memsize = M64_HAS(GTB_DSP); | 2474 | gtb_memsize = M64_HAS(GTB_DSP); |
2490 | if (gtb_memsize) | 2475 | if (gtb_memsize) |
2491 | switch (i & 0xF) { /* 0xF used instead of MEM_SIZE_ALIAS */ | 2476 | switch (par->mem_cntl & 0xF) { /* 0xF used instead of MEM_SIZE_ALIAS */ |
2492 | case MEM_SIZE_512K: | 2477 | case MEM_SIZE_512K: |
2493 | info->fix.smem_len = 0x80000; | 2478 | info->fix.smem_len = 0x80000; |
2494 | break; | 2479 | break; |
@@ -2510,7 +2495,7 @@ static int __devinit aty_init(struct fb_info *info, const char *name) | |||
2510 | default: | 2495 | default: |
2511 | info->fix.smem_len = 0x80000; | 2496 | info->fix.smem_len = 0x80000; |
2512 | } else | 2497 | } else |
2513 | switch (i & MEM_SIZE_ALIAS) { | 2498 | switch (par->mem_cntl & MEM_SIZE_ALIAS) { |
2514 | case MEM_SIZE_512K: | 2499 | case MEM_SIZE_512K: |
2515 | info->fix.smem_len = 0x80000; | 2500 | info->fix.smem_len = 0x80000; |
2516 | break; | 2501 | break; |
@@ -2540,20 +2525,20 @@ static int __devinit aty_init(struct fb_info *info, const char *name) | |||
2540 | 2525 | ||
2541 | if (vram) { | 2526 | if (vram) { |
2542 | info->fix.smem_len = vram * 1024; | 2527 | info->fix.smem_len = vram * 1024; |
2543 | i = i & ~(gtb_memsize ? 0xF : MEM_SIZE_ALIAS); | 2528 | par->mem_cntl &= ~(gtb_memsize ? 0xF : MEM_SIZE_ALIAS); |
2544 | if (info->fix.smem_len <= 0x80000) | 2529 | if (info->fix.smem_len <= 0x80000) |
2545 | i |= MEM_SIZE_512K; | 2530 | par->mem_cntl |= MEM_SIZE_512K; |
2546 | else if (info->fix.smem_len <= 0x100000) | 2531 | else if (info->fix.smem_len <= 0x100000) |
2547 | i |= MEM_SIZE_1M; | 2532 | par->mem_cntl |= MEM_SIZE_1M; |
2548 | else if (info->fix.smem_len <= 0x200000) | 2533 | else if (info->fix.smem_len <= 0x200000) |
2549 | i |= gtb_memsize ? MEM_SIZE_2M_GTB : MEM_SIZE_2M; | 2534 | par->mem_cntl |= gtb_memsize ? MEM_SIZE_2M_GTB : MEM_SIZE_2M; |
2550 | else if (info->fix.smem_len <= 0x400000) | 2535 | else if (info->fix.smem_len <= 0x400000) |
2551 | i |= gtb_memsize ? MEM_SIZE_4M_GTB : MEM_SIZE_4M; | 2536 | par->mem_cntl |= gtb_memsize ? MEM_SIZE_4M_GTB : MEM_SIZE_4M; |
2552 | else if (info->fix.smem_len <= 0x600000) | 2537 | else if (info->fix.smem_len <= 0x600000) |
2553 | i |= gtb_memsize ? MEM_SIZE_6M_GTB : MEM_SIZE_6M; | 2538 | par->mem_cntl |= gtb_memsize ? MEM_SIZE_6M_GTB : MEM_SIZE_6M; |
2554 | else | 2539 | else |
2555 | i |= gtb_memsize ? MEM_SIZE_8M_GTB : MEM_SIZE_8M; | 2540 | par->mem_cntl |= gtb_memsize ? MEM_SIZE_8M_GTB : MEM_SIZE_8M; |
2556 | aty_st_le32(MEM_CNTL, i, par); | 2541 | aty_st_le32(MEM_CNTL, par->mem_cntl, par); |
2557 | } | 2542 | } |
2558 | 2543 | ||
2559 | /* | 2544 | /* |
@@ -2599,11 +2584,12 @@ static int __devinit aty_init(struct fb_info *info, const char *name) | |||
2599 | #endif | 2584 | #endif |
2600 | if(par->pll_ops->init_pll) | 2585 | if(par->pll_ops->init_pll) |
2601 | par->pll_ops->init_pll(info, &par->pll); | 2586 | par->pll_ops->init_pll(info, &par->pll); |
2587 | if (par->pll_ops->resume_pll) | ||
2588 | par->pll_ops->resume_pll(info, &par->pll); | ||
2602 | 2589 | ||
2603 | /* | 2590 | /* |
2604 | * Last page of 8 MB (4 MB on ISA) aperture is MMIO | 2591 | * Last page of 8 MB (4 MB on ISA) aperture is MMIO, |
2605 | * FIXME: we should use the auxiliary aperture instead so we can access | 2592 | * unless the auxiliary register aperture is used. |
2606 | * the full 8 MB of video RAM on 8 MB boards | ||
2607 | */ | 2593 | */ |
2608 | 2594 | ||
2609 | if (!par->aux_start && | 2595 | if (!par->aux_start && |
@@ -2669,6 +2655,7 @@ static int __devinit aty_init(struct fb_info *info, const char *name) | |||
2669 | has_var = 1; | 2655 | has_var = 1; |
2670 | } else { | 2656 | } else { |
2671 | if (default_vmode == VMODE_CHOOSE) { | 2657 | if (default_vmode == VMODE_CHOOSE) { |
2658 | int sense; | ||
2672 | if (M64_HAS(G3_PB_1024x768)) | 2659 | if (M64_HAS(G3_PB_1024x768)) |
2673 | /* G3 PowerBook with 1024x768 LCD */ | 2660 | /* G3 PowerBook with 1024x768 LCD */ |
2674 | default_vmode = VMODE_1024_768_60; | 2661 | default_vmode = VMODE_1024_768_60; |
@@ -2749,7 +2736,7 @@ static int __devinit aty_init(struct fb_info *info, const char *name) | |||
2749 | fb_list = info; | 2736 | fb_list = info; |
2750 | 2737 | ||
2751 | PRINTKI("fb%d: %s frame buffer device on %s\n", | 2738 | PRINTKI("fb%d: %s frame buffer device on %s\n", |
2752 | info->node, info->fix.id, name); | 2739 | info->node, info->fix.id, par->bus_type == ISA ? "ISA" : "PCI"); |
2753 | return 0; | 2740 | return 0; |
2754 | 2741 | ||
2755 | aty_init_exit: | 2742 | aty_init_exit: |
@@ -2770,6 +2757,19 @@ aty_init_exit: | |||
2770 | return -1; | 2757 | return -1; |
2771 | } | 2758 | } |
2772 | 2759 | ||
2760 | static void aty_resume_chip(struct fb_info *info) | ||
2761 | { | ||
2762 | struct atyfb_par *par = info->par; | ||
2763 | |||
2764 | aty_st_le32(MEM_CNTL, par->mem_cntl, par); | ||
2765 | |||
2766 | if (par->pll_ops->resume_pll) | ||
2767 | par->pll_ops->resume_pll(info, &par->pll); | ||
2768 | |||
2769 | if (par->aux_start) | ||
2770 | aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par); | ||
2771 | } | ||
2772 | |||
2773 | #ifdef CONFIG_ATARI | 2773 | #ifdef CONFIG_ATARI |
2774 | static int __devinit store_video_par(char *video_str, unsigned char m64_num) | 2774 | static int __devinit store_video_par(char *video_str, unsigned char m64_num) |
2775 | { | 2775 | { |
@@ -2826,9 +2826,9 @@ static int atyfb_blank(int blank, struct fb_info *info) | |||
2826 | #endif | 2826 | #endif |
2827 | 2827 | ||
2828 | gen_cntl = aty_ld_le32(CRTC_GEN_CNTL, par); | 2828 | gen_cntl = aty_ld_le32(CRTC_GEN_CNTL, par); |
2829 | gen_cntl &= ~0x400004c; | ||
2829 | switch (blank) { | 2830 | switch (blank) { |
2830 | case FB_BLANK_UNBLANK: | 2831 | case FB_BLANK_UNBLANK: |
2831 | gen_cntl &= ~0x400004c; | ||
2832 | break; | 2832 | break; |
2833 | case FB_BLANK_NORMAL: | 2833 | case FB_BLANK_NORMAL: |
2834 | gen_cntl |= 0x4000040; | 2834 | gen_cntl |= 0x4000040; |
@@ -2863,17 +2863,10 @@ static int atyfb_blank(int blank, struct fb_info *info) | |||
2863 | static void aty_st_pal(u_int regno, u_int red, u_int green, u_int blue, | 2863 | static void aty_st_pal(u_int regno, u_int red, u_int green, u_int blue, |
2864 | const struct atyfb_par *par) | 2864 | const struct atyfb_par *par) |
2865 | { | 2865 | { |
2866 | #ifdef CONFIG_ATARI | 2866 | aty_st_8(DAC_W_INDEX, regno, par); |
2867 | out_8(&par->aty_cmap_regs->windex, regno); | 2867 | aty_st_8(DAC_DATA, red, par); |
2868 | out_8(&par->aty_cmap_regs->lut, red); | 2868 | aty_st_8(DAC_DATA, green, par); |
2869 | out_8(&par->aty_cmap_regs->lut, green); | 2869 | aty_st_8(DAC_DATA, blue, par); |
2870 | out_8(&par->aty_cmap_regs->lut, blue); | ||
2871 | #else | ||
2872 | writeb(regno, &par->aty_cmap_regs->windex); | ||
2873 | writeb(red, &par->aty_cmap_regs->lut); | ||
2874 | writeb(green, &par->aty_cmap_regs->lut); | ||
2875 | writeb(blue, &par->aty_cmap_regs->lut); | ||
2876 | #endif | ||
2877 | } | 2870 | } |
2878 | 2871 | ||
2879 | /* | 2872 | /* |
@@ -3182,7 +3175,7 @@ static int __devinit atyfb_setup_sparc(struct pci_dev *pdev, | |||
3182 | 3175 | ||
3183 | #ifdef __i386__ | 3176 | #ifdef __i386__ |
3184 | #ifdef CONFIG_FB_ATY_GENERIC_LCD | 3177 | #ifdef CONFIG_FB_ATY_GENERIC_LCD |
3185 | static void aty_init_lcd(struct atyfb_par *par, u32 bios_base) | 3178 | static void __devinit aty_init_lcd(struct atyfb_par *par, u32 bios_base) |
3186 | { | 3179 | { |
3187 | u32 driv_inf_tab, sig; | 3180 | u32 driv_inf_tab, sig; |
3188 | u16 lcd_ofs; | 3181 | u16 lcd_ofs; |
@@ -3527,6 +3520,10 @@ static int __devinit atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *i | |||
3527 | atyfb_setup_generic_fail: | 3520 | atyfb_setup_generic_fail: |
3528 | iounmap(par->ati_regbase); | 3521 | iounmap(par->ati_regbase); |
3529 | par->ati_regbase = NULL; | 3522 | par->ati_regbase = NULL; |
3523 | if (info->screen_base) { | ||
3524 | iounmap(info->screen_base); | ||
3525 | info->screen_base = NULL; | ||
3526 | } | ||
3530 | return ret; | 3527 | return ret; |
3531 | } | 3528 | } |
3532 | 3529 | ||
@@ -3594,7 +3591,7 @@ static int __devinit atyfb_pci_probe(struct pci_dev *pdev, const struct pci_devi | |||
3594 | pci_set_drvdata(pdev, info); | 3591 | pci_set_drvdata(pdev, info); |
3595 | 3592 | ||
3596 | /* Init chip & register framebuffer */ | 3593 | /* Init chip & register framebuffer */ |
3597 | if (aty_init(info, "PCI")) | 3594 | if (aty_init(info)) |
3598 | goto err_release_io; | 3595 | goto err_release_io; |
3599 | 3596 | ||
3600 | #ifdef __sparc__ | 3597 | #ifdef __sparc__ |
@@ -3641,12 +3638,13 @@ err_release_mem: | |||
3641 | 3638 | ||
3642 | #ifdef CONFIG_ATARI | 3639 | #ifdef CONFIG_ATARI |
3643 | 3640 | ||
3644 | static int __devinit atyfb_atari_probe(void) | 3641 | static int __init atyfb_atari_probe(void) |
3645 | { | 3642 | { |
3646 | struct atyfb_par *par; | 3643 | struct atyfb_par *par; |
3647 | struct fb_info *info; | 3644 | struct fb_info *info; |
3648 | int m64_num; | 3645 | int m64_num; |
3649 | u32 clock_r; | 3646 | u32 clock_r; |
3647 | int num_found = 0; | ||
3650 | 3648 | ||
3651 | for (m64_num = 0; m64_num < mach64_count; m64_num++) { | 3649 | for (m64_num = 0; m64_num < mach64_count; m64_num++) { |
3652 | if (!phys_vmembase[m64_num] || !phys_size[m64_num] || | 3650 | if (!phys_vmembase[m64_num] || !phys_size[m64_num] || |
@@ -3694,16 +3692,34 @@ static int __devinit atyfb_atari_probe(void) | |||
3694 | break; | 3692 | break; |
3695 | } | 3693 | } |
3696 | 3694 | ||
3697 | if (aty_init(info, "ISA bus")) { | 3695 | /* Fake pci_id for correct_chipset() */ |
3696 | switch (aty_ld_le32(CONFIG_CHIP_ID, par) & CFG_CHIP_TYPE) { | ||
3697 | case 0x00d7: | ||
3698 | par->pci_id = PCI_CHIP_MACH64GX; | ||
3699 | break; | ||
3700 | case 0x0057: | ||
3701 | par->pci_id = PCI_CHIP_MACH64CX; | ||
3702 | break; | ||
3703 | default: | ||
3704 | break; | ||
3705 | } | ||
3706 | |||
3707 | if (correct_chipset(par) || aty_init(info)) { | ||
3708 | iounmap(info->screen_base); | ||
3709 | iounmap(par->ati_regbase); | ||
3698 | framebuffer_release(info); | 3710 | framebuffer_release(info); |
3699 | /* This is insufficient! kernel_map has added two large chunks!! */ | 3711 | } else { |
3700 | return -ENXIO; | 3712 | num_found++; |
3701 | } | 3713 | } |
3702 | } | 3714 | } |
3715 | |||
3716 | return num_found ? 0 : -ENXIO; | ||
3703 | } | 3717 | } |
3704 | 3718 | ||
3705 | #endif /* CONFIG_ATARI */ | 3719 | #endif /* CONFIG_ATARI */ |
3706 | 3720 | ||
3721 | #ifdef CONFIG_PCI | ||
3722 | |||
3707 | static void __devexit atyfb_remove(struct fb_info *info) | 3723 | static void __devexit atyfb_remove(struct fb_info *info) |
3708 | { | 3724 | { |
3709 | struct atyfb_par *par = (struct atyfb_par *) info->par; | 3725 | struct atyfb_par *par = (struct atyfb_par *) info->par; |
@@ -3751,7 +3767,6 @@ static void __devexit atyfb_remove(struct fb_info *info) | |||
3751 | framebuffer_release(info); | 3767 | framebuffer_release(info); |
3752 | } | 3768 | } |
3753 | 3769 | ||
3754 | #ifdef CONFIG_PCI | ||
3755 | 3770 | ||
3756 | static void __devexit atyfb_pci_remove(struct pci_dev *pdev) | 3771 | static void __devexit atyfb_pci_remove(struct pci_dev *pdev) |
3757 | { | 3772 | { |
@@ -3786,7 +3801,7 @@ static struct pci_driver atyfb_driver = { | |||
3786 | #endif /* CONFIG_PCI */ | 3801 | #endif /* CONFIG_PCI */ |
3787 | 3802 | ||
3788 | #ifndef MODULE | 3803 | #ifndef MODULE |
3789 | static int __devinit atyfb_setup(char *options) | 3804 | static int __init atyfb_setup(char *options) |
3790 | { | 3805 | { |
3791 | char *this_opt; | 3806 | char *this_opt; |
3792 | 3807 | ||
@@ -3858,7 +3873,7 @@ static int __devinit atyfb_setup(char *options) | |||
3858 | } | 3873 | } |
3859 | #endif /* MODULE */ | 3874 | #endif /* MODULE */ |
3860 | 3875 | ||
3861 | static int __devinit atyfb_init(void) | 3876 | static int __init atyfb_init(void) |
3862 | { | 3877 | { |
3863 | int err1 = 1, err2 = 1; | 3878 | int err1 = 1, err2 = 1; |
3864 | #ifndef MODULE | 3879 | #ifndef MODULE |
diff --git a/drivers/video/aty/mach64_ct.c b/drivers/video/aty/mach64_ct.c index 5080816be653..f3b487b8710b 100644 --- a/drivers/video/aty/mach64_ct.c +++ b/drivers/video/aty/mach64_ct.c | |||
@@ -370,8 +370,8 @@ void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll) | |||
370 | #endif | 370 | #endif |
371 | } | 371 | } |
372 | 372 | ||
373 | static void __init aty_get_pll_ct(const struct fb_info *info, | 373 | static void __devinit aty_get_pll_ct(const struct fb_info *info, |
374 | union aty_pll *pll) | 374 | union aty_pll *pll) |
375 | { | 375 | { |
376 | struct atyfb_par *par = (struct atyfb_par *) info->par; | 376 | struct atyfb_par *par = (struct atyfb_par *) info->par; |
377 | u8 tmp, clock; | 377 | u8 tmp, clock; |
@@ -394,12 +394,12 @@ static void __init aty_get_pll_ct(const struct fb_info *info, | |||
394 | } | 394 | } |
395 | } | 395 | } |
396 | 396 | ||
397 | static int __init aty_init_pll_ct(const struct fb_info *info, | 397 | static int __devinit aty_init_pll_ct(const struct fb_info *info, |
398 | union aty_pll *pll) | 398 | union aty_pll *pll) |
399 | { | 399 | { |
400 | struct atyfb_par *par = (struct atyfb_par *) info->par; | 400 | struct atyfb_par *par = (struct atyfb_par *) info->par; |
401 | u8 mpost_div, xpost_div, sclk_post_div_real, sclk_fb_div, spll_cntl2; | 401 | u8 mpost_div, xpost_div, sclk_post_div_real; |
402 | u32 q, i, memcntl, trp; | 402 | u32 q, memcntl, trp; |
403 | u32 dsp_config, dsp_on_off, vga_dsp_config, vga_dsp_on_off; | 403 | u32 dsp_config, dsp_on_off, vga_dsp_config, vga_dsp_on_off; |
404 | #ifdef DEBUG | 404 | #ifdef DEBUG |
405 | int pllmclk, pllsclk; | 405 | int pllmclk, pllsclk; |
@@ -575,14 +575,30 @@ static int __init aty_init_pll_ct(const struct fb_info *info, | |||
575 | mpost_div += (q < 32*8); | 575 | mpost_div += (q < 32*8); |
576 | } | 576 | } |
577 | sclk_post_div_real = postdividers[mpost_div]; | 577 | sclk_post_div_real = postdividers[mpost_div]; |
578 | sclk_fb_div = q * sclk_post_div_real / 8; | 578 | pll->ct.sclk_fb_div = q * sclk_post_div_real / 8; |
579 | spll_cntl2 = mpost_div << 4; | 579 | pll->ct.spll_cntl2 = mpost_div << 4; |
580 | #ifdef DEBUG | 580 | #ifdef DEBUG |
581 | pllsclk = (1000000 * 2 * sclk_fb_div) / | 581 | pllsclk = (1000000 * 2 * pll->ct.sclk_fb_div) / |
582 | (par->ref_clk_per * pll->ct.pll_ref_div); | 582 | (par->ref_clk_per * pll->ct.pll_ref_div); |
583 | printk("atyfb(%s): use sclk, pllsclk=%d MHz, sclk=mclk=%d MHz\n", | 583 | printk("atyfb(%s): use sclk, pllsclk=%d MHz, sclk=mclk=%d MHz\n", |
584 | __FUNCTION__, pllsclk, pllsclk / sclk_post_div_real); | 584 | __FUNCTION__, pllsclk, pllsclk / sclk_post_div_real); |
585 | #endif | 585 | #endif |
586 | } | ||
587 | |||
588 | /* Disable the extra precision pixel clock controls since we do not use them. */ | ||
589 | pll->ct.ext_vpll_cntl = aty_ld_pll_ct(EXT_VPLL_CNTL, par); | ||
590 | pll->ct.ext_vpll_cntl &= ~(EXT_VPLL_EN | EXT_VPLL_VGA_EN | EXT_VPLL_INSYNC); | ||
591 | |||
592 | return 0; | ||
593 | } | ||
594 | |||
595 | static void aty_resume_pll_ct(const struct fb_info *info, | ||
596 | union aty_pll *pll) | ||
597 | { | ||
598 | struct atyfb_par *par = info->par; | ||
599 | |||
600 | if (par->mclk_per != par->xclk_per) { | ||
601 | int i; | ||
586 | /* | 602 | /* |
587 | * This disables the sclk, crashes the computer as reported: | 603 | * This disables the sclk, crashes the computer as reported: |
588 | * aty_st_pll_ct(SPLL_CNTL2, 3, info); | 604 | * aty_st_pll_ct(SPLL_CNTL2, 3, info); |
@@ -590,8 +606,8 @@ static int __init aty_init_pll_ct(const struct fb_info *info, | |||
590 | * So it seems the sclk must be enabled before it is used; | 606 | * So it seems the sclk must be enabled before it is used; |
591 | * so PLL_GEN_CNTL must be programmed *after* the sclk. | 607 | * so PLL_GEN_CNTL must be programmed *after* the sclk. |
592 | */ | 608 | */ |
593 | aty_st_pll_ct(SCLK_FB_DIV, sclk_fb_div, par); | 609 | aty_st_pll_ct(SCLK_FB_DIV, pll->ct.sclk_fb_div, par); |
594 | aty_st_pll_ct(SPLL_CNTL2, spll_cntl2, par); | 610 | aty_st_pll_ct(SPLL_CNTL2, pll->ct.spll_cntl2, par); |
595 | /* | 611 | /* |
596 | * The sclk has been started. However, I believe the first clock | 612 | * The sclk has been started. However, I believe the first clock |
597 | * ticks it generates are not very stable. Hope this primitive loop | 613 | * ticks it generates are not very stable. Hope this primitive loop |
@@ -605,11 +621,7 @@ static int __init aty_init_pll_ct(const struct fb_info *info, | |||
605 | aty_st_pll_ct(PLL_GEN_CNTL, pll->ct.pll_gen_cntl, par); | 621 | aty_st_pll_ct(PLL_GEN_CNTL, pll->ct.pll_gen_cntl, par); |
606 | aty_st_pll_ct(MCLK_FB_DIV, pll->ct.mclk_fb_div, par); | 622 | aty_st_pll_ct(MCLK_FB_DIV, pll->ct.mclk_fb_div, par); |
607 | aty_st_pll_ct(PLL_EXT_CNTL, pll->ct.pll_ext_cntl, par); | 623 | aty_st_pll_ct(PLL_EXT_CNTL, pll->ct.pll_ext_cntl, par); |
608 | /* Disable the extra precision pixel clock controls since we do not use them. */ | 624 | aty_st_pll_ct(EXT_VPLL_CNTL, pll->ct.ext_vpll_cntl, par); |
609 | aty_st_pll_ct(EXT_VPLL_CNTL, aty_ld_pll_ct(EXT_VPLL_CNTL, par) & | ||
610 | ~(EXT_VPLL_EN | EXT_VPLL_VGA_EN | EXT_VPLL_INSYNC), par); | ||
611 | |||
612 | return 0; | ||
613 | } | 625 | } |
614 | 626 | ||
615 | static int dummy(void) | 627 | static int dummy(void) |
@@ -626,5 +638,6 @@ const struct aty_pll_ops aty_pll_ct = { | |||
626 | .pll_to_var = aty_pll_to_var_ct, | 638 | .pll_to_var = aty_pll_to_var_ct, |
627 | .set_pll = aty_set_pll_ct, | 639 | .set_pll = aty_set_pll_ct, |
628 | .get_pll = aty_get_pll_ct, | 640 | .get_pll = aty_get_pll_ct, |
629 | .init_pll = aty_init_pll_ct | 641 | .init_pll = aty_init_pll_ct, |
642 | .resume_pll = aty_resume_pll_ct, | ||
630 | }; | 643 | }; |
diff --git a/drivers/video/aty/radeon_i2c.c b/drivers/video/aty/radeon_i2c.c index 676754520099..e7c5b219ad1b 100644 --- a/drivers/video/aty/radeon_i2c.c +++ b/drivers/video/aty/radeon_i2c.c | |||
@@ -120,26 +120,32 @@ void radeon_create_i2c_busses(struct radeonfb_info *rinfo) | |||
120 | void radeon_delete_i2c_busses(struct radeonfb_info *rinfo) | 120 | void radeon_delete_i2c_busses(struct radeonfb_info *rinfo) |
121 | { | 121 | { |
122 | if (rinfo->i2c[0].rinfo) | 122 | if (rinfo->i2c[0].rinfo) |
123 | i2c_bit_del_bus(&rinfo->i2c[0].adapter); | 123 | i2c_del_adapter(&rinfo->i2c[0].adapter); |
124 | rinfo->i2c[0].rinfo = NULL; | 124 | rinfo->i2c[0].rinfo = NULL; |
125 | 125 | ||
126 | if (rinfo->i2c[1].rinfo) | 126 | if (rinfo->i2c[1].rinfo) |
127 | i2c_bit_del_bus(&rinfo->i2c[1].adapter); | 127 | i2c_del_adapter(&rinfo->i2c[1].adapter); |
128 | rinfo->i2c[1].rinfo = NULL; | 128 | rinfo->i2c[1].rinfo = NULL; |
129 | 129 | ||
130 | if (rinfo->i2c[2].rinfo) | 130 | if (rinfo->i2c[2].rinfo) |
131 | i2c_bit_del_bus(&rinfo->i2c[2].adapter); | 131 | i2c_del_adapter(&rinfo->i2c[2].adapter); |
132 | rinfo->i2c[2].rinfo = NULL; | 132 | rinfo->i2c[2].rinfo = NULL; |
133 | 133 | ||
134 | if (rinfo->i2c[3].rinfo) | 134 | if (rinfo->i2c[3].rinfo) |
135 | i2c_bit_del_bus(&rinfo->i2c[3].adapter); | 135 | i2c_del_adapter(&rinfo->i2c[3].adapter); |
136 | rinfo->i2c[3].rinfo = NULL; | 136 | rinfo->i2c[3].rinfo = NULL; |
137 | } | 137 | } |
138 | 138 | ||
139 | int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, | 139 | int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, |
140 | u8 **out_edid) | 140 | u8 **out_edid) |
141 | { | 141 | { |
142 | u8 *edid = fb_ddc_read(&rinfo->i2c[conn-1].adapter); | 142 | u32 reg = rinfo->i2c[conn-1].ddc_reg; |
143 | u8 *edid; | ||
144 | |||
145 | OUTREG(reg, INREG(reg) & | ||
146 | ~(VGA_DDC_DATA_OUTPUT | VGA_DDC_CLK_OUTPUT)); | ||
147 | |||
148 | edid = fb_ddc_read(&rinfo->i2c[conn-1].adapter); | ||
143 | 149 | ||
144 | if (out_edid) | 150 | if (out_edid) |
145 | *out_edid = edid; | 151 | *out_edid = edid; |
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c index ea531a6f45d1..38c7dbf8c151 100644 --- a/drivers/video/aty/radeon_monitor.c +++ b/drivers/video/aty/radeon_monitor.c | |||
@@ -104,10 +104,9 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_ | |||
104 | if (pedid == NULL) | 104 | if (pedid == NULL) |
105 | return mt; | 105 | return mt; |
106 | 106 | ||
107 | tmp = (u8 *)kmalloc(EDID_LENGTH, GFP_KERNEL); | 107 | tmp = kmemdup(pedid, EDID_LENGTH, GFP_KERNEL); |
108 | if (!tmp) | 108 | if (!tmp) |
109 | return mt; | 109 | return mt; |
110 | memcpy(tmp, pedid, EDID_LENGTH); | ||
111 | *out_EDID = tmp; | 110 | *out_EDID = tmp; |
112 | return mt; | 111 | return mt; |
113 | } | 112 | } |