diff options
| -rw-r--r-- | arch/arm/boot/dts/kirkwood-ib62x0.dts | 16 | ||||
| -rw-r--r-- | arch/arm/mach-kirkwood/board-ib62x0.c | 31 |
2 files changed, 16 insertions, 31 deletions
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts index f7b958066437..3724687fc9c9 100644 --- a/arch/arm/boot/dts/kirkwood-ib62x0.dts +++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts | |||
| @@ -46,4 +46,20 @@ | |||
| 46 | 46 | ||
| 47 | }; | 47 | }; |
| 48 | }; | 48 | }; |
| 49 | |||
| 50 | gpio_keys { | ||
| 51 | compatible = "gpio-keys"; | ||
| 52 | #address-cells = <1>; | ||
| 53 | #size-cells = <0>; | ||
| 54 | button@1 { | ||
| 55 | label = "USB Copy"; | ||
| 56 | linux,code = <133>; | ||
| 57 | gpios = <&gpio0 29 1>; | ||
| 58 | }; | ||
| 59 | button@2 { | ||
| 60 | label = "Reset"; | ||
| 61 | linux,code = <0x198>; | ||
| 62 | gpios = <&gpio0 28 1>; | ||
| 63 | }; | ||
| 64 | }; | ||
| 49 | }; | 65 | }; |
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c index 56d198eb7abc..f30065e50cb9 100644 --- a/arch/arm/mach-kirkwood/board-ib62x0.c +++ b/arch/arm/mach-kirkwood/board-ib62x0.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/ata_platform.h> | 18 | #include <linux/ata_platform.h> |
| 19 | #include <linux/mv643xx_eth.h> | 19 | #include <linux/mv643xx_eth.h> |
| 20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
| 21 | #include <linux/gpio_keys.h> | ||
| 22 | #include <linux/input.h> | 21 | #include <linux/input.h> |
| 23 | #include <linux/leds.h> | 22 | #include <linux/leds.h> |
| 24 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
| @@ -85,35 +84,6 @@ static struct platform_device ib62x0_led_device = { | |||
| 85 | } | 84 | } |
| 86 | }; | 85 | }; |
| 87 | 86 | ||
| 88 | static struct gpio_keys_button ib62x0_button_pins[] = { | ||
| 89 | { | ||
| 90 | .code = KEY_COPY, | ||
| 91 | .gpio = 29, | ||
| 92 | .desc = "USB Copy", | ||
| 93 | .active_low = 1, | ||
| 94 | }, | ||
| 95 | { | ||
| 96 | .code = KEY_RESTART, | ||
| 97 | .gpio = 28, | ||
| 98 | .desc = "Reset", | ||
| 99 | .active_low = 1, | ||
| 100 | }, | ||
| 101 | }; | ||
| 102 | |||
| 103 | static struct gpio_keys_platform_data ib62x0_button_data = { | ||
| 104 | .buttons = ib62x0_button_pins, | ||
| 105 | .nbuttons = ARRAY_SIZE(ib62x0_button_pins), | ||
| 106 | }; | ||
| 107 | |||
| 108 | static struct platform_device ib62x0_button_device = { | ||
| 109 | .name = "gpio-keys", | ||
| 110 | .id = -1, | ||
| 111 | .num_resources = 0, | ||
| 112 | .dev = { | ||
| 113 | .platform_data = &ib62x0_button_data, | ||
| 114 | } | ||
| 115 | }; | ||
| 116 | |||
| 117 | static void ib62x0_power_off(void) | 87 | static void ib62x0_power_off(void) |
| 118 | { | 88 | { |
| 119 | gpio_set_value(IB62X0_GPIO_POWER_OFF, 1); | 89 | gpio_set_value(IB62X0_GPIO_POWER_OFF, 1); |
| @@ -129,7 +99,6 @@ void __init ib62x0_init(void) | |||
| 129 | kirkwood_ehci_init(); | 99 | kirkwood_ehci_init(); |
| 130 | kirkwood_ge00_init(&ib62x0_ge00_data); | 100 | kirkwood_ge00_init(&ib62x0_ge00_data); |
| 131 | platform_device_register(&ib62x0_led_device); | 101 | platform_device_register(&ib62x0_led_device); |
| 132 | platform_device_register(&ib62x0_button_device); | ||
| 133 | if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 && | 102 | if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 && |
| 134 | gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0) | 103 | gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0) |
| 135 | pm_power_off = ib62x0_power_off; | 104 | pm_power_off = ib62x0_power_off; |
