9
0
Fork 0

gpio: Drop asm-generic/gpio.h

Since we no longer have custom gpio function prototypes we can
drop the prototypes from asm-generic/gpio.h can add them to
include/gpio.h instead. While at it add static inline dummy wrappers
for !CONFIG_GENERIC_GPIO so that code using gpios can compile without
gpio support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2015-08-06 12:57:13 +02:00
parent 85008e5542
commit 0d14bc0ec4
12 changed files with 24 additions and 72 deletions

View File

@ -1,10 +0,0 @@
#ifndef _ARCH_ARM_GPIO_H
#define _ARCH_ARM_GPIO_H
#ifndef CONFIG_GPIOLIB
#include <mach/gpio.h>
#else
#include <asm-generic/gpio.h>
#endif
#endif /* _ARCH_ARM_GPIO_H */

View File

@ -7,8 +7,6 @@
#ifndef __AT91_GPIO_H__
#define __AT91_GPIO_H__
#include <asm-generic/gpio.h>
#define MAX_NB_GPIO_PER_BANK 32
static inline unsigned pin_to_bank(unsigned pin)

View File

@ -1 +0,0 @@
#include <asm-generic/gpio.h>

View File

@ -1,21 +0,0 @@
/*
* (C) Copyright 2010 Juergen Beisert - Pengutronix
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_MACH_GPIO_H
#define __ASM_MACH_GPIO_H
#include <asm-generic/gpio.h>
#endif /* __ASM_MACH_GPIO_H */

View File

@ -20,7 +20,6 @@
#ifndef __ASM_ARCH_PXA_GPIO_H
#define __ASM_ARCH_PXA_GPIO_H
#include <asm-generic/gpio.h>
#include <mach/hardware.h>
#define GPIO_REGS_VIRT (0x40E00000)

View File

@ -1,18 +0,0 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_MACH_GPIO_H
#define __ASM_MACH_GPIO_H
#include <asm-generic/gpio.h>
#endif /* __ASM_MACH_GPIO_H */

View File

@ -1,6 +0,0 @@
#ifndef _ARCH_MIPS_GPIO_H
#define _ARCH_MIPS_GPIO_H
#include <asm-generic/gpio.h>
#endif /* _ARCH_MIPS_GPIO_H */

View File

@ -21,6 +21,7 @@
#include <net.h>
#include <types.h>
#include <i2c/i2c.h>
#include <gpio.h>
#include <partition.h>
#include <memory.h>
#include <asm/cache.h>
@ -32,7 +33,6 @@
#include <mach/immap_85xx.h>
#include <mach/gianfar.h>
#include <mach/clock.h>
#include <mach/gpio.h>
#include <mach/early_udelay.h>
#include <of.h>

View File

@ -21,6 +21,7 @@
#include <driver.h>
#include <asm/io.h>
#include <net.h>
#include <gpio.h>
#include <ns16550.h>
#include <partition.h>
#include <environment.h>

View File

@ -10,8 +10,6 @@
#ifndef _MACH_PPC_GPIO_H
#define _MACH_PPC_GPIO_H
#include <asm-generic/gpio.h>
extern void fsl_enable_gpiout(void);
#endif /* _MACH_PPC_GPIO_H */

View File

@ -1,9 +0,0 @@
#ifndef __ASM_GENERIC_GPIO_H
#define __ASM_GENERIC_GPIO_H
void gpio_set_value(unsigned gpio, int value);
int gpio_get_value(unsigned gpio);
int gpio_direction_output(unsigned gpio, int value);
int gpio_direction_input(unsigned gpio);
#endif /* __ASM_GENERIC_GPIO_H */

View File

@ -1,7 +1,28 @@
#ifndef __GPIO_H
#define __GPIO_H
#include <asm/gpio.h>
#ifdef CONFIG_GENERIC_GPIO
void gpio_set_value(unsigned gpio, int value);
int gpio_get_value(unsigned gpio);
int gpio_direction_output(unsigned gpio, int value);
int gpio_direction_input(unsigned gpio);
#else
static inline void gpio_set_value(unsigned gpio, int value)
{
}
static inline int gpio_get_value(unsigned gpio)
{
return 0;
}
static inline int gpio_direction_output(unsigned gpio, int value)
{
return -EINVAL;
}
static inline int gpio_direction_input(unsigned gpio)
{
return -EINVAL;
}
#endif
#define ARCH_NR_GPIOS 256