2 * Renesas Technology Europe RSK+ 7203 Support.
4 * Copyright (C) 2008 - 2010 Paul Mundt
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
10 #include <linux/init.h>
11 #include <linux/types.h>
12 #include <linux/platform_device.h>
13 #include <linux/interrupt.h>
14 #include <linux/smsc911x.h>
15 #include <linux/input.h>
16 #include <linux/gpio.h>
17 #include <linux/gpio_keys.h>
18 #include <linux/leds.h>
19 #include <asm/machvec.h>
21 #include <cpu/sh7203.h>
23 static struct smsc911x_platform_config smsc911x_config
= {
24 .phy_interface
= PHY_INTERFACE_MODE_MII
,
25 .irq_polarity
= SMSC911X_IRQ_POLARITY_ACTIVE_LOW
,
26 .irq_type
= SMSC911X_IRQ_TYPE_OPEN_DRAIN
,
27 .flags
= SMSC911X_USE_32BIT
| SMSC911X_SWAP_FIFO
,
30 static struct resource smsc911x_resources
[] = {
34 .flags
= IORESOURCE_MEM
,
39 .flags
= IORESOURCE_IRQ
,
43 static struct platform_device smsc911x_device
= {
46 .num_resources
= ARRAY_SIZE(smsc911x_resources
),
47 .resource
= smsc911x_resources
,
49 .platform_data
= &smsc911x_config
,
53 static struct gpio_led rsk7203_gpio_leds
[] = {
60 .default_trigger
= "nand-disk",
65 .default_trigger
= "timer",
69 .name
= "red:heartbeat",
70 .default_trigger
= "heartbeat",
76 static struct gpio_led_platform_data rsk7203_gpio_leds_info
= {
77 .leds
= rsk7203_gpio_leds
,
78 .num_leds
= ARRAY_SIZE(rsk7203_gpio_leds
),
81 static struct platform_device led_device
= {
85 .platform_data
= &rsk7203_gpio_leds_info
,
89 static struct gpio_keys_button rsk7203_gpio_keys_table
[] = {
108 static struct gpio_keys_platform_data rsk7203_gpio_keys_info
= {
109 .buttons
= rsk7203_gpio_keys_table
,
110 .nbuttons
= ARRAY_SIZE(rsk7203_gpio_keys_table
),
111 .poll_interval
= 50, /* default to 50ms */
114 static struct platform_device keys_device
= {
115 .name
= "gpio-keys-polled",
117 .platform_data
= &rsk7203_gpio_keys_info
,
121 static struct platform_device
*rsk7203_devices
[] __initdata
= {
127 static int __init
rsk7203_devices_setup(void)
129 /* Select pins for SCIF0 */
130 gpio_request(GPIO_FN_TXD0
, NULL
);
131 gpio_request(GPIO_FN_RXD0
, NULL
);
133 /* Setup LAN9118: CS1 in 16-bit Big Endian Mode, IRQ0 at Port B */
134 __raw_writel(0x36db0400, 0xfffc0008); /* CS1BCR */
135 gpio_request(GPIO_FN_IRQ0_PB
, NULL
);
137 return platform_add_devices(rsk7203_devices
,
138 ARRAY_SIZE(rsk7203_devices
));
140 device_initcall(rsk7203_devices_setup
);