0001
0002 #include <linux/kernel.h>
0003 #include <linux/module.h>
0004 #include <linux/platform_device.h>
0005 #include <linux/gpio_keys.h>
0006 #include <linux/input.h>
0007 #include <linux/leds.h>
0008
0009 #include <asm/mach-types.h>
0010
0011 static struct gpio_keys_button csb701_buttons[] = {
0012 {
0013 .code = 0x7,
0014 .gpio = 1,
0015 .active_low = 1,
0016 .desc = "SW2",
0017 .type = EV_SW,
0018 .wakeup = 1,
0019 },
0020 };
0021
0022 static struct gpio_keys_platform_data csb701_gpio_keys_data = {
0023 .buttons = csb701_buttons,
0024 .nbuttons = ARRAY_SIZE(csb701_buttons),
0025 };
0026
0027 static struct gpio_led csb701_leds[] = {
0028 {
0029 .name = "csb701:yellow:heartbeat",
0030 .default_trigger = "heartbeat",
0031 .gpio = 11,
0032 .active_low = 1,
0033 },
0034 };
0035
0036 static struct platform_device csb701_gpio_keys = {
0037 .name = "gpio-keys",
0038 .id = -1,
0039 .dev.platform_data = &csb701_gpio_keys_data,
0040 };
0041
0042 static struct gpio_led_platform_data csb701_leds_gpio_data = {
0043 .leds = csb701_leds,
0044 .num_leds = ARRAY_SIZE(csb701_leds),
0045 };
0046
0047 static struct platform_device csb701_leds_gpio = {
0048 .name = "leds-gpio",
0049 .id = -1,
0050 .dev.platform_data = &csb701_leds_gpio_data,
0051 };
0052
0053 static struct platform_device *devices[] __initdata = {
0054 &csb701_gpio_keys,
0055 &csb701_leds_gpio,
0056 };
0057
0058 static int __init csb701_init(void)
0059 {
0060 if (!machine_is_csb726())
0061 return -ENODEV;
0062
0063 return platform_add_devices(devices, ARRAY_SIZE(devices));
0064 }
0065
0066 module_init(csb701_init);
0067