2 * Atheros AP121 board support
4 * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
11 #include "machtypes.h"
12 #include "dev-gpio-buttons.h"
13 #include "dev-leds-gpio.h"
18 #define AP121_GPIO_LED_WLAN 0
19 #define AP121_GPIO_LED_USB 1
21 #define AP121_GPIO_BTN_JUMPSTART 11
22 #define AP121_GPIO_BTN_RESET 12
24 #define AP121_KEYS_POLL_INTERVAL 20 /* msecs */
25 #define AP121_KEYS_DEBOUNCE_INTERVAL (3 * AP121_KEYS_POLL_INTERVAL)
27 #define AP121_CAL_DATA_ADDR 0x1fff1000
29 static struct gpio_led ap121_leds_gpio
[] __initdata
= {
31 .name
= "ap121:green:usb",
32 .gpio
= AP121_GPIO_LED_USB
,
36 .name
= "ap121:green:wlan",
37 .gpio
= AP121_GPIO_LED_WLAN
,
42 static struct gpio_keys_button ap121_gpio_keys
[] __initdata
= {
44 .desc
= "jumpstart button",
46 .code
= KEY_WPS_BUTTON
,
47 .debounce_interval
= AP121_KEYS_DEBOUNCE_INTERVAL
,
48 .gpio
= AP121_GPIO_BTN_JUMPSTART
,
52 .desc
= "reset button",
55 .debounce_interval
= AP121_KEYS_DEBOUNCE_INTERVAL
,
56 .gpio
= AP121_GPIO_BTN_RESET
,
61 static struct spi_board_info ap121_spi_info
[] = {
65 .max_speed_hz
= 25000000,
66 .modalias
= "mx25l1606e",
70 static struct ath79_spi_platform_data ap121_spi_data
= {
75 static void __init
ap121_setup(void)
77 u8
*cal_data
= (u8
*) KSEG1ADDR(AP121_CAL_DATA_ADDR
);
79 ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_leds_gpio
),
81 ath79_register_gpio_keys_polled(-1, AP121_KEYS_POLL_INTERVAL
,
82 ARRAY_SIZE(ap121_gpio_keys
),
85 ath79_register_spi(&ap121_spi_data
, ap121_spi_info
,
86 ARRAY_SIZE(ap121_spi_info
));
88 ath79_register_wmac(cal_data
);
91 MIPS_MACHINE(ATH79_MACH_AP121
, "AP121", "Atheros AP121 reference board",