diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-03-28 07:15:54 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-28 07:15:54 -0500 |
commit | e8222502ee6157e2713da9e0792c21f4ad458d50 (patch) | |
tree | 0f970fb99912c257a7e5254f863a53f79d22ab14 /drivers/video/aty | |
parent | 056cb48a2fb6fb31debf665695a9f97b45cfb8ec (diff) |
[PATCH] powerpc: Kill _machine and hard-coded platform numbers
This removes statically assigned platform numbers and reworks the
powerpc platform probe code to use a better mechanism. With this,
board support files can simply declare a new machine type with a
macro, and implement a probe() function that uses the flattened
device-tree to detect if they apply for a given machine.
We now have a machine_is() macro that replaces the comparisons of
_machine with the various PLATFORM_* constants. This commit also
changes various drivers to use the new macro instead of looking at
_machine.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/video/aty')
-rw-r--r-- | drivers/video/aty/aty128fb.c | 7 | ||||
-rw-r--r-- | drivers/video/aty/atyfb_base.c | 7 | ||||
-rw-r--r-- | drivers/video/aty/radeon_pm.c | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index 620c9a934e0e..f07be22e119d 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c | |||
@@ -67,6 +67,7 @@ | |||
67 | #include <asm/io.h> | 67 | #include <asm/io.h> |
68 | 68 | ||
69 | #ifdef CONFIG_PPC_PMAC | 69 | #ifdef CONFIG_PPC_PMAC |
70 | #include <asm/machdep.h> | ||
70 | #include <asm/pmac_feature.h> | 71 | #include <asm/pmac_feature.h> |
71 | #include <asm/prom.h> | 72 | #include <asm/prom.h> |
72 | #include <asm/pci-bridge.h> | 73 | #include <asm/pci-bridge.h> |
@@ -1748,7 +1749,7 @@ static int __init aty128_init(struct pci_dev *pdev, const struct pci_device_id * | |||
1748 | 1749 | ||
1749 | var = default_var; | 1750 | var = default_var; |
1750 | #ifdef CONFIG_PPC_PMAC | 1751 | #ifdef CONFIG_PPC_PMAC |
1751 | if (_machine == _MACH_Pmac) { | 1752 | if (machine_is(powermac)) { |
1752 | /* Indicate sleep capability */ | 1753 | /* Indicate sleep capability */ |
1753 | if (par->chip_gen == rage_M3) { | 1754 | if (par->chip_gen == rage_M3) { |
1754 | pmac_call_feature(PMAC_FTR_DEVICE_CAN_WAKE, NULL, 0, 1); | 1755 | pmac_call_feature(PMAC_FTR_DEVICE_CAN_WAKE, NULL, 0, 1); |
@@ -2011,7 +2012,7 @@ static int aty128fb_blank(int blank, struct fb_info *fb) | |||
2011 | return 0; | 2012 | return 0; |
2012 | 2013 | ||
2013 | #ifdef CONFIG_PMAC_BACKLIGHT | 2014 | #ifdef CONFIG_PMAC_BACKLIGHT |
2014 | if ((_machine == _MACH_Pmac) && blank) | 2015 | if (machine_is(powermac) && blank) |
2015 | set_backlight_enable(0); | 2016 | set_backlight_enable(0); |
2016 | #endif /* CONFIG_PMAC_BACKLIGHT */ | 2017 | #endif /* CONFIG_PMAC_BACKLIGHT */ |
2017 | 2018 | ||
@@ -2029,7 +2030,7 @@ static int aty128fb_blank(int blank, struct fb_info *fb) | |||
2029 | aty128_set_lcd_enable(par, par->lcd_on && !blank); | 2030 | aty128_set_lcd_enable(par, par->lcd_on && !blank); |
2030 | } | 2031 | } |
2031 | #ifdef CONFIG_PMAC_BACKLIGHT | 2032 | #ifdef CONFIG_PMAC_BACKLIGHT |
2032 | if ((_machine == _MACH_Pmac) && !blank) | 2033 | if (machine_is(powermac) && !blank) |
2033 | set_backlight_enable(1); | 2034 | set_backlight_enable(1); |
2034 | #endif /* CONFIG_PMAC_BACKLIGHT */ | 2035 | #endif /* CONFIG_PMAC_BACKLIGHT */ |
2035 | return 0; | 2036 | return 0; |
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 485be386a8ff..1b1f24e2bfbe 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -75,6 +75,7 @@ | |||
75 | #include "ati_ids.h" | 75 | #include "ati_ids.h" |
76 | 76 | ||
77 | #ifdef __powerpc__ | 77 | #ifdef __powerpc__ |
78 | #include <asm/machdep.h> | ||
78 | #include <asm/prom.h> | 79 | #include <asm/prom.h> |
79 | #include "../macmodes.h" | 80 | #include "../macmodes.h" |
80 | #endif | 81 | #endif |
@@ -2516,7 +2517,7 @@ static int __init aty_init(struct fb_info *info, const char *name) | |||
2516 | 2517 | ||
2517 | memset(&var, 0, sizeof(var)); | 2518 | memset(&var, 0, sizeof(var)); |
2518 | #ifdef CONFIG_PPC | 2519 | #ifdef CONFIG_PPC |
2519 | if (_machine == _MACH_Pmac) { | 2520 | if (machine_is(powermac)) { |
2520 | /* | 2521 | /* |
2521 | * FIXME: The NVRAM stuff should be put in a Mac-specific file, as it | 2522 | * FIXME: The NVRAM stuff should be put in a Mac-specific file, as it |
2522 | * applies to all Mac video cards | 2523 | * applies to all Mac video cards |
@@ -2671,7 +2672,7 @@ static int atyfb_blank(int blank, struct fb_info *info) | |||
2671 | return 0; | 2672 | return 0; |
2672 | 2673 | ||
2673 | #ifdef CONFIG_PMAC_BACKLIGHT | 2674 | #ifdef CONFIG_PMAC_BACKLIGHT |
2674 | if ((_machine == _MACH_Pmac) && blank > FB_BLANK_NORMAL) | 2675 | if (machine_is(powermac) && blank > FB_BLANK_NORMAL) |
2675 | set_backlight_enable(0); | 2676 | set_backlight_enable(0); |
2676 | #elif defined(CONFIG_FB_ATY_GENERIC_LCD) | 2677 | #elif defined(CONFIG_FB_ATY_GENERIC_LCD) |
2677 | if (par->lcd_table && blank > FB_BLANK_NORMAL && | 2678 | if (par->lcd_table && blank > FB_BLANK_NORMAL && |
@@ -2703,7 +2704,7 @@ static int atyfb_blank(int blank, struct fb_info *info) | |||
2703 | aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par); | 2704 | aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par); |
2704 | 2705 | ||
2705 | #ifdef CONFIG_PMAC_BACKLIGHT | 2706 | #ifdef CONFIG_PMAC_BACKLIGHT |
2706 | if ((_machine == _MACH_Pmac) && blank <= FB_BLANK_NORMAL) | 2707 | if (machine_is(powermac) && blank <= FB_BLANK_NORMAL) |
2707 | set_backlight_enable(1); | 2708 | set_backlight_enable(1); |
2708 | #elif defined(CONFIG_FB_ATY_GENERIC_LCD) | 2709 | #elif defined(CONFIG_FB_ATY_GENERIC_LCD) |
2709 | if (par->lcd_table && blank <= FB_BLANK_NORMAL && | 2710 | if (par->lcd_table && blank <= FB_BLANK_NORMAL && |
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index 5886a2f1323e..c7091761cef4 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/agp_backend.h> | 20 | #include <linux/agp_backend.h> |
21 | 21 | ||
22 | #ifdef CONFIG_PPC_PMAC | 22 | #ifdef CONFIG_PPC_PMAC |
23 | #include <asm/processor.h> | 23 | #include <asm/machdep.h> |
24 | #include <asm/prom.h> | 24 | #include <asm/prom.h> |
25 | #include <asm/pmac_feature.h> | 25 | #include <asm/pmac_feature.h> |
26 | #endif | 26 | #endif |
@@ -2745,7 +2745,7 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk) | |||
2745 | rinfo->pm_mode |= radeon_pm_off; | 2745 | rinfo->pm_mode |= radeon_pm_off; |
2746 | } | 2746 | } |
2747 | #if defined(CONFIG_PPC_PMAC) | 2747 | #if defined(CONFIG_PPC_PMAC) |
2748 | if (_machine == _MACH_Pmac && rinfo->of_node) { | 2748 | if (machine_is(powermac) && rinfo->of_node) { |
2749 | if (rinfo->is_mobility && rinfo->pm_reg && | 2749 | if (rinfo->is_mobility && rinfo->pm_reg && |
2750 | rinfo->family <= CHIP_FAMILY_RV250) | 2750 | rinfo->family <= CHIP_FAMILY_RV250) |
2751 | rinfo->pm_mode |= radeon_pm_d2; | 2751 | rinfo->pm_mode |= radeon_pm_d2; |