add Avila/Cambria latch LED support, thanks Chris
[openwrt.git] / target / linux / au1000 / patches / 002-sys_btn_gpio.patch
1 This patch adds support for the GPIO connected system button on the MTX-1 boards. Default configuration is updated accordingly.
2
3 Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu>
4 ---
5 Index: linux-2.6.25.4/arch/mips/au1000/mtx-1/platform.c
6 ===================================================================
7 --- linux-2.6.25.4.orig/arch/mips/au1000/mtx-1/platform.c
8 +++ linux-2.6.25.4/arch/mips/au1000/mtx-1/platform.c
9 @@ -23,9 +23,32 @@
10 #include <linux/types.h>
11 #include <linux/platform_device.h>
12 #include <linux/leds.h>
13 +#include <linux/gpio_keys.h>
14 +#include <linux/input.h>
15
16 #include <asm/gpio.h>
17
18 +static struct gpio_keys_button mtx1_gpio_button[] = {
19 + {
20 + .gpio = 207,
21 + .code = BTN_0,
22 + .desc = "System button",
23 + }
24 +};
25 +
26 +static struct gpio_keys_platform_data mtx1_buttons_data = {
27 + .buttons = mtx1_gpio_button,
28 + .nbuttons = ARRAY_SIZE(mtx1_gpio_button),
29 +};
30 +
31 +static struct platform_device mtx1_button = {
32 + .name = "gpio-keys",
33 + .id = -1,
34 + .dev = {
35 + .platform_data = &mtx1_buttons_data,
36 + }
37 +};
38 +
39 static struct resource mtx1_wdt_res[] = {
40 [0] = {
41 .start = 15,
42 @@ -62,11 +85,13 @@ static struct platform_device mtx1_gpio_
43
44 static struct platform_device *mtx1_devs[] = {
45 &mtx1_gpio_leds,
46 - &mtx1_wdt
47 + &mtx1_wdt,
48 + &mtx1_button
49 };
50
51 static int __init mtx1_register_devices(void)
52 {
53 + gpio_direction_input(207);
54 return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs));
55 }
56
This page took 0.059111 seconds and 5 git commands to generate.