diff options
Diffstat (limited to 'arch/arm/mach-ixp4xx/nslu2-setup.c')
-rw-r--r-- | arch/arm/mach-ixp4xx/nslu2-setup.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c index 7e55236c26ea..ba5f1cda2a9d 100644 --- a/arch/arm/mach-ixp4xx/nslu2-setup.c +++ b/arch/arm/mach-ixp4xx/nslu2-setup.c | |||
@@ -197,11 +197,8 @@ static void nslu2_power_off(void) | |||
197 | { | 197 | { |
198 | /* This causes the box to drop the power and go dead. */ | 198 | /* This causes the box to drop the power and go dead. */ |
199 | 199 | ||
200 | /* enable the pwr cntl gpio */ | 200 | /* enable the pwr cntl gpio and assert power off */ |
201 | gpio_line_config(NSLU2_PO_GPIO, IXP4XX_GPIO_OUT); | 201 | gpio_direction_output(NSLU2_PO_GPIO, 1); |
202 | |||
203 | /* do the deed */ | ||
204 | gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH); | ||
205 | } | 202 | } |
206 | 203 | ||
207 | static irqreturn_t nslu2_power_handler(int irq, void *dev_id) | 204 | static irqreturn_t nslu2_power_handler(int irq, void *dev_id) |
@@ -223,6 +220,16 @@ static irqreturn_t nslu2_reset_handler(int irq, void *dev_id) | |||
223 | return IRQ_HANDLED; | 220 | return IRQ_HANDLED; |
224 | } | 221 | } |
225 | 222 | ||
223 | static int __init nslu2_gpio_init(void) | ||
224 | { | ||
225 | if (!machine_is_nslu2()) | ||
226 | return 0; | ||
227 | |||
228 | /* Request the power off GPIO */ | ||
229 | return gpio_request(NSLU2_PO_GPIO, "power off"); | ||
230 | } | ||
231 | device_initcall(nslu2_gpio_init); | ||
232 | |||
226 | static void __init nslu2_timer_init(void) | 233 | static void __init nslu2_timer_init(void) |
227 | { | 234 | { |
228 | /* The xtal on this machine is non-standard. */ | 235 | /* The xtal on this machine is non-standard. */ |