2 * ADM5120 specific platform definitions
4 * Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
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.
12 #ifndef _ASM_MIPS_MACH_ADM5120_PLATFORM_H
13 #define _ASM_MIPS_MACH_ADM5120_PLATFORM_H
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/input.h>
24 #include <linux/gpio_keys.h>
25 #include <linux/amba/bus.h>
26 #include <linux/amba/serial.h>
28 struct adm5120_flash_platform_data {
29 void (*set_vpp)(struct map_info *, int);
30 void (*switch_bank)(unsigned);
32 unsigned int nr_parts;
33 struct mtd_partition *parts;
36 struct adm5120_switch_platform_data {
37 /* TODO: not yet implemented */
40 struct adm5120_pci_irq {
47 #define PCIIRQ(s, f, p, i) {.slot = (s), .func = (f), .pin = (p), .irq = (i)}
50 extern void adm5120_pci_set_irq_map(unsigned int nr_irqs,
51 struct adm5120_pci_irq *map) __init;
53 static inline void adm5120_pci_set_irq_map(unsigned int nr_irqs,
54 struct adm5120_pci_irq *map)
59 extern void adm5120_setup_eth_macs(u8 *mac_base) __init;
61 extern struct adm5120_flash_platform_data adm5120_flash0_data;
62 extern struct adm5120_flash_platform_data adm5120_flash1_data;
64 extern void adm5120_add_device_flash(unsigned id) __init;
65 extern void adm5120_add_device_usb(void) __init;
66 extern void adm5120_add_device_uart(unsigned id) __init;
67 extern void adm5120_add_device_nand(struct platform_nand_data *pdata) __init;
68 extern void adm5120_add_device_switch(unsigned num_ports, u8 *vlan_map) __init;
69 extern void adm5120_register_gpio_buttons(int id,
70 unsigned poll_interval,
72 struct gpio_keys_button *buttons);
74 #define GPIO_LED_DEF(g, n, t, a) { \
76 .default_trigger = (t), \
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)
84 extern void adm5120_add_device_gpio_leds(unsigned num_leds,
85 struct gpio_led *leds) __init;
87 #endif /* _ASM_MIPS_MACH_ADM5120_PLATFORM_H */