9d2e430cd8eba8f0167a56af56328c1fd972af9a
[openwrt.git] / target / linux / adm5120 / files-2.6.28 / arch / mips / include / asm / mach-adm5120 / adm5120_platform.h
1 /*
2 * ADM5120 specific platform definitions
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 #ifndef _ASM_MIPS_MACH_ADM5120_PLATFORM_H
13 #define _ASM_MIPS_MACH_ADM5120_PLATFORM_H
14
15 #include <linux/device.h>
16 #include <linux/platform_device.h>
17 #include <linux/input.h>
18 #include <linux/leds.h>
19 #include <linux/mtd/mtd.h>
20 #include <linux/mtd/map.h>
21 #include <linux/mtd/partitions.h>
22 #include <linux/mtd/nand.h>
23 #include <linux/gpio_buttons.h>
24 #include <linux/amba/bus.h>
25 #include <linux/amba/serial.h>
26
27 struct adm5120_flash_platform_data {
28 void (*set_vpp)(struct map_info *, int);
29 void (*switch_bank)(unsigned);
30 u32 window_size;
31 #ifdef CONFIG_MTD_PARTITIONS
32 unsigned int nr_parts;
33 struct mtd_partition *parts;
34 #endif
35 };
36
37 struct adm5120_switch_platform_data {
38 /* TODO: not yet implemented */
39 };
40
41 struct adm5120_pci_irq {
42 u8 slot;
43 u8 func;
44 u8 pin;
45 unsigned irq;
46 };
47
48 #define PCIIRQ(s,f,p,i) {.slot = (s), .func = (f), .pin = (p), .irq = (i)}
49
50 #ifdef CONFIG_PCI
51 extern void adm5120_pci_set_irq_map(unsigned int nr_irqs,
52 struct adm5120_pci_irq *map) __init;
53 #else
54 static inline void adm5120_pci_set_irq_map(unsigned int nr_irqs,
55 struct adm5120_pci_irq *map)
56 {
57 }
58 #endif
59
60 extern void adm5120_setup_eth_macs(u8 *mac_base) __init;
61
62 extern struct adm5120_flash_platform_data adm5120_flash0_data;
63 extern struct adm5120_flash_platform_data adm5120_flash1_data;
64
65 extern void adm5120_add_device_flash(unsigned id) __init;
66 extern void adm5120_add_device_usb(void) __init;
67 extern void adm5120_add_device_uart(unsigned id) __init;
68 extern void adm5120_add_device_nand(struct platform_nand_data *pdata) __init;
69 extern void adm5120_add_device_switch(unsigned num_ports, u8 *vlan_map) __init;
70 extern void adm5120_add_device_gpio(u32 disable_mask) __init;
71 extern void adm5120_add_device_gpio_buttons(unsigned nbuttons,
72 struct gpio_button *buttons) __init;
73
74 #define GPIO_LED_DEF(g, n, t, a) { \
75 .name = (n), \
76 .default_trigger = (t), \
77 .gpio = (g), \
78 .active_low = (a) \
79 }
80
81 #define GPIO_LED_STD(g, n, t) GPIO_LED_DEF((g), (n), (t), 0)
82 #define GPIO_LED_INV(g, n, t) GPIO_LED_DEF((g), (n), (t), 1)
83
84 extern void adm5120_add_device_gpio_leds(unsigned num_leds,
85 struct gpio_led *leds) __init;
86
87 #endif /* _ASM_MIPS_MACH_ADM5120_PLATFORM_H */
This page took 0.058201 seconds and 3 git commands to generate.