add 2.6.26 specific files
[librecmc/librecmc.git] / target / linux / adm5120 / files-2.6.26 / arch / mips / adm5120 / edimax / br-61xx.c
1 /*
2  *  Edimax BR-61xx support
3  *
4  *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
5  *
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.
9  *
10  */
11
12 #include "br-61xx.h"
13
14 #define BR61XX_GPIO_DEV_MASK    0
15
16 #ifdef CONFIG_MTD_PARTITIONS
17 static struct mtd_partition br61xx_partitions[] = {
18         {
19                 .name   = "admboot",
20                 .offset = 0,
21                 .size   = 32*1024,
22                 .mask_flags = MTD_WRITEABLE,
23         } , {
24                 .name   = "config",
25                 .offset = MTDPART_OFS_APPEND,
26                 .size   = 32*1024,
27         } , {
28                 .name   = "firmware",
29                 .offset = MTDPART_OFS_APPEND,
30                 .size   = MTDPART_SIZ_FULL,
31         }
32 };
33 #endif /* CONFIG_MTD_PARTITIONS */
34
35 static struct gpio_button br61xx_gpio_buttons[] __initdata = {
36         {
37                 .desc           = "reset_button",
38                 .type           = EV_KEY,
39                 .code           = BTN_0,
40                 .threshold      = 5,
41                 .gpio           = ADM5120_GPIO_PIN2,
42         }
43 };
44
45 static u8 br61xx_vlans[6] __initdata = {
46         0x41, 0x42, 0x44, 0x48, 0x50, 0x00
47 };
48
49 void __init br61xx_generic_setup(void)
50 {
51
52 #ifdef CONFIG_MTD_PARTITIONS
53         adm5120_flash0_data.nr_parts = ARRAY_SIZE(br61xx_partitions);
54         adm5120_flash0_data.parts = br61xx_partitions;
55 #endif /* CONFIG_MTD_PARTITIONS */
56         adm5120_add_device_flash(0);
57
58         adm5120_add_device_gpio(BR61XX_GPIO_DEV_MASK);
59         adm5120_add_device_switch(5, br61xx_vlans);
60         adm5120_add_device_gpio_buttons(ARRAY_SIZE(br61xx_gpio_buttons),
61                                         br61xx_gpio_buttons);
62
63         /* TODO: setup mac addresses */
64 }