[ARM] pxa: add support for CSB701 baseboard
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Mon, 16 Feb 2009 17:40:57 +0000 (20:40 +0300)
committerEric Miao <eric.miao@marvell.com>
Fri, 13 Mar 2009 09:10:44 +0000 (17:10 +0800)
CSB701 is one of baseboards that can be used with CSB726 SOM.
This currently adds support for button and LED on the board.
More to come later.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/Makefile
arch/arm/mach-pxa/csb701.c [new file with mode: 0644]

index ff1872db5b3ddc11ca02a53f91acc03707a8a894..d13282d773aa2d4146b952e55a3464e2d06b4db8 100644 (file)
@@ -401,6 +401,10 @@ config MACH_CSB726
          Say Y here if you intend to run this kernel on a Cogent
          CSB726 System On Module.
 
+config CSB726_CSB701
+       bool "Enable supprot for CSB701 baseboard"
+       depends on MACH_CSB726
+
 config PXA_EZX
        bool "Motorola EZX Platform"
        select PXA27x
index 96a72f02c136680bc6aabef4c7a6d2aadfcc4c93..8da8e63d048b30be6bfd657e7b414f98af6c0cc6 100644 (file)
@@ -76,6 +76,7 @@ obj-$(CONFIG_PXA_EZX)           += ezx.o
 
 obj-$(CONFIG_MACH_INTELMOTE2)   += imote2.o
 obj-$(CONFIG_MACH_CSB726)      += csb726.o
+obj-$(CONFIG_CSB726_CSB701)    += csb701.o
 
 # Support for blinky lights
 led-y := leds.o
diff --git a/arch/arm/mach-pxa/csb701.c b/arch/arm/mach-pxa/csb701.c
new file mode 100644 (file)
index 0000000..4a2a295
--- /dev/null
@@ -0,0 +1,61 @@
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
+#include <linux/leds.h>
+
+static struct gpio_keys_button csb701_buttons[] = {
+       {
+               .code   = 0x7,
+               .gpio   = 1,
+               .active_low = 1,
+               .desc   = "SW2",
+               .type   = EV_SW,
+               .wakeup = 1,
+       },
+};
+
+static struct gpio_keys_platform_data csb701_gpio_keys_data = {
+       .buttons = csb701_buttons,
+       .nbuttons = ARRAY_SIZE(csb701_buttons),
+};
+
+static struct gpio_led csb701_leds[] = {
+       {
+               .name   = "csb701:yellow:heartbeat",
+               .default_trigger = "heartbeat",
+               .gpio   = 11,
+               .active_low = 1,
+       },
+};
+
+static struct platform_device csb701_gpio_keys = {
+       .name           = "gpio-keys",
+       .id             = -1,
+       .dev.platform_data = &csb701_gpio_keys_data,
+};
+
+static struct gpio_led_platform_data csb701_leds_gpio_data = {
+       .leds           = csb701_leds,
+       .num_leds       = ARRAY_SIZE(csb701_leds),
+};
+
+static struct platform_device csb701_leds_gpio = {
+       .name           = "leds-gpio",
+       .id             = -1,
+       .dev.platform_data = &csb701_leds_gpio_data,
+};
+
+static struct platform_device *devices[] __initdata = {
+       &csb701_gpio_keys,
+       &csb701_leds_gpio,
+};
+
+static int __init csb701_init(void)
+{
+       return platform_add_devices(devices, ARRAY_SIZE(devices));
+}
+
+module_init(csb701_init);
+