#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#include "dev-usb.h"
-#include "dev-ar934x-wmac.h"
+#include "dev-ar9xxx-wmac.h"
+#include "dev-db120-pci.h"
#define DB120_GPIO_LED_USB 11
#define DB120_GPIO_LED_WLAN_5G 12
#define DB120_GPIO_BTN_SW1 16
#define DB120_CALDATA_OFFSET 0x1000
-#define DB120_WMAC_MAC_OFFSET 0x1003
+#define DB120_WMAC_MAC_OFFSET 0x1002
-#define DB120_BUTTONS_POLL_INTERVAL 20
+#define DB120_KEYS_POLL_INTERVAL 20 /* msecs */
+#define DB120_KEYS_DEBOUNCE_INTERVAL (3 * DB120_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition db120_partitions[] = {
}
};
-static struct gpio_button db120_gpio_buttons[] __initdata = {
+static struct gpio_keys_button db120_gpio_keys[] __initdata = {
{
.desc = "sw1",
.type = EV_KEY,
.code = BTN_0,
- .threshold = 3,
+ .debounce_interval = DB120_KEYS_DEBOUNCE_INTERVAL,
.gpio = DB120_GPIO_BTN_SW1,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio),
db120_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, DB120_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(db120_gpio_buttons),
- db120_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, DB120_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(db120_gpio_keys),
+ db120_gpio_keys);
- ar934x_add_device_wmac(art + DB120_CALDATA_OFFSET,
+ ar9xxx_add_device_wmac(art + DB120_CALDATA_OFFSET,
art + DB120_WMAC_MAC_OFFSET);
+
+ db120_pci_init();
}
MIPS_MACHINE(AR71XX_MACH_DB120, "DB120", "Atheros DB120", db120_setup);