9
0
Fork 0

gpio: move gpio_is_valid to include/gpio.h

No architectue implements its own gpio_is_valid() function, so move
the only existing implementation to include/gpio.h where it's available
for all users.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-11-28 07:42:42 +01:00
parent 21c31b9de2
commit 604aff3178
2 changed files with 11 additions and 11 deletions

View File

@ -1,17 +1,6 @@
#ifndef __ASM_GENERIC_GPIO_H
#define __ASM_GENERIC_GPIO_H
#define ARCH_NR_GPIOS 256
static inline int gpio_is_valid(int gpio)
{
if (gpio < 0)
return 0;
if (gpio < ARCH_NR_GPIOS)
return 1;
return 0;
}
void gpio_set_value(unsigned gpio, int value);
int gpio_get_value(unsigned gpio);
int gpio_direction_output(unsigned gpio, int value);

View File

@ -3,6 +3,17 @@
#include <asm/gpio.h>
#define ARCH_NR_GPIOS 256
static inline int gpio_is_valid(int gpio)
{
if (gpio < 0)
return 0;
if (gpio < ARCH_NR_GPIOS)
return 1;
return 0;
}
#define GPIOF_DIR_OUT (0 << 0)
#define GPIOF_DIR_IN (1 << 0)