aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/ath79/mach-pb44.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/ath79/mach-pb44.c')
-rw-r--r--arch/mips/ath79/mach-pb44.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/mips/ath79/mach-pb44.c b/arch/mips/ath79/mach-pb44.c
index e176779af660..3dc5080185cb 100644
--- a/arch/mips/ath79/mach-pb44.c
+++ b/arch/mips/ath79/mach-pb44.c
@@ -15,15 +15,21 @@
15#include <linux/i2c/pcf857x.h> 15#include <linux/i2c/pcf857x.h>
16 16
17#include "machtypes.h" 17#include "machtypes.h"
18#include "dev-gpio-buttons.h"
18#include "dev-leds-gpio.h" 19#include "dev-leds-gpio.h"
19 20
20#define PB44_GPIO_I2C_SCL 0 21#define PB44_GPIO_I2C_SCL 0
21#define PB44_GPIO_I2C_SDA 1 22#define PB44_GPIO_I2C_SDA 1
22 23
23#define PB44_GPIO_EXP_BASE 16 24#define PB44_GPIO_EXP_BASE 16
25#define PB44_GPIO_SW_RESET (PB44_GPIO_EXP_BASE + 6)
26#define PB44_GPIO_SW_JUMP (PB44_GPIO_EXP_BASE + 8)
24#define PB44_GPIO_LED_JUMP1 (PB44_GPIO_EXP_BASE + 9) 27#define PB44_GPIO_LED_JUMP1 (PB44_GPIO_EXP_BASE + 9)
25#define PB44_GPIO_LED_JUMP2 (PB44_GPIO_EXP_BASE + 10) 28#define PB44_GPIO_LED_JUMP2 (PB44_GPIO_EXP_BASE + 10)
26 29
30#define PB44_KEYS_POLL_INTERVAL 20 /* msecs */
31#define PB44_KEYS_DEBOUNCE_INTERVAL (3 * PB44_KEYS_POLL_INTERVAL)
32
27static struct i2c_gpio_platform_data pb44_i2c_gpio_data = { 33static struct i2c_gpio_platform_data pb44_i2c_gpio_data = {
28 .sda_pin = PB44_GPIO_I2C_SDA, 34 .sda_pin = PB44_GPIO_I2C_SDA,
29 .scl_pin = PB44_GPIO_I2C_SCL, 35 .scl_pin = PB44_GPIO_I2C_SCL,
@@ -60,6 +66,24 @@ static struct gpio_led pb44_leds_gpio[] __initdata = {
60 }, 66 },
61}; 67};
62 68
69static struct gpio_keys_button pb44_gpio_keys[] __initdata = {
70 {
71 .desc = "soft_reset",
72 .type = EV_KEY,
73 .code = KEY_RESTART,
74 .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL,
75 .gpio = PB44_GPIO_SW_RESET,
76 .active_low = 1,
77 } , {
78 .desc = "jumpstart",
79 .type = EV_KEY,
80 .code = KEY_WPS_BUTTON,
81 .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL,
82 .gpio = PB44_GPIO_SW_JUMP,
83 .active_low = 1,
84 }
85};
86
63static void __init pb44_init(void) 87static void __init pb44_init(void)
64{ 88{
65 i2c_register_board_info(0, pb44_i2c_board_info, 89 i2c_register_board_info(0, pb44_i2c_board_info,
@@ -68,6 +92,9 @@ static void __init pb44_init(void)
68 92
69 ath79_register_leds_gpio(-1, ARRAY_SIZE(pb44_leds_gpio), 93 ath79_register_leds_gpio(-1, ARRAY_SIZE(pb44_leds_gpio),
70 pb44_leds_gpio); 94 pb44_leds_gpio);
95 ath79_register_gpio_keys_polled(-1, PB44_KEYS_POLL_INTERVAL,
96 ARRAY_SIZE(pb44_gpio_keys),
97 pb44_gpio_keys);
71} 98}
72 99
73MIPS_MACHINE(ATH79_MACH_PB44, "PB44", "Atheros PB44 reference board", 100MIPS_MACHINE(ATH79_MACH_PB44, "PB44", "Atheros PB44 reference board",