include $(INCLUDE_DIR)/target.mk
-DEFAULT_PACKAGES += kmod-switch kmod-input-gpio-buttons \
+DEFAULT_PACKAGES += kmod-switch kmod-input-gpio-keys-polled \
kmod-button-hotplug
define Target/Description
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
#include <linux/ssb/ssb.h>
-+#include <linux/gpio_buttons.h>
++#include <linux/gpio_keys.h>
+#include <linux/input.h>
#include <asm/addrspace.h>
#include <bcm63xx_board.h>
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
};
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
};
.dev.platform_data = &bcm63xx_led_data,
};
-+static struct gpio_buttons_platform_data bcm63xx_gpio_buttons_data = {
++static struct gpio_keys_platform_data bcm63xx_gpio_keys_data = {
+ .poll_interval = 20,
+};
+
-+static struct platform_device bcm63xx_gpio_buttons_device = {
-+ .name = "gpio-buttons",
++static struct platform_device bcm63xx_gpio_keys_device = {
++ .name = "gpio-keys-polled",
+ .id = 0,
-+ .dev.platform_data = &bcm63xx_gpio_buttons_data,
++ .dev.platform_data = &bcm63xx_gpio_keys_data,
+};
+
/*
+ button_count++;
+
+ if (button_count) {
-+ bcm63xx_gpio_buttons_data.nbuttons = button_count;
-+ bcm63xx_gpio_buttons_data.buttons = board.buttons;
++ bcm63xx_gpio_keys_data.nbuttons = button_count;
++ bcm63xx_gpio_keys_data.buttons = board.buttons;
+
-+ platform_device_register(&bcm63xx_gpio_buttons_device);
++ platform_device_register(&bcm63xx_gpio_keys_device);
+ }
+
return 0;
#include <linux/types.h>
#include <linux/gpio.h>
-+#include <linux/gpio_buttons.h>
++#include <linux/gpio_keys.h>
#include <linux/leds.h>
#include <bcm63xx_dev_enet.h>
#include <bcm63xx_dev_dsp.h>
struct gpio_led leds[5];
+
+ /* Buttons */
-+ struct gpio_button buttons[4];
++ struct gpio_keys_button buttons[4];
};
#endif /* ! BOARD_BCM963XX_H_ */
@@ -61,6 +61,10 @@ struct board_info {
/* Buttons */
- struct gpio_button buttons[4];
+ struct gpio_keys_button buttons[4];
+
+ /* Additional platform devices */
+ struct platform_device **devs;
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+};
+ .gpio = 34,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ {
+ .desc = "wps",
+ .gpio = 37,
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+ .devs = nb4_devices,
+ .gpio = 34,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ {
+ .desc = "wps",
+ .gpio = 37,
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+ .devs = nb4_devices,
+ .gpio = 34,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ {
+ .desc = "wps",
+ .gpio = 37,
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+ .devs = nb4_devices,
+ .gpio = 34,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ {
+ .desc = "wps",
+ .gpio = 37,
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+ .devs = nb4_devices,
+ .gpio = 34,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ {
+ .desc = "wps",
+ .gpio = 37,
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+ .devs = nb4_devices,
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ {
+ .desc = "wps",
+ .gpio = 37,
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+};
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+};
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+};
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+};
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+};
+ .gpio = 11,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ {
+ .desc = "ses",
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ }
+};
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+};
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+};
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+};
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ {
+ .desc = "wifi",
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = BTN_0,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ {
+ .desc = "wps",
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
+};
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ {
+ .desc = "wps",
+ .gpio = 34,
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
};
+ .active_low = 1,
+ .type = EV_KEY,
+ .code = KEY_RESTART,
-+ .threshold = 3,
++ .debounce_interval = 60,
+ },
+ },
};