2 * Support for Wiliboard WBD-222
4 * Copyright (C) 2009 Imre Kaloz <kaloz@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/leds.h>
15 #include <linux/input.h>
16 #include <linux/skbuff.h>
17 #include <linux/gpio_keys.h>
18 #include <linux/mtd/mtd.h>
19 #include <linux/mtd/partitions.h>
20 #include <asm/mach-types.h>
21 #include <asm/mach/arch.h>
22 #include <asm/mach/time.h>
27 static struct gpio_keys_button wbd222_keys
[] = {
37 static struct gpio_keys_platform_data wbd222_keys_data
= {
38 .buttons
= wbd222_keys
,
39 .nbuttons
= ARRAY_SIZE(wbd222_keys
),
42 static struct platform_device wbd222_keys_device
= {
46 .platform_data
= &wbd222_keys_data
,
50 static struct gpio_led wbd222_leds
[] = {
69 static struct gpio_led_platform_data wbd222_leds_data
= {
70 .num_leds
= ARRAY_SIZE(wbd222_leds
),
74 static struct platform_device wbd222_leds_device
= {
78 .platform_data
= &wbd222_leds_data
,
82 static struct mtd_partition wbd222_partitions
[] = {
87 .mask_flags
= MTD_WRITEABLE
,
100 .mask_flags
= MTD_WRITEABLE
,
105 .mask_flags
= MTD_WRITEABLE
,
110 .mask_flags
= MTD_WRITEABLE
,
113 #define wbd222_num_partitions ARRAY_SIZE(wbd222_partitions)
115 static void __init
wbd222_init(void)
118 platform_register_uart();
119 platform_register_pflash(SZ_8M
, wbd222_partitions
,
120 wbd222_num_partitions
);
121 platform_device_register(&wbd222_leds_device
);
122 platform_device_register(&wbd222_keys_device
);
123 platform_register_rtc();
126 MACHINE_START(WBD222
, "Wiliboard WBD-222")
127 .atag_offset
= 0x100,
128 .map_io
= gemini_map_io
,
129 .init_irq
= gemini_init_irq
,
130 .init_time
= gemini_timer_init
,
131 .init_machine
= wbd222_init
,
132 .restart
= gemini_restart
,