diff options
Diffstat (limited to 'arch/arm/mach-orion5x/rd88f5182-setup.c')
-rw-r--r-- | arch/arm/mach-orion5x/rd88f5182-setup.c | 72 |
1 files changed, 22 insertions, 50 deletions
diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c index 399130fac0b6..0a56b9444f1b 100644 --- a/arch/arm/mach-orion5x/rd88f5182-setup.c +++ b/arch/arm/mach-orion5x/rd88f5182-setup.c | |||
@@ -19,8 +19,8 @@ | |||
19 | #include <linux/mv643xx_eth.h> | 19 | #include <linux/mv643xx_eth.h> |
20 | #include <linux/ata_platform.h> | 20 | #include <linux/ata_platform.h> |
21 | #include <linux/i2c.h> | 21 | #include <linux/i2c.h> |
22 | #include <linux/leds.h> | ||
22 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
23 | #include <asm/leds.h> | ||
24 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
25 | #include <asm/mach/pci.h> | 25 | #include <asm/mach/pci.h> |
26 | #include <mach/orion5x.h> | 26 | #include <mach/orion5x.h> |
@@ -53,12 +53,6 @@ | |||
53 | #define RD88F5182_PCI_SLOT0_IRQ_A_PIN 7 | 53 | #define RD88F5182_PCI_SLOT0_IRQ_A_PIN 7 |
54 | #define RD88F5182_PCI_SLOT0_IRQ_B_PIN 6 | 54 | #define RD88F5182_PCI_SLOT0_IRQ_B_PIN 6 |
55 | 55 | ||
56 | /* | ||
57 | * GPIO Debug LED | ||
58 | */ | ||
59 | |||
60 | #define RD88F5182_GPIO_DBG_LED 0 | ||
61 | |||
62 | /***************************************************************************** | 56 | /***************************************************************************** |
63 | * 16M NOR Flash on Device bus CS1 | 57 | * 16M NOR Flash on Device bus CS1 |
64 | ****************************************************************************/ | 58 | ****************************************************************************/ |
@@ -83,55 +77,32 @@ static struct platform_device rd88f5182_nor_flash = { | |||
83 | .resource = &rd88f5182_nor_flash_resource, | 77 | .resource = &rd88f5182_nor_flash_resource, |
84 | }; | 78 | }; |
85 | 79 | ||
86 | #ifdef CONFIG_LEDS | ||
87 | |||
88 | /***************************************************************************** | 80 | /***************************************************************************** |
89 | * Use GPIO debug led as CPU active indication | 81 | * Use GPIO LED as CPU active indication |
90 | ****************************************************************************/ | 82 | ****************************************************************************/ |
91 | 83 | ||
92 | static void rd88f5182_dbgled_event(led_event_t evt) | 84 | #define RD88F5182_GPIO_LED 0 |
93 | { | ||
94 | int val; | ||
95 | |||
96 | if (evt == led_idle_end) | ||
97 | val = 1; | ||
98 | else if (evt == led_idle_start) | ||
99 | val = 0; | ||
100 | else | ||
101 | return; | ||
102 | |||
103 | gpio_set_value(RD88F5182_GPIO_DBG_LED, val); | ||
104 | } | ||
105 | |||
106 | static int __init rd88f5182_dbgled_init(void) | ||
107 | { | ||
108 | int pin; | ||
109 | |||
110 | if (machine_is_rd88f5182()) { | ||
111 | pin = RD88F5182_GPIO_DBG_LED; | ||
112 | 85 | ||
113 | if (gpio_request(pin, "DBGLED") == 0) { | 86 | static struct gpio_led rd88f5182_gpio_led_pins[] = { |
114 | if (gpio_direction_output(pin, 0) != 0) { | 87 | { |
115 | printk(KERN_ERR "rd88f5182_dbgled_init failed " | 88 | .name = "rd88f5182:cpu", |
116 | "to set output pin %d\n", pin); | 89 | .default_trigger = "cpu0", |
117 | gpio_free(pin); | 90 | .gpio = RD88F5182_GPIO_LED, |
118 | return 0; | 91 | }, |
119 | } | 92 | }; |
120 | } else { | ||
121 | printk(KERN_ERR "rd88f5182_dbgled_init failed " | ||
122 | "to request gpio %d\n", pin); | ||
123 | return 0; | ||
124 | } | ||
125 | |||
126 | leds_event = rd88f5182_dbgled_event; | ||
127 | } | ||
128 | |||
129 | return 0; | ||
130 | } | ||
131 | 93 | ||
132 | __initcall(rd88f5182_dbgled_init); | 94 | static struct gpio_led_platform_data rd88f5182_gpio_led_data = { |
95 | .leds = rd88f5182_gpio_led_pins, | ||
96 | .num_leds = ARRAY_SIZE(rd88f5182_gpio_led_pins), | ||
97 | }; | ||
133 | 98 | ||
134 | #endif | 99 | static struct platform_device rd88f5182_gpio_leds = { |
100 | .name = "leds-gpio", | ||
101 | .id = -1, | ||
102 | .dev = { | ||
103 | .platform_data = &rd88f5182_gpio_led_data, | ||
104 | }, | ||
105 | }; | ||
135 | 106 | ||
136 | /***************************************************************************** | 107 | /***************************************************************************** |
137 | * PCI | 108 | * PCI |
@@ -298,6 +269,7 @@ static void __init rd88f5182_init(void) | |||
298 | 269 | ||
299 | orion5x_setup_dev1_win(RD88F5182_NOR_BASE, RD88F5182_NOR_SIZE); | 270 | orion5x_setup_dev1_win(RD88F5182_NOR_BASE, RD88F5182_NOR_SIZE); |
300 | platform_device_register(&rd88f5182_nor_flash); | 271 | platform_device_register(&rd88f5182_nor_flash); |
272 | platform_device_register(&rd88f5182_gpio_leds); | ||
301 | 273 | ||
302 | i2c_register_board_info(0, &rd88f5182_i2c_rtc, 1); | 274 | i2c_register_board_info(0, &rd88f5182_i2c_rtc, 1); |
303 | } | 275 | } |