Add generic GPIO support to MIPS boards
[openwrt/svn-archive/archive.git] / target / linux / generic-2.6 / patches / 013-mips_generic_gpio_support.patch
1 --- linux-2.6.19.2.orig/arch/mips/Kconfig 2007-05-11 22:08:15.000000000 +0200
2 +++ linux-2.6.19.2/arch/mips/Kconfig 2007-05-12 18:51:13.000000000 +0200
3 @@ -818,6 +818,10 @@
4 bool
5 default y
6
7 +config GENERIC_GPIO
8 + bool
9 + default n
10 +
11 config SCHED_NO_NO_OMIT_FRAME_POINTER
12 bool
13 default y
14 --- linux-2.6.19.2.orig/include/asm-generic/gpio.h 1970-01-01 01:00:00.000000000 +0100
15 +++ linux-2.6.19.2/include/asm-generic/gpio.h 2007-03-18 17:17:10.000000000 +0100
16 @@ -0,0 +1,25 @@
17 +#ifndef _ASM_GENERIC_GPIO_H
18 +#define _ASM_GENERIC_GPIO_H
19 +
20 +/* platforms that don't directly support access to GPIOs through I2C, SPI,
21 + * or other blocking infrastructure can use these wrappers.
22 + */
23 +
24 +static inline int gpio_cansleep(unsigned gpio)
25 +{
26 + return 0;
27 +}
28 +
29 +static inline int gpio_get_value_cansleep(unsigned gpio)
30 +{
31 + might_sleep();
32 + return gpio_get_value(gpio);
33 +}
34 +
35 +static inline void gpio_set_value_cansleep(unsigned gpio, int value)
36 +{
37 + might_sleep();
38 + gpio_set_value(gpio, value);
39 +}
40 +
41 +#endif /* _ASM_GENERIC_GPIO_H */
42 --- linux-2.6.19.2.orig/include/asm-mips/gpio.h 1970-01-01 01:00:00.000000000 +0100
43 +++ linux-2.6.19.2/include/asm-mips/gpio.h 2007-03-18 17:17:10.000000000 +0100
44 @@ -0,0 +1,6 @@
45 +#ifndef _ASM_MIPS_GPIO_H
46 +#define _ASM_MIPS_GPIO_H
47 +
48 +#include <gpio.h>
49 +
50 +#endif /* _ASM_MIPS_GPIO_H */
51 --- linux-2.6.19.2.orig/arch/mips/Kconfig 2007-05-11 22:08:15.000000000 +0200
52 +++ linux-2.6.19.2/arch/mips/Kconfig 2007-05-12 18:51:13.000000000 +0200
53 @@ -818,6 +818,10 @@
54 bool
55 default y
56
57 +config GENERIC_GPIO
58 + bool
59 + default n
60 +
61 config SCHED_NO_NO_OMIT_FRAME_POINTER
62 bool
63 default y
64 --- linux-2.6.19.2.orig/include/asm-generic/gpio.h 1970-01-01 01:00:00.000000000 +0100
65 +++ linux-2.6.19.2/include/asm-generic/gpio.h 2007-03-18 17:17:10.000000000 +0100
66 @@ -0,0 +1,25 @@
67 +#ifndef _ASM_GENERIC_GPIO_H
68 +#define _ASM_GENERIC_GPIO_H
69 +
70 +/* platforms that don't directly support access to GPIOs through I2C, SPI,
71 + * or other blocking infrastructure can use these wrappers.
72 + */
73 +
74 +static inline int gpio_cansleep(unsigned gpio)
75 +{
76 + return 0;
77 +}
78 +
79 +static inline int gpio_get_value_cansleep(unsigned gpio)
80 +{
81 + might_sleep();
82 + return gpio_get_value(gpio);
83 +}
84 +
85 +static inline void gpio_set_value_cansleep(unsigned gpio, int value)
86 +{
87 + might_sleep();
88 + gpio_set_value(gpio, value);
89 +}
90 +
91 +#endif /* _ASM_GENERIC_GPIO_H */
92 --- linux-2.6.19.2.orig/include/asm-mips/gpio.h 1970-01-01 01:00:00.000000000 +0100
93 +++ linux-2.6.19.2/include/asm-mips/gpio.h 2007-03-18 17:17:10.000000000 +0100
94 @@ -0,0 +1,6 @@
95 +#ifndef _ASM_MIPS_GPIO_H
96 +#define _ASM_MIPS_GPIO_H
97 +
98 +#include <gpio.h>
99 +
100 +#endif /* _ASM_MIPS_GPIO_H */