[brcm63xx] add support for 2.6.32, dropped the SPI patch for now
[openwrt.git] / target / linux / brcm63xx / patches-2.6.32 / 100-reset_buttons.patch
1 Index: linux-2.6.32.9/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 ===================================================================
3 --- linux-2.6.32.9.orig/arch/mips/bcm63xx/boards/board_bcm963xx.c       2010-02-28 18:37:27.000000000 +0100
4 +++ linux-2.6.32.9/arch/mips/bcm63xx/boards/board_bcm963xx.c    2010-02-28 18:41:36.000000000 +0100
5 @@ -15,6 +15,8 @@
6  #include <linux/mtd/partitions.h>
7  #include <linux/mtd/physmap.h>
8  #include <linux/ssb/ssb.h>
9 +#include <linux/gpio_buttons.h>
10 +#include <linux/input.h>
11  #include <asm/addrspace.h>
12  #include <bcm63xx_board.h>
13  #include <bcm63xx_cpu.h>
14 @@ -288,6 +290,16 @@
15                         .active_low     = 1,
16                 },
17         },
18 +       .reset_buttons = {
19 +               {
20 +                       .desc           = "reset",
21 +                       .gpio           = 32,
22 +                       .active_low     = 1,
23 +                       .type           = EV_KEY,
24 +                       .code           = BTN_0,
25 +                       .threshold      = 3,
26 +               },
27 +       },
28  };
29  
30  static struct board_info __initdata board_96348gw = {
31 @@ -345,6 +357,16 @@
32                         .active_low     = 1,
33                 },
34         },
35 +       .reset_buttons = {
36 +               {
37 +                       .desc           = "reset",
38 +                       .gpio           = 36,
39 +                       .active_low     = 1,
40 +                       .type           = EV_KEY,
41 +                       .code           = BTN_0,
42 +                       .threshold      = 3,
43 +               },
44 +       },
45  };
46  
47  static struct board_info __initdata board_FAST2404 = {
48 @@ -771,6 +793,16 @@
49         .dev.platform_data      = &bcm63xx_led_data,
50  };
51  
52 +static struct gpio_buttons_platform_data bcm63xx_gpio_buttons_data = {
53 +       .poll_interval  = 20,
54 +};
55 +
56 +static struct platform_device bcm63xx_gpio_buttons_device = {
57 +       .name           = "gpio-buttons",
58 +       .id             = 0,
59 +       .dev.platform_data = &bcm63xx_gpio_buttons_data,
60 +};
61 +
62  /*
63   * third stage init callback, register all board devices.
64   */
65 @@ -826,6 +858,13 @@
66  
67         platform_device_register(&bcm63xx_gpio_leds);
68  
69 +       if (board.reset_buttons) {
70 +               bcm63xx_gpio_buttons_data.nbuttons = ARRAY_SIZE(board.reset_buttons);
71 +               bcm63xx_gpio_buttons_data.buttons = board.reset_buttons;
72 +
73 +               platform_device_register(&bcm63xx_gpio_buttons_device);
74 +       }
75 +
76         return 0;
77  }
78  
79 Index: linux-2.6.32.9/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
80 ===================================================================
81 --- linux-2.6.32.9.orig/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h     2010-02-28 18:36:33.000000000 +0100
82 +++ linux-2.6.32.9/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h  2010-02-28 18:36:58.000000000 +0100
83 @@ -55,6 +55,9 @@
84  
85         /* GPIO LEDs */
86         struct gpio_led leds[5];
87 +
88 +       /* Reset button */
89 +       struct gpio_button reset_buttons[1];
90  };
91  
92  #endif /* ! BOARD_BCM963XX_H_ */