2 * Atheros DB120 board (WASP SoC) support
4 * Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
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 <linux/mtd/mtd.h>
12 #include <linux/mtd/partitions.h>
14 #include <asm/mach-ar71xx/ar71xx.h>
18 #include "dev-m25p80.h"
19 #include "dev-gpio-buttons.h"
20 #include "dev-leds-gpio.h"
23 #define DB120_GPIO_LED_USB 11
24 #define DB120_GPIO_LED_WLAN_5G 12
25 #define DB120_GPIO_LED_WLAN_2G 13
26 #define DB120_GPIO_LED_STATUS 14
27 #define DB120_GPIO_LED_WPS 15
29 #define DB120_GPIO_BTN_SW1 16
31 #define DB120_BUTTONS_POLL_INTERVAL 20
33 #ifdef CONFIG_MTD_PARTITIONS
34 static struct mtd_partition db120_partitions
[] = {
39 .mask_flags
= MTD_WRITEABLE
,
60 .mask_flags
= MTD_WRITEABLE
,
63 #endif /* CONFIG_MTD_PARTITIONS */
65 static struct flash_platform_data db120_flash_data
= {
66 #ifdef CONFIG_MTD_PARTITIONS
67 .parts
= db120_partitions
,
68 .nr_parts
= ARRAY_SIZE(db120_partitions
),
72 static struct gpio_led db120_leds_gpio
[] __initdata
= {
74 .name
= "db120:green:status",
75 .gpio
= DB120_GPIO_LED_STATUS
,
78 .name
= "db120:green:wps",
79 .gpio
= DB120_GPIO_LED_WPS
,
82 .name
= "db120:green:wlan-5g",
83 .gpio
= DB120_GPIO_LED_WLAN_5G
,
86 .name
= "db120:green:wlan-2g",
87 .gpio
= DB120_GPIO_LED_WLAN_2G
,
90 .name
= "db120:green:usb",
91 .gpio
= DB120_GPIO_LED_USB
,
96 static struct gpio_button db120_gpio_buttons
[] __initdata
= {
102 .gpio
= DB120_GPIO_BTN_SW1
,
107 static void __init
db120_setup(void)
109 ar71xx_add_device_usb();
111 ar71xx_add_device_m25p80(&db120_flash_data
);
113 ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio
),
116 ar71xx_add_device_gpio_buttons(-1, DB120_BUTTONS_POLL_INTERVAL
,
117 ARRAY_SIZE(db120_gpio_buttons
),
121 MIPS_MACHINE(AR71XX_MACH_DB120
, "DB120", "Atheros DB120", db120_setup
);