Root/
1 | #include <linux/kernel.h> |
2 | #include <linux/module.h> |
3 | #include <linux/platform_device.h> |
4 | #include <linux/gpio_keys.h> |
5 | #include <linux/input.h> |
6 | #include <linux/leds.h> |
7 | |
8 | #include <asm/mach-types.h> |
9 | |
10 | static struct gpio_keys_button csb701_buttons[] = { |
11 | { |
12 | .code = 0x7, |
13 | .gpio = 1, |
14 | .active_low = 1, |
15 | .desc = "SW2", |
16 | .type = EV_SW, |
17 | .wakeup = 1, |
18 | }, |
19 | }; |
20 | |
21 | static struct gpio_keys_platform_data csb701_gpio_keys_data = { |
22 | .buttons = csb701_buttons, |
23 | .nbuttons = ARRAY_SIZE(csb701_buttons), |
24 | }; |
25 | |
26 | static struct gpio_led csb701_leds[] = { |
27 | { |
28 | .name = "csb701:yellow:heartbeat", |
29 | .default_trigger = "heartbeat", |
30 | .gpio = 11, |
31 | .active_low = 1, |
32 | }, |
33 | }; |
34 | |
35 | static struct platform_device csb701_gpio_keys = { |
36 | .name = "gpio-keys", |
37 | .id = -1, |
38 | .dev.platform_data = &csb701_gpio_keys_data, |
39 | }; |
40 | |
41 | static struct gpio_led_platform_data csb701_leds_gpio_data = { |
42 | .leds = csb701_leds, |
43 | .num_leds = ARRAY_SIZE(csb701_leds), |
44 | }; |
45 | |
46 | static struct platform_device csb701_leds_gpio = { |
47 | .name = "leds-gpio", |
48 | .id = -1, |
49 | .dev.platform_data = &csb701_leds_gpio_data, |
50 | }; |
51 | |
52 | static struct platform_device *devices[] __initdata = { |
53 | &csb701_gpio_keys, |
54 | &csb701_leds_gpio, |
55 | }; |
56 | |
57 | static int __init csb701_init(void) |
58 | { |
59 | if (!machine_is_csb726()) |
60 | return -ENODEV; |
61 | |
62 | return platform_add_devices(devices, ARRAY_SIZE(devices)); |
63 | } |
64 | |
65 | module_init(csb701_init); |
66 | |
67 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9