1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

[ar71xx] make all AR913x GPIO lines usable

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13509 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg
2008-12-04 12:17:14 +00:00
parent 59266b3466
commit b80c50f7cf
3 changed files with 23 additions and 2 deletions

View File

@@ -206,6 +206,7 @@ extern void ar71xx_add_device_usb(void) __init;
#define GPIO_FUNC_USB_CLK_EN BIT(0)
#define AR71XX_GPIO_COUNT 16
#define AR91XX_GPIO_COUNT 22
extern void __iomem *ar71xx_gpio_base;

View File

@@ -18,6 +18,7 @@
#include <asm/mach-ar71xx/ar71xx.h>
extern unsigned long ar71xx_gpio_count;
extern void __ar71xx_gpio_set_value(unsigned gpio, int value);
extern int __ar71xx_gpio_get_value(unsigned gpio);
@@ -33,7 +34,7 @@ static inline int irq_to_gpio(unsigned irq)
static inline int gpio_get_value(unsigned gpio)
{
if (gpio < AR71XX_GPIO_COUNT)
if (gpio < ar71xx_gpio_count)
return __ar71xx_gpio_get_value(gpio);
return __gpio_get_value(gpio);
@@ -41,7 +42,7 @@ static inline int gpio_get_value(unsigned gpio)
static inline void gpio_set_value(unsigned gpio, int value)
{
if (gpio < AR71XX_GPIO_COUNT)
if (gpio < ar71xx_gpio_count)
__ar71xx_gpio_set_value(gpio, value);
else
__gpio_set_value(gpio, value);