add generic gpio char dev for CONFIG_GENERIC_GPIO archs
[openwrt/svn-archive/archive.git] / target / linux / ixp4xx / patches-2.6.23 / 302-gpio_device.patch
1 Index: linux-2.6.23.14/arch/arm/mach-ixp4xx/avila-setup.c
2 ===================================================================
3 --- linux-2.6.23.14.orig/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-26 02:59:30.000000000 +0100
4 +++ linux-2.6.23.14/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-26 03:03:07.000000000 +0100
5 @@ -183,6 +183,23 @@
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 @@ -193,6 +210,9 @@
30 #ifdef CONFIG_LEDS_IXP4XX
31 &avila_leds,
32 #endif
33 +#ifdef CONFIG_GPIO_DEVICE
34 + &avila_gpio,
35 +#endif
36 };
37
38 static char avila_rtc_probe[] __initdata = "rtc-ds1672.probe=0,0x68 ";
39 Index: linux-2.6.23.14/include/asm-arm/arch-ixp4xx/avila.h
40 ===================================================================
41 --- linux-2.6.23.14.orig/include/asm-arm/arch-ixp4xx/avila.h 2008-01-26 03:03:27.000000000 +0100
42 +++ linux-2.6.23.14/include/asm-arm/arch-ixp4xx/avila.h 2008-01-26 03:07:02.000000000 +0100
43 @@ -38,3 +38,6 @@
44
45 /* User LED */
46 #define AVILA_LED_USER_GPIO 3
47 +
48 +/* gpio mask used by platform device */
49 +#define AVILA_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) | (1 << 9)