Root/target/linux/ixp4xx/patches-2.6.33/302-avila_gpio_device.patch

1--- a/arch/arm/mach-ixp4xx/avila-setup.c
2+++ b/arch/arm/mach-ixp4xx/avila-setup.c
3@@ -237,10 +237,28 @@ static struct platform_device avila_latc
4     .dev.platform_data = &avila_latch_leds_data,
5 };
6 
7+static struct resource avila_gpio_resources[] = {
8+ {
9+ .name = "gpio",
10+ /* FIXME: gpio mask should be model specific */
11+ .start = AVILA_GPIO_MASK,
12+ .end = AVILA_GPIO_MASK,
13+ .flags = 0,
14+ },
15+};
16+
17+static struct platform_device avila_gpio = {
18+ .name = "GPIODEV",
19+ .id = -1,
20+ .num_resources = ARRAY_SIZE(avila_gpio_resources),
21+ .resource = avila_gpio_resources,
22+};
23+
24 static struct platform_device *avila_devices[] __initdata = {
25     &avila_i2c_gpio,
26     &avila_flash,
27- &avila_uart
28+ &avila_uart,
29+ &avila_gpio,
30 };
31 
32 static void __init avila_gw23xx_setup(void)
33--- a/arch/arm/mach-ixp4xx/avila-setup.c
34+++ b/arch/arm/mach-ixp4xx/avila-setup.c
35@@ -38,6 +38,13 @@
36 #define AVILA_SDA_PIN 7
37 #define AVILA_SCL_PIN 6
38 
39+/* User LEDs */
40+#define AVILA_GW23XX_LED_USER_GPIO 3
41+#define AVILA_GW23X7_LED_USER_GPIO 4
42+
43+/* gpio mask used by platform device */
44+#define AVILA_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) | (1 << 9)
45+
46 struct avila_board_info {
47     unsigned char *model;
48     void (*setup)(void);
49

Archive Download this file



interactive