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_keys.h>
8 +#include <linux/input.h>
9 #include <asm/addrspace.h>
10 #include <bcm63xx_board.h>
11 #include <bcm63xx_cpu.h>
14 #define PFX "board_bcm963xx: "
16 +#define BCM963XX_KEYS_POLL_INTERVAL 20
17 +#define BCM963XX_KEYS_DEBOUNCE_INTERVAL (BCM963XX_KEYS_POLL_INTERVAL * 3)
19 static struct bcm963xx_nvram nvram;
20 static unsigned int mac_addr_used;
21 static struct board_info board;
22 @@ -295,6 +300,16 @@ static struct board_info __initdata boar
32 + .code = KEY_RESTART,
33 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
38 static struct board_info __initdata board_96348gw = {
39 @@ -353,6 +368,16 @@ static struct board_info __initdata boar
49 + .code = KEY_RESTART,
50 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
55 static struct board_info __initdata board_FAST2404 = {
56 @@ -851,12 +876,23 @@ static struct platform_device bcm63xx_gp
57 .dev.platform_data = &bcm63xx_led_data,
60 +static struct gpio_keys_platform_data bcm63xx_gpio_keys_data = {
61 + .poll_interval = BCM963XX_KEYS_POLL_INTERVAL,
64 +static struct platform_device bcm63xx_gpio_keys_device = {
65 + .name = "gpio-keys-polled",
67 + .dev.platform_data = &bcm63xx_gpio_keys_data,
71 * third stage init callback, register all board devices.
73 int __init board_register_devices(void)
76 + int button_count = 0;
79 bcm63xx_uart_register(0);
80 @@ -907,5 +943,16 @@ int __init board_register_devices(void)
82 platform_device_register(&bcm63xx_gpio_leds);
84 + /* count number of BUTTONs defined by this device */
85 + while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc)
89 + bcm63xx_gpio_keys_data.nbuttons = button_count;
90 + bcm63xx_gpio_keys_data.buttons = board.buttons;
92 + platform_device_register(&bcm63xx_gpio_keys_device);
97 --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
98 +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
101 #include <linux/types.h>
102 #include <linux/gpio.h>
103 +#include <linux/gpio_keys.h>
104 #include <linux/leds.h>
105 #include <bcm63xx_dev_enet.h>
106 #include <bcm63xx_dev_dsp.h>
107 @@ -57,6 +58,9 @@ struct board_info {
110 struct gpio_led leds[5];
113 + struct gpio_keys_button buttons[4];
116 #endif /* ! BOARD_BCM963XX_H_ */