Now we have b43 working in master mode, include b43 in the profile (#3827)
[openwrt/svn-archive/archive.git] / target / linux / adm5120 / files-2.6.26 / arch / mips / adm5120 / compex / compex.c
1 /*
2 * Compex boards
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 <linux/kernel.h>
13 #include <linux/init.h>
14
15 #include <asm/bootinfo.h>
16 #include <linux/gpio.h>
17
18 #include <asm/mach-adm5120/adm5120_info.h>
19 #include <asm/mach-adm5120/adm5120_board.h>
20 #include <asm/mach-adm5120/adm5120_platform.h>
21 #include <asm/mach-adm5120/adm5120_irq.h>
22
23 #define COMPEX_GPIO_DEV_MASK (1 << ADM5120_GPIO_PIN5)
24
25 static void switch_bank_gpio5(unsigned bank)
26 {
27 switch (bank) {
28 case 0:
29 gpio_set_value(ADM5120_GPIO_PIN5, 0);
30 break;
31 case 1:
32 gpio_set_value(ADM5120_GPIO_PIN5, 1);
33 break;
34 }
35 }
36
37 void __init compex_generic_setup(void)
38 {
39 gpio_request(ADM5120_GPIO_PIN5, NULL); /* for flash A20 line */
40 gpio_direction_output(ADM5120_GPIO_PIN5, 0);
41
42 adm5120_flash0_data.switch_bank = switch_bank_gpio5;
43 adm5120_add_device_flash(0);
44
45 adm5120_add_device_gpio(COMPEX_GPIO_DEV_MASK);
46 }