2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
6 * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
9 #include <linux/init.h>
10 #include <linux/platform_device.h>
11 #include <linux/mtd/mtd.h>
12 #include <linux/mtd/partitions.h>
13 #include <linux/mtd/physmap.h>
14 #include <linux/input.h>
15 #include <linux/phy.h>
16 #include <linux/spi/spi_gpio.h>
17 #include <linux/spi/flash.h>
19 #include <lantiq_soc.h>
22 #include "../machtypes.h"
24 #include "dev-ifxhcd.h"
25 #include "dev-gpio-leds.h"
26 #include "dev-gpio-buttons.h"
28 static struct mtd_partition fritz7320_partitions
[] = {
51 static struct physmap_flash_data fritz7320_flash_data
= {
52 .nr_parts
= ARRAY_SIZE(fritz7320_partitions
),
53 .parts
= fritz7320_partitions
,
56 static struct gpio_led
57 fritz7320_gpio_leds
[] __initdata
= {
58 { .name
= "soc:green:power", .gpio
= 44, .active_low
= 1, .default_trigger
= "default-on" },
59 { .name
= "soc:green:internet", .gpio
= 47, .active_low
= 1, .default_trigger
= "default-on" },
60 { .name
= "soc:green:dect", .gpio
= 38, .active_low
= 1, .default_trigger
= "default-on" },
61 { .name
= "soc:green:wlan", .gpio
= 37, .active_low
= 1, .default_trigger
= "default-on" },
62 { .name
= "soc:green:dual1", .gpio
= 35, .active_low
= 1, .default_trigger
= "default-on" },
63 { .name
= "soc:red:dual2", .gpio
= 45, .active_low
= 1, .default_trigger
= "default-on" },
66 static struct gpio_keys_button
67 fritz7320_gpio_keys
[] __initdata
= {
72 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
80 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
86 static struct ltq_pci_data ltq_pci_data
= {
87 .clock
= PCI_CLOCK_INT
,
88 .gpio
= PCI_GNT1
| PCI_REQ1
,
90 [14] = INT_NUM_IM0_IRL0
+ 22,
94 static struct ltq_eth_data ltq_eth_data
= {
95 .mii_mode
= PHY_INTERFACE_MODE_RMII
,
98 static int usb_pins
[2] = { 50, 51 };
100 static void __init
fritz7320_init(void)
102 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL
,
103 ARRAY_SIZE(fritz7320_gpio_keys
), fritz7320_gpio_keys
);
104 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(fritz7320_gpio_leds
), fritz7320_gpio_leds
);
105 ltq_register_pci(<q_pci_data
);
106 ltq_register_etop(<q_eth_data
);
107 ltq_register_nor(&fritz7320_flash_data
);
108 xway_register_hcd(usb_pins
);
111 MIPS_MACHINE(LANTIQ_MACH_FRITZ7320
,