aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/aty')
-rw-r--r--drivers/video/aty/aty128fb.c31
-rw-r--r--drivers/video/aty/atyfb_base.c22
-rw-r--r--drivers/video/aty/radeon_backlight.c4
-rw-r--r--drivers/video/aty/radeon_base.c18
-rw-r--r--drivers/video/aty/radeon_pm.c146
-rw-r--r--drivers/video/aty/radeonfb.h6
6 files changed, 177 insertions, 50 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index c64a717e2d4b..276a21530b95 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -455,7 +455,10 @@ static void do_wait_for_fifo(u16 entries, struct aty128fb_par *par);
455static void wait_for_fifo(u16 entries, struct aty128fb_par *par); 455static void wait_for_fifo(u16 entries, struct aty128fb_par *par);
456static void wait_for_idle(struct aty128fb_par *par); 456static void wait_for_idle(struct aty128fb_par *par);
457static u32 depth_to_dst(u32 depth); 457static u32 depth_to_dst(u32 depth);
458
459#ifdef CONFIG_FB_ATY128_BACKLIGHT
458static void aty128_bl_set_power(struct fb_info *info, int power); 460static void aty128_bl_set_power(struct fb_info *info, int power);
461#endif
459 462
460#define BIOS_IN8(v) (readb(bios + (v))) 463#define BIOS_IN8(v) (readb(bios + (v)))
461#define BIOS_IN16(v) (readb(bios + (v)) | \ 464#define BIOS_IN16(v) (readb(bios + (v)) | \
@@ -1798,10 +1801,14 @@ static struct backlight_properties aty128_bl_data = {
1798static void aty128_bl_set_power(struct fb_info *info, int power) 1801static void aty128_bl_set_power(struct fb_info *info, int power)
1799{ 1802{
1800 mutex_lock(&info->bl_mutex); 1803 mutex_lock(&info->bl_mutex);
1801 up(&info->bl_dev->sem); 1804
1802 info->bl_dev->props->power = power; 1805 if (info->bl_dev) {
1803 __aty128_bl_update_status(info->bl_dev); 1806 down(&info->bl_dev->sem);
1804 down(&info->bl_dev->sem); 1807 info->bl_dev->props->power = power;
1808 __aty128_bl_update_status(info->bl_dev);
1809 up(&info->bl_dev->sem);
1810 }
1811
1805 mutex_unlock(&info->bl_mutex); 1812 mutex_unlock(&info->bl_mutex);
1806} 1813}
1807 1814
@@ -1825,7 +1832,7 @@ static void aty128_bl_init(struct aty128fb_par *par)
1825 bd = backlight_device_register(name, par, &aty128_bl_data); 1832 bd = backlight_device_register(name, par, &aty128_bl_data);
1826 if (IS_ERR(bd)) { 1833 if (IS_ERR(bd)) {
1827 info->bl_dev = NULL; 1834 info->bl_dev = NULL;
1828 printk("aty128: Backlight registration failed\n"); 1835 printk(KERN_WARNING "aty128: Backlight registration failed\n");
1829 goto error; 1836 goto error;
1830 } 1837 }
1831 1838
@@ -1836,11 +1843,11 @@ static void aty128_bl_init(struct aty128fb_par *par)
1836 219 * FB_BACKLIGHT_MAX / MAX_LEVEL); 1843 219 * FB_BACKLIGHT_MAX / MAX_LEVEL);
1837 mutex_unlock(&info->bl_mutex); 1844 mutex_unlock(&info->bl_mutex);
1838 1845
1839 up(&bd->sem); 1846 down(&bd->sem);
1840 bd->props->brightness = aty128_bl_data.max_brightness; 1847 bd->props->brightness = aty128_bl_data.max_brightness;
1841 bd->props->power = FB_BLANK_UNBLANK; 1848 bd->props->power = FB_BLANK_UNBLANK;
1842 bd->props->update_status(bd); 1849 bd->props->update_status(bd);
1843 down(&bd->sem); 1850 up(&bd->sem);
1844 1851
1845#ifdef CONFIG_PMAC_BACKLIGHT 1852#ifdef CONFIG_PMAC_BACKLIGHT
1846 mutex_lock(&pmac_backlight_mutex); 1853 mutex_lock(&pmac_backlight_mutex);
@@ -1910,9 +1917,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
1910 u8 chip_rev; 1917 u8 chip_rev;
1911 u32 dac; 1918 u32 dac;
1912 1919
1913 if (!par->vram_size) /* may have already been probed */
1914 par->vram_size = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF;
1915
1916 /* Get the chip revision */ 1920 /* Get the chip revision */
1917 chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F; 1921 chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F;
1918 1922
@@ -2025,9 +2029,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
2025 2029
2026 aty128_init_engine(par); 2030 aty128_init_engine(par);
2027 2031
2028 if (register_framebuffer(info) < 0)
2029 return 0;
2030
2031 par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM); 2032 par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM);
2032 par->pdev = pdev; 2033 par->pdev = pdev;
2033 par->asleep = 0; 2034 par->asleep = 0;
@@ -2037,6 +2038,9 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
2037 aty128_bl_init(par); 2038 aty128_bl_init(par);
2038#endif 2039#endif
2039 2040
2041 if (register_framebuffer(info) < 0)
2042 return 0;
2043
2040 printk(KERN_INFO "fb%d: %s frame buffer device on %s\n", 2044 printk(KERN_INFO "fb%d: %s frame buffer device on %s\n",
2041 info->node, info->fix.id, video_card); 2045 info->node, info->fix.id, video_card);
2042 2046
@@ -2086,7 +2090,6 @@ static int __devinit aty128_probe(struct pci_dev *pdev, const struct pci_device_
2086 par = info->par; 2090 par = info->par;
2087 2091
2088 info->pseudo_palette = par->pseudo_palette; 2092 info->pseudo_palette = par->pseudo_palette;
2089 info->fix = aty128fb_fix;
2090 2093
2091 /* Virtualize mmio region */ 2094 /* Virtualize mmio region */
2092 info->fix.mmio_start = reg_addr; 2095 info->fix.mmio_start = reg_addr;
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 1507d19f481f..19a71f045784 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2200,10 +2200,14 @@ static struct backlight_properties aty_bl_data = {
2200static void aty_bl_set_power(struct fb_info *info, int power) 2200static void aty_bl_set_power(struct fb_info *info, int power)
2201{ 2201{
2202 mutex_lock(&info->bl_mutex); 2202 mutex_lock(&info->bl_mutex);
2203 up(&info->bl_dev->sem); 2203
2204 info->bl_dev->props->power = power; 2204 if (info->bl_dev) {
2205 __aty_bl_update_status(info->bl_dev); 2205 down(&info->bl_dev->sem);
2206 down(&info->bl_dev->sem); 2206 info->bl_dev->props->power = power;
2207 __aty_bl_update_status(info->bl_dev);
2208 up(&info->bl_dev->sem);
2209 }
2210
2207 mutex_unlock(&info->bl_mutex); 2211 mutex_unlock(&info->bl_mutex);
2208} 2212}
2209 2213
@@ -2223,7 +2227,7 @@ static void aty_bl_init(struct atyfb_par *par)
2223 bd = backlight_device_register(name, par, &aty_bl_data); 2227 bd = backlight_device_register(name, par, &aty_bl_data);
2224 if (IS_ERR(bd)) { 2228 if (IS_ERR(bd)) {
2225 info->bl_dev = NULL; 2229 info->bl_dev = NULL;
2226 printk("aty: Backlight registration failed\n"); 2230 printk(KERN_WARNING "aty: Backlight registration failed\n");
2227 goto error; 2231 goto error;
2228 } 2232 }
2229 2233
@@ -2234,11 +2238,11 @@ static void aty_bl_init(struct atyfb_par *par)
2234 0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL); 2238 0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL);
2235 mutex_unlock(&info->bl_mutex); 2239 mutex_unlock(&info->bl_mutex);
2236 2240
2237 up(&bd->sem); 2241 down(&bd->sem);
2238 bd->props->brightness = aty_bl_data.max_brightness; 2242 bd->props->brightness = aty_bl_data.max_brightness;
2239 bd->props->power = FB_BLANK_UNBLANK; 2243 bd->props->power = FB_BLANK_UNBLANK;
2240 bd->props->update_status(bd); 2244 bd->props->update_status(bd);
2241 down(&bd->sem); 2245 up(&bd->sem);
2242 2246
2243#ifdef CONFIG_PMAC_BACKLIGHT 2247#ifdef CONFIG_PMAC_BACKLIGHT
2244 mutex_lock(&pmac_backlight_mutex); 2248 mutex_lock(&pmac_backlight_mutex);
@@ -2812,7 +2816,7 @@ static int atyfb_blank(int blank, struct fb_info *info)
2812 if (par->lock_blank || par->asleep) 2816 if (par->lock_blank || par->asleep)
2813 return 0; 2817 return 0;
2814 2818
2815#ifdef CONFIG_PMAC_BACKLIGHT 2819#ifdef CONFIG_FB_ATY_BACKLIGHT
2816 if (machine_is(powermac) && blank > FB_BLANK_NORMAL) 2820 if (machine_is(powermac) && blank > FB_BLANK_NORMAL)
2817 aty_bl_set_power(info, FB_BLANK_POWERDOWN); 2821 aty_bl_set_power(info, FB_BLANK_POWERDOWN);
2818#elif defined(CONFIG_FB_ATY_GENERIC_LCD) 2822#elif defined(CONFIG_FB_ATY_GENERIC_LCD)
@@ -2844,7 +2848,7 @@ static int atyfb_blank(int blank, struct fb_info *info)
2844 } 2848 }
2845 aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par); 2849 aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par);
2846 2850
2847#ifdef CONFIG_PMAC_BACKLIGHT 2851#ifdef CONFIG_FB_ATY_BACKLIGHT
2848 if (machine_is(powermac) && blank <= FB_BLANK_NORMAL) 2852 if (machine_is(powermac) && blank <= FB_BLANK_NORMAL)
2849 aty_bl_set_power(info, FB_BLANK_UNBLANK); 2853 aty_bl_set_power(info, FB_BLANK_UNBLANK);
2850#elif defined(CONFIG_FB_ATY_GENERIC_LCD) 2854#elif defined(CONFIG_FB_ATY_GENERIC_LCD)
diff --git a/drivers/video/aty/radeon_backlight.c b/drivers/video/aty/radeon_backlight.c
index 1755dddf1899..585eb7b9e636 100644
--- a/drivers/video/aty/radeon_backlight.c
+++ b/drivers/video/aty/radeon_backlight.c
@@ -195,11 +195,11 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
195 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL); 195 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL);
196 mutex_unlock(&rinfo->info->bl_mutex); 196 mutex_unlock(&rinfo->info->bl_mutex);
197 197
198 up(&bd->sem); 198 down(&bd->sem);
199 bd->props->brightness = radeon_bl_data.max_brightness; 199 bd->props->brightness = radeon_bl_data.max_brightness;
200 bd->props->power = FB_BLANK_UNBLANK; 200 bd->props->power = FB_BLANK_UNBLANK;
201 bd->props->update_status(bd); 201 bd->props->update_status(bd);
202 down(&bd->sem); 202 up(&bd->sem);
203 203
204#ifdef CONFIG_PMAC_BACKLIGHT 204#ifdef CONFIG_PMAC_BACKLIGHT
205 mutex_lock(&pmac_backlight_mutex); 205 mutex_lock(&pmac_backlight_mutex);
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 8d85fc58142e..8e3400d5dd21 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -266,6 +266,8 @@ static int force_measure_pll = 0;
266#ifdef CONFIG_MTRR 266#ifdef CONFIG_MTRR
267static int nomtrr = 0; 267static int nomtrr = 0;
268#endif 268#endif
269static int force_sleep;
270static int ignore_devlist;
269 271
270/* 272/*
271 * prototypes 273 * prototypes
@@ -2327,9 +2329,9 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
2327 /* -2 is special: means ON on mobility chips and do not 2329 /* -2 is special: means ON on mobility chips and do not
2328 * change on others 2330 * change on others
2329 */ 2331 */
2330 radeonfb_pm_init(rinfo, rinfo->is_mobility ? 1 : -1); 2332 radeonfb_pm_init(rinfo, rinfo->is_mobility ? 1 : -1, ignore_devlist, force_sleep);
2331 } else 2333 } else
2332 radeonfb_pm_init(rinfo, default_dynclk); 2334 radeonfb_pm_init(rinfo, default_dynclk, ignore_devlist, force_sleep);
2333 2335
2334 pci_set_drvdata(pdev, info); 2336 pci_set_drvdata(pdev, info);
2335 2337
@@ -2477,6 +2479,12 @@ static int __init radeonfb_setup (char *options)
2477 force_measure_pll = 1; 2479 force_measure_pll = 1;
2478 } else if (!strncmp(this_opt, "ignore_edid", 11)) { 2480 } else if (!strncmp(this_opt, "ignore_edid", 11)) {
2479 ignore_edid = 1; 2481 ignore_edid = 1;
2482#if defined(CONFIG_PM) && defined(CONFIG_X86)
2483 } else if (!strncmp(this_opt, "force_sleep", 11)) {
2484 force_sleep = 1;
2485 } else if (!strncmp(this_opt, "ignore_devlist", 14)) {
2486 ignore_devlist = 1;
2487#endif
2480 } else 2488 } else
2481 mode_option = this_opt; 2489 mode_option = this_opt;
2482 } 2490 }
@@ -2532,3 +2540,9 @@ module_param(panel_yres, int, 0);
2532MODULE_PARM_DESC(panel_yres, "int: set panel yres"); 2540MODULE_PARM_DESC(panel_yres, "int: set panel yres");
2533module_param(mode_option, charp, 0); 2541module_param(mode_option, charp, 0);
2534MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" "); 2542MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
2543#if defined(CONFIG_PM) && defined(CONFIG_X86)
2544module_param(force_sleep, bool, 0);
2545MODULE_PARM_DESC(force_sleep, "bool: force D2 sleep mode on all hardware");
2546module_param(ignore_devlist, bool, 0);
2547MODULE_PARM_DESC(ignore_devlist, "bool: ignore workarounds for bugs in specific laptops");
2548#endif
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index c7091761cef4..f31e606a2ded 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -27,6 +27,99 @@
27 27
28#include "ati_ids.h" 28#include "ati_ids.h"
29 29
30static void radeon_reinitialize_M10(struct radeonfb_info *rinfo);
31
32/*
33 * Workarounds for bugs in PC laptops:
34 * - enable D2 sleep in some IBM Thinkpads
35 * - special case for Samsung P35
36 *
37 * Whitelist by subsystem vendor/device because
38 * its the subsystem vendor's fault!
39 */
40
41#if defined(CONFIG_PM) && defined(CONFIG_X86)
42struct radeon_device_id {
43 const char *ident; /* (arbitrary) Name */
44 const unsigned short subsystem_vendor; /* Subsystem Vendor ID */
45 const unsigned short subsystem_device; /* Subsystem Device ID */
46 const enum radeon_pm_mode pm_mode_modifier; /* modify pm_mode */
47 const reinit_function_ptr new_reinit_func; /* changed reinit_func */
48};
49
50#define BUGFIX(model, sv, sd, pm, fn) { \
51 .ident = model, \
52 .subsystem_vendor = sv, \
53 .subsystem_device = sd, \
54 .pm_mode_modifier = pm, \
55 .new_reinit_func = fn \
56}
57
58static struct radeon_device_id radeon_workaround_list[] = {
59 BUGFIX("IBM Thinkpad R32",
60 PCI_VENDOR_ID_IBM, 0x1905,
61 radeon_pm_d2, NULL),
62 BUGFIX("IBM Thinkpad R40",
63 PCI_VENDOR_ID_IBM, 0x0526,
64 radeon_pm_d2, NULL),
65 BUGFIX("IBM Thinkpad R40",
66 PCI_VENDOR_ID_IBM, 0x0527,
67 radeon_pm_d2, NULL),
68 BUGFIX("IBM Thinkpad R50/R51/T40/T41",
69 PCI_VENDOR_ID_IBM, 0x0531,
70 radeon_pm_d2, NULL),
71 BUGFIX("IBM Thinkpad R51/T40/T41/T42",
72 PCI_VENDOR_ID_IBM, 0x0530,
73 radeon_pm_d2, NULL),
74 BUGFIX("IBM Thinkpad T30",
75 PCI_VENDOR_ID_IBM, 0x0517,
76 radeon_pm_d2, NULL),
77 BUGFIX("IBM Thinkpad T40p",
78 PCI_VENDOR_ID_IBM, 0x054d,
79 radeon_pm_d2, NULL),
80 BUGFIX("IBM Thinkpad T42",
81 PCI_VENDOR_ID_IBM, 0x0550,
82 radeon_pm_d2, NULL),
83 BUGFIX("IBM Thinkpad X31/X32",
84 PCI_VENDOR_ID_IBM, 0x052f,
85 radeon_pm_d2, NULL),
86 BUGFIX("Samsung P35",
87 PCI_VENDOR_ID_SAMSUNG, 0xc00c,
88 radeon_pm_off, radeon_reinitialize_M10),
89 { .ident = NULL }
90};
91
92static int radeon_apply_workarounds(struct radeonfb_info *rinfo)
93{
94 struct radeon_device_id *id;
95
96 for (id = radeon_workaround_list; id->ident != NULL; id++ )
97 if ((id->subsystem_vendor == rinfo->pdev->subsystem_vendor ) &&
98 (id->subsystem_device == rinfo->pdev->subsystem_device )) {
99
100 /* we found a device that requires workaround */
101 printk(KERN_DEBUG "radeonfb: %s detected"
102 ", enabling workaround\n", id->ident);
103
104 rinfo->pm_mode |= id->pm_mode_modifier;
105
106 if (id->new_reinit_func != NULL)
107 rinfo->reinit_func = id->new_reinit_func;
108
109 return 1;
110 }
111 return 0; /* not found */
112}
113
114#else /* defined(CONFIG_PM) && defined(CONFIG_X86) */
115static inline int radeon_apply_workarounds(struct radeonfb_info *rinfo)
116{
117 return 0;
118}
119#endif /* defined(CONFIG_PM) && defined(CONFIG_X86) */
120
121
122
30static void radeon_pm_disable_dynamic_mode(struct radeonfb_info *rinfo) 123static void radeon_pm_disable_dynamic_mode(struct radeonfb_info *rinfo)
31{ 124{
32 u32 tmp; 125 u32 tmp;
@@ -852,18 +945,26 @@ static void radeon_pm_setup_for_suspend(struct radeonfb_info *rinfo)
852 /* because both INPLL and OUTPLL take the same lock, that's why. */ 945 /* because both INPLL and OUTPLL take the same lock, that's why. */
853 tmp = INPLL( pllMCLK_MISC) | MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND; 946 tmp = INPLL( pllMCLK_MISC) | MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND;
854 OUTPLL( pllMCLK_MISC, tmp); 947 OUTPLL( pllMCLK_MISC, tmp);
855
856 /* AGP PLL control */
857 if (rinfo->family <= CHIP_FAMILY_RV280) {
858 OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) | BUS_CNTL1__AGPCLK_VALID);
859 948
860 OUTREG(BUS_CNTL1, 949 /* BUS_CNTL1__MOBILE_PLATORM_SEL setting is northbridge chipset
861 (INREG(BUS_CNTL1) & ~BUS_CNTL1__MOBILE_PLATFORM_SEL_MASK) 950 * and radeon chip dependent. Thus we only enable it on Mac for
862 | (2<<BUS_CNTL1__MOBILE_PLATFORM_SEL__SHIFT)); // 440BX 951 * now (until we get more info on how to compute the correct
863 } else { 952 * value for various X86 bridges).
864 OUTREG(BUS_CNTL1, INREG(BUS_CNTL1)); 953 */
865 OUTREG(BUS_CNTL1, (INREG(BUS_CNTL1) & ~0x4000) | 0x8000); 954#ifdef CONFIG_PPC_PMAC
955 if (machine_is(powermac)) {
956 /* AGP PLL control */
957 if (rinfo->family <= CHIP_FAMILY_RV280) {
958 OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) | BUS_CNTL1__AGPCLK_VALID);
959 OUTREG(BUS_CNTL1,
960 (INREG(BUS_CNTL1) & ~BUS_CNTL1__MOBILE_PLATFORM_SEL_MASK)
961 | (2<<BUS_CNTL1__MOBILE_PLATFORM_SEL__SHIFT)); // 440BX
962 } else {
963 OUTREG(BUS_CNTL1, INREG(BUS_CNTL1));
964 OUTREG(BUS_CNTL1, (INREG(BUS_CNTL1) & ~0x4000) | 0x8000);
965 }
866 } 966 }
967#endif
867 968
868 OUTREG(CRTC_OFFSET_CNTL, (INREG(CRTC_OFFSET_CNTL) 969 OUTREG(CRTC_OFFSET_CNTL, (INREG(CRTC_OFFSET_CNTL)
869 & ~CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_OUT_EN)); 970 & ~CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_OUT_EN));
@@ -2713,7 +2814,7 @@ static void radeonfb_early_resume(void *data)
2713 2814
2714#endif /* CONFIG_PM */ 2815#endif /* CONFIG_PM */
2715 2816
2716void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk) 2817void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
2717{ 2818{
2718 /* Find PM registers in config space if any*/ 2819 /* Find PM registers in config space if any*/
2719 rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM); 2820 rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM);
@@ -2729,22 +2830,13 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk)
2729 } 2830 }
2730 2831
2731#if defined(CONFIG_PM) 2832#if defined(CONFIG_PM)
2833#if defined(CONFIG_PPC_PMAC)
2732 /* Check if we can power manage on suspend/resume. We can do 2834 /* Check if we can power manage on suspend/resume. We can do
2733 * D2 on M6, M7 and M9, and we can resume from D3 cold a few other 2835 * D2 on M6, M7 and M9, and we can resume from D3 cold a few other
2734 * "Mac" cards, but that's all. We need more infos about what the 2836 * "Mac" cards, but that's all. We need more infos about what the
2735 * BIOS does tho. Right now, all this PM stuff is pmac-only for that 2837 * BIOS does tho. Right now, all this PM stuff is pmac-only for that
2736 * reason. --BenH 2838 * reason. --BenH
2737 */ 2839 */
2738 /* Special case for Samsung P35 laptops
2739 */
2740 if ((rinfo->pdev->vendor == PCI_VENDOR_ID_ATI) &&
2741 (rinfo->pdev->device == PCI_CHIP_RV350_NP) &&
2742 (rinfo->pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG) &&
2743 (rinfo->pdev->subsystem_device == 0xc00c)) {
2744 rinfo->reinit_func = radeon_reinitialize_M10;
2745 rinfo->pm_mode |= radeon_pm_off;
2746 }
2747#if defined(CONFIG_PPC_PMAC)
2748 if (machine_is(powermac) && rinfo->of_node) { 2840 if (machine_is(powermac) && rinfo->of_node) {
2749 if (rinfo->is_mobility && rinfo->pm_reg && 2841 if (rinfo->is_mobility && rinfo->pm_reg &&
2750 rinfo->family <= CHIP_FAMILY_RV250) 2842 rinfo->family <= CHIP_FAMILY_RV250)
@@ -2790,6 +2882,18 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk)
2790 } 2882 }
2791#endif /* defined(CONFIG_PPC_PMAC) */ 2883#endif /* defined(CONFIG_PPC_PMAC) */
2792#endif /* defined(CONFIG_PM) */ 2884#endif /* defined(CONFIG_PM) */
2885
2886 if (ignore_devlist)
2887 printk(KERN_DEBUG
2888 "radeonfb: skipping test for device workarounds\n");
2889 else
2890 radeon_apply_workarounds(rinfo);
2891
2892 if (force_sleep) {
2893 printk(KERN_DEBUG
2894 "radeonfb: forcefully enabling D2 sleep mode\n");
2895 rinfo->pm_mode |= radeon_pm_d2;
2896 }
2793} 2897}
2794 2898
2795void radeonfb_pm_exit(struct radeonfb_info *rinfo) 2899void radeonfb_pm_exit(struct radeonfb_info *rinfo)
diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h
index 38657b2d10eb..d5ff224a6258 100644
--- a/drivers/video/aty/radeonfb.h
+++ b/drivers/video/aty/radeonfb.h
@@ -273,6 +273,8 @@ enum radeon_pm_mode {
273 radeon_pm_off = 0x00000002, /* Can resume from D3 cold */ 273 radeon_pm_off = 0x00000002, /* Can resume from D3 cold */
274}; 274};
275 275
276typedef void (*reinit_function_ptr)(struct radeonfb_info *rinfo);
277
276struct radeonfb_info { 278struct radeonfb_info {
277 struct fb_info *info; 279 struct fb_info *info;
278 280
@@ -338,7 +340,7 @@ struct radeonfb_info {
338 int dynclk; 340 int dynclk;
339 int no_schedule; 341 int no_schedule;
340 enum radeon_pm_mode pm_mode; 342 enum radeon_pm_mode pm_mode;
341 void (*reinit_func)(struct radeonfb_info *rinfo); 343 reinit_function_ptr reinit_func;
342 344
343 /* Lock on register access */ 345 /* Lock on register access */
344 spinlock_t reg_lock; 346 spinlock_t reg_lock;
@@ -600,7 +602,7 @@ extern int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, u8
600/* PM Functions */ 602/* PM Functions */
601extern int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t state); 603extern int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t state);
602extern int radeonfb_pci_resume(struct pci_dev *pdev); 604extern int radeonfb_pci_resume(struct pci_dev *pdev);
603extern void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk); 605extern void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep);
604extern void radeonfb_pm_exit(struct radeonfb_info *rinfo); 606extern void radeonfb_pm_exit(struct radeonfb_info *rinfo);
605 607
606/* Monitor probe functions */ 608/* Monitor probe functions */