add ixp4xx 2.6.25 patchset
[openwrt.git] / target / linux / ixp4xx / patches-2.6.25 / 302-avila_gpio_device.patch
1 Index: linux-2.6.24.2/arch/arm/mach-ixp4xx/avila-setup.c
2 ===================================================================
3 --- linux-2.6.24.2.orig/arch/arm/mach-ixp4xx/avila-setup.c
4 +++ linux-2.6.24.2/arch/arm/mach-ixp4xx/avila-setup.c
5 @@ -192,6 +192,24 @@ static struct platform_device avila_leds
6  };
7  #endif
8  
9 +#ifdef CONFIG_GPIO_DEVICE
10 +static struct resource avila_gpio_resources[] = {
11 +       {
12 +               .name   = "gpio",
13 +               .start  = AVILA_GPIO_MASK,
14 +               .end    = AVILA_GPIO_MASK,
15 +               .flags  = 0,
16 +       },
17 +};
18 +
19 +static struct platform_device avila_gpio = {
20 +       .name                   = "GPIODEV",
21 +       .id                     = -1,
22 +       .num_resources          = ARRAY_SIZE(avila_gpio_resources),
23 +       .resource               = avila_gpio_resources,
24 +};
25 +#endif
26 +
27  static struct platform_device *avila_devices[] __initdata = {
28         &avila_i2c_gpio,
29         &avila_flash,
30 @@ -199,6 +217,9 @@ static struct platform_device *avila_dev
31  #ifdef CONFIG_LEDS_IXP4XX
32         &avila_leds,
33  #endif
34 +#ifdef CONFIG_GPIO_DEVICE
35 +       &avila_gpio,
36 +#endif
37  };
38  
39  static struct platform_device *avila_eth_devices[] = {
40 Index: linux-2.6.24.2/include/asm-arm/arch-ixp4xx/avila.h
41 ===================================================================
42 --- linux-2.6.24.2.orig/include/asm-arm/arch-ixp4xx/avila.h
43 +++ linux-2.6.24.2/include/asm-arm/arch-ixp4xx/avila.h
44 @@ -38,3 +38,6 @@
45  
46  /* User LED */
47  #define AVILA_LED_USER_GPIO    3
48 +
49 +/* gpio mask used by platform device */
50 +#define AVILA_GPIO_MASK                (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) | (1 << 9)