1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
4 #include <linux/mtd/partitions.h>
5 #include <linux/mtd/physmap.h>
6 #include <linux/ssb/ssb.h>
7 +#include <linux/gpio_buttons.h>
8 +#include <linux/input.h>
9 #include <asm/addrspace.h>
10 #include <bcm63xx_board.h>
11 #include <bcm63xx_cpu.h>
12 @@ -296,6 +298,16 @@ static struct board_info __initdata boar
22 + .code = KEY_RESTART,
28 static struct board_info __initdata board_96348gw = {
29 @@ -354,6 +366,16 @@ static struct board_info __initdata boar
39 + .code = KEY_RESTART,
45 static struct board_info __initdata board_FAST2404 = {
46 @@ -832,12 +854,23 @@ static struct platform_device bcm63xx_gp
47 .dev.platform_data = &bcm63xx_led_data,
50 +static struct gpio_buttons_platform_data bcm63xx_gpio_buttons_data = {
51 + .poll_interval = 20,
54 +static struct platform_device bcm63xx_gpio_buttons_device = {
55 + .name = "gpio-buttons",
57 + .dev.platform_data = &bcm63xx_gpio_buttons_data,
61 * third stage init callback, register all board devices.
63 int __init board_register_devices(void)
66 + int button_count = 0;
69 bcm63xx_uart_register(0);
70 @@ -879,5 +912,16 @@ int __init board_register_devices(void)
72 platform_device_register(&bcm63xx_gpio_leds);
74 + /* count number of BUTTONs defined by this device */
75 + while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc)
79 + bcm63xx_gpio_buttons_data.nbuttons = button_count;
80 + bcm63xx_gpio_buttons_data.buttons = board.buttons;
82 + platform_device_register(&bcm63xx_gpio_buttons_device);
87 --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
88 +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
89 @@ -57,6 +57,9 @@ struct board_info {
92 struct gpio_led leds[5];
95 + struct gpio_button buttons[2];
98 #endif /* ! BOARD_BCM963XX_H_ */