.. | .. |
---|
269 | 269 | static bool nomtrr = 0; |
---|
270 | 270 | static bool force_sleep; |
---|
271 | 271 | static bool ignore_devlist; |
---|
272 | | -#ifdef CONFIG_PMAC_BACKLIGHT |
---|
273 | | -static int backlight = 1; |
---|
274 | | -#else |
---|
275 | | -static int backlight = 0; |
---|
276 | | -#endif |
---|
| 272 | +static int backlight = IS_BUILTIN(CONFIG_PMAC_BACKLIGHT); |
---|
277 | 273 | |
---|
278 | 274 | /* Note about this function: we have some rare cases where we must not schedule, |
---|
279 | 275 | * this typically happen with our special "wake up early" hook which allows us to |
---|
.. | .. |
---|
849 | 845 | case 9 ... 16: |
---|
850 | 846 | v.bits_per_pixel = 16; |
---|
851 | 847 | break; |
---|
852 | | - case 17 ... 24: |
---|
853 | | -#if 0 /* Doesn't seem to work */ |
---|
854 | | - v.bits_per_pixel = 24; |
---|
855 | | - break; |
---|
856 | | -#endif |
---|
857 | | - return -EINVAL; |
---|
858 | 848 | case 25 ... 32: |
---|
859 | 849 | v.bits_per_pixel = 32; |
---|
860 | 850 | break; |
---|
.. | .. |
---|
1650 | 1640 | struct fb_var_screeninfo *mode = &info->var; |
---|
1651 | 1641 | struct radeon_regs *newmode; |
---|
1652 | 1642 | int hTotal, vTotal, hSyncStart, hSyncEnd, |
---|
1653 | | - hSyncPol, vSyncStart, vSyncEnd, vSyncPol, cSync; |
---|
| 1643 | + vSyncStart, vSyncEnd; |
---|
1654 | 1644 | u8 hsync_adj_tab[] = {0, 0x12, 9, 9, 6, 5}; |
---|
1655 | 1645 | u8 hsync_fudge_fp[] = {2, 2, 0, 0, 5, 5}; |
---|
1656 | 1646 | u32 sync, h_sync_pol, v_sync_pol, dotClock, pixClock; |
---|
1657 | 1647 | int i, freq; |
---|
1658 | 1648 | int format = 0; |
---|
1659 | 1649 | int nopllcalc = 0; |
---|
1660 | | - int hsync_start, hsync_fudge, bytpp, hsync_wid, vsync_wid; |
---|
| 1650 | + int hsync_start, hsync_fudge, hsync_wid, vsync_wid; |
---|
1661 | 1651 | int primary_mon = PRIMARY_MONITOR(rinfo); |
---|
1662 | 1652 | int depth = var_to_depth(mode); |
---|
1663 | 1653 | int use_rmx = 0; |
---|
.. | .. |
---|
1730 | 1720 | else if (vsync_wid > 0x1f) /* max */ |
---|
1731 | 1721 | vsync_wid = 0x1f; |
---|
1732 | 1722 | |
---|
1733 | | - hSyncPol = mode->sync & FB_SYNC_HOR_HIGH_ACT ? 0 : 1; |
---|
1734 | | - vSyncPol = mode->sync & FB_SYNC_VERT_HIGH_ACT ? 0 : 1; |
---|
1735 | | - |
---|
1736 | | - cSync = mode->sync & FB_SYNC_COMP_HIGH_ACT ? (1 << 4) : 0; |
---|
1737 | | - |
---|
1738 | 1723 | format = radeon_get_dstbpp(depth); |
---|
1739 | | - bytpp = mode->bits_per_pixel >> 3; |
---|
1740 | 1724 | |
---|
1741 | 1725 | if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD)) |
---|
1742 | 1726 | hsync_fudge = hsync_fudge_fp[format-1]; |
---|
.. | .. |
---|
1965 | 1949 | } |
---|
1966 | 1950 | |
---|
1967 | 1951 | |
---|
1968 | | -static struct fb_ops radeonfb_ops = { |
---|
| 1952 | +static const struct fb_ops radeonfb_ops = { |
---|
1969 | 1953 | .owner = THIS_MODULE, |
---|
1970 | 1954 | .fb_check_var = radeonfb_check_var, |
---|
1971 | 1955 | .fb_set_par = radeonfb_set_par, |
---|
.. | .. |
---|
2217 | 2201 | char *buf, loff_t off, size_t count) |
---|
2218 | 2202 | { |
---|
2219 | 2203 | struct device *dev = container_of(kobj, struct device, kobj); |
---|
2220 | | - struct pci_dev *pdev = to_pci_dev(dev); |
---|
2221 | | - struct fb_info *info = pci_get_drvdata(pdev); |
---|
| 2204 | + struct fb_info *info = dev_get_drvdata(dev); |
---|
2222 | 2205 | struct radeonfb_info *rinfo = info->par; |
---|
2223 | 2206 | |
---|
2224 | 2207 | return radeon_show_one_edid(buf, off, count, rinfo->mon1_EDID); |
---|
.. | .. |
---|
2230 | 2213 | char *buf, loff_t off, size_t count) |
---|
2231 | 2214 | { |
---|
2232 | 2215 | struct device *dev = container_of(kobj, struct device, kobj); |
---|
2233 | | - struct pci_dev *pdev = to_pci_dev(dev); |
---|
2234 | | - struct fb_info *info = pci_get_drvdata(pdev); |
---|
| 2216 | + struct fb_info *info = dev_get_drvdata(dev); |
---|
2235 | 2217 | struct radeonfb_info *rinfo = info->par; |
---|
2236 | 2218 | |
---|
2237 | 2219 | return radeon_show_one_edid(buf, off, count, rinfo->mon2_EDID); |
---|
.. | .. |
---|
2294 | 2276 | |
---|
2295 | 2277 | info = framebuffer_alloc(sizeof(struct radeonfb_info), &pdev->dev); |
---|
2296 | 2278 | if (!info) { |
---|
2297 | | - printk (KERN_ERR "radeonfb (%s): could not allocate memory\n", |
---|
2298 | | - pci_name(pdev)); |
---|
2299 | 2279 | ret = -ENOMEM; |
---|
2300 | 2280 | goto err_disable; |
---|
2301 | 2281 | } |
---|
.. | .. |
---|
2552 | 2532 | if (rinfo->mon2_EDID) |
---|
2553 | 2533 | sysfs_remove_bin_file(&rinfo->pdev->dev.kobj, &edid2_attr); |
---|
2554 | 2534 | |
---|
2555 | | -#if 0 |
---|
2556 | | - /* restore original state |
---|
2557 | | - * |
---|
2558 | | - * Doesn't quite work yet, I suspect if we come from a legacy |
---|
2559 | | - * VGA mode (or worse, text mode), we need to do some VGA black |
---|
2560 | | - * magic here that I know nothing about. --BenH |
---|
2561 | | - */ |
---|
2562 | | - radeon_write_mode (rinfo, &rinfo->init_state, 1); |
---|
2563 | | - #endif |
---|
2564 | | - |
---|
2565 | 2535 | del_timer_sync(&rinfo->lvds_timer); |
---|
2566 | 2536 | arch_phys_wc_del(rinfo->wc_cookie); |
---|
2567 | 2537 | unregister_framebuffer(info); |
---|
.. | .. |
---|
2585 | 2555 | framebuffer_release(info); |
---|
2586 | 2556 | } |
---|
2587 | 2557 | |
---|
| 2558 | +#ifdef CONFIG_PM |
---|
| 2559 | +#define RADEONFB_PCI_PM_OPS (&radeonfb_pci_pm_ops) |
---|
| 2560 | +#else |
---|
| 2561 | +#define RADEONFB_PCI_PM_OPS NULL |
---|
| 2562 | +#endif |
---|
2588 | 2563 | |
---|
2589 | 2564 | static struct pci_driver radeonfb_driver = { |
---|
2590 | 2565 | .name = "radeonfb", |
---|
2591 | 2566 | .id_table = radeonfb_pci_table, |
---|
2592 | 2567 | .probe = radeonfb_pci_register, |
---|
2593 | 2568 | .remove = radeonfb_pci_unregister, |
---|
2594 | | -#ifdef CONFIG_PM |
---|
2595 | | - .suspend = radeonfb_pci_suspend, |
---|
2596 | | - .resume = radeonfb_pci_resume, |
---|
2597 | | -#endif /* CONFIG_PM */ |
---|
| 2569 | + .driver.pm = RADEONFB_PCI_PM_OPS, |
---|
2598 | 2570 | }; |
---|
2599 | 2571 | |
---|
2600 | 2572 | #ifndef MODULE |
---|