2 * Senao / EnGenius ESR-9753 board support
4 * Copyright (C) 2011 Artur Wronowski <arteqw@gmail.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/init.h>
12 #include <linux/platform_device.h>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/partitions.h>
15 #include <linux/mtd/physmap.h>
17 #include <asm/mach-ralink/machine.h>
18 #include <asm/mach-ralink/dev-gpio-buttons.h>
19 #include <asm/mach-ralink/dev-gpio-leds.h>
20 #include <asm/mach-ralink/rt305x.h>
21 #include <asm/mach-ralink/rt305x_regs.h>
25 #define ESR_9753_GPIO_LED_POWER 8
26 #define ESR_9753_GPIO_LED_WPS 14
28 #define ESR_9753_GPIO_BUTTON_WPS 0 /* active low */
29 #define ESR_9753_GPIO_BUTTON_RESET 10 /* active low */
31 #define ESR_9753_KEYS_POLL_INTERVAL 20
32 #define ESR_9753_KEYS_DEBOUNCE_INTERVAL (3 * ESR_9753_KEYS_POLL_INTERVAL)
34 static struct mtd_partition esr_9753_partitions
[] = {
39 .mask_flags
= MTD_WRITEABLE
,
44 .mask_flags
= MTD_WRITEABLE
,
49 .mask_flags
= MTD_WRITEABLE
,
65 static struct gpio_led esr_9753_leds_gpio
[] __initdata
= {
67 .name
= "esr-9753:orange:power",
68 .gpio
= ESR_9753_GPIO_LED_POWER
,
71 .name
= "esr-9753:orange:wps",
72 .gpio
= ESR_9753_GPIO_LED_WPS
,
77 static struct gpio_keys_button esr_9753_gpio_buttons
[] __initdata
= {
82 .debounce_interval
= ESR_9753_KEYS_DEBOUNCE_INTERVAL
,
83 .gpio
= ESR_9753_GPIO_BUTTON_RESET
,
88 .code
= KEY_WPS_BUTTON
,
89 .debounce_interval
= ESR_9753_KEYS_DEBOUNCE_INTERVAL
,
90 .gpio
= ESR_9753_GPIO_BUTTON_WPS
,
95 static void __init
esr_9753_init(void)
97 rt305x_gpio_init(RT305X_GPIO_MODE_GPIO
<< RT305X_GPIO_MODE_UART0_SHIFT
);
99 rt305x_flash0_data
.nr_parts
= ARRAY_SIZE(esr_9753_partitions
);
100 rt305x_flash0_data
.parts
= esr_9753_partitions
;
101 rt305x_register_flash(0);
103 ramips_register_gpio_leds(-1, ARRAY_SIZE(esr_9753_leds_gpio
),
106 ramips_register_gpio_buttons(-1, ESR_9753_KEYS_POLL_INTERVAL
,
107 ARRAY_SIZE(esr_9753_gpio_buttons
),
108 esr_9753_gpio_buttons
);
110 rt305x_esw_data
.vlan_config
= RT305X_ESW_VLAN_CONFIG_WLLLL
;
111 rt305x_register_ethernet();
112 rt305x_register_wifi();
113 rt305x_register_wdt();
116 MIPS_MACHINE(RAMIPS_MACH_ESR_9753
, "ESR-9753", "Senao / EnGenius ESR-9753",