2 * $Id: platform.c 8331 2007-08-03 15:59:23Z florian $
4 * Generic RDC321x platform devices
6 * Copyright (C) 2007 OpenWrt.org
7 * Copyright (C) 2007 Florian Fainelli <florian@openwrt.org>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
26 #include <linux/init.h>
27 #include <linux/kernel.h>
28 #include <linux/list.h>
29 #include <linux/device.h>
30 #include <linux/platform_device.h>
31 #include <linux/version.h>
32 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
33 #include <linux/leds.h>
38 #define PFX "rdc321x: "
41 static struct resource rdc_flash_resource[] = {
43 .start = (u32)-CONFIG_MTD_RDC3210_SIZE,
45 .flags = IORESOURCE_MEM,
49 static struct platform_device rdc_flash_device = {
50 .name = "rdc321x-flash",
52 .num_resources = ARRAY_SIZE(rdc_flash_resource),
53 .resource = rdc_flash_resource,
57 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
58 static struct gpio_led default_leds[] = {
59 { .name = "rdc:dmz", .gpio = 1, .active_low = 1, },
62 static struct gpio_led_platform_data rdc321x_led_data = {
63 .num_leds = ARRAY_SIZE(default_leds),
67 static struct platform_device rdc321x_leds = {
71 .platform_data = &rdc321x_led_data,
75 static struct platform_device rdc321x_leds = {
83 static struct platform_device rdc321x_wdt = {
84 .name = "rdc321x-wdt",
89 static struct platform_device *rdc321x_devs[] = {
95 static int __init rdc_board_setup(void)
97 return platform_add_devices(rdc321x_devs, ARRAY_SIZE(rdc321x_devs));
100 arch_initcall(rdc_board_setup);