mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2025-01-10 00:29:26 +00:00
parent
5d5385684d
commit
e6baf82abd
@ -31,14 +31,12 @@ Index: linux-2.6.25.10/include/asm-mips/mach-bcm47xx/gpio.h
|
|||||||
|
|
||||||
static inline int gpio_request(unsigned gpio, const char *label)
|
static inline int gpio_request(unsigned gpio, const char *label)
|
||||||
{
|
{
|
||||||
@@ -52,6 +53,10 @@ static inline int gpio_direction_output(
|
@@ -52,6 +53,8 @@ static inline int gpio_direction_output(
|
||||||
return bcm47xx_gpio_direction_output(gpio, value);
|
return bcm47xx_gpio_direction_output(gpio, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
+static inline int gpio_is_valid(int gpio)
|
+#define gpio_is_valid bcm47xx_gpio_is_valid
|
||||||
+{
|
+
|
||||||
+ return bcm47xx_gpio_is_valid(gpio);
|
|
||||||
+}
|
|
||||||
|
|
||||||
/* cansleep wrappers */
|
/* cansleep wrappers */
|
||||||
#include <asm-generic/gpio.h>
|
#include <asm-generic/gpio.h>
|
||||||
|
@ -121,15 +121,19 @@ index 7e77b6f..464c5b3 100644
|
|||||||
struct seq_file;
|
struct seq_file;
|
||||||
struct module;
|
struct module;
|
||||||
|
|
||||||
@@ -99,6 +105,12 @@ extern int __gpio_cansleep(unsigned gpio);
|
@@ -99,6 +105,16 @@ extern int __gpio_cansleep(unsigned gpio);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
+static inline int gpio_is_valid(int number)
|
+static inline int __gpio_is_valid(int number)
|
||||||
+{
|
+{
|
||||||
+ /* only non-negative numbers are valid */
|
+ /* only non-negative numbers are valid */
|
||||||
+ return number >= 0;
|
+ return number >= 0;
|
||||||
+}
|
+}
|
||||||
|
+
|
||||||
|
+#ifndef gpio_is_valid
|
||||||
|
+#define gpio_is_valid __gpio_is_valid
|
||||||
|
+#endif
|
||||||
+
|
+
|
||||||
/* platforms that don't directly support access to GPIOs through I2C, SPI,
|
/* platforms that don't directly support access to GPIOs through I2C, SPI,
|
||||||
* or other blocking infrastructure can use these wrappers.
|
* or other blocking infrastructure can use these wrappers.
|
||||||
|
Loading…
Reference in New Issue
Block a user