diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-09-01 09:43:53 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-09-01 09:43:53 +0200 |
commit | fae6eea0e6af8d9eb8ac02f1a4d6307ebc28fe5b (patch) | |
tree | 06b127d1456e93d49ef7342ae65bb47085bb9ce1 /arch/arm | |
parent | f387bc96bb23658ecdaa67bc9bff6fd290f636f8 (diff) | |
parent | ffcabbe125d31dcb4f25dbb8f29be7adcfcf408e (diff) | |
download | barebox-fae6eea0e6af8d9eb8ac02f1a4d6307ebc28fe5b.tar.gz barebox-fae6eea0e6af8d9eb8ac02f1a4d6307ebc28fe5b.tar.xz |
Merge branch 'for-next/gpio'
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/boards/phytec-phycore-pxa270/board.c | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/gpio.h | 10 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/gpio.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/include/mach/gpio.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-mxs/include/mach/gpio.h | 21 | ||||
-rw-r--r-- | arch/arm/mach-pxa/gpio.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/plat/gpio.h | 32 | ||||
-rw-r--r-- | arch/arm/mach-samsung/gpio-s3c24x0.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-samsung/include/mach/gpio.h | 18 |
9 files changed, 34 insertions, 86 deletions
diff --git a/arch/arm/boards/phytec-phycore-pxa270/board.c b/arch/arm/boards/phytec-phycore-pxa270/board.c index 833c4c81e4..1424c9c937 100644 --- a/arch/arm/boards/phytec-phycore-pxa270/board.c +++ b/arch/arm/boards/phytec-phycore-pxa270/board.c @@ -26,7 +26,7 @@ #include <partition.h> #include <linux/sizes.h> -#include <plat/gpio.h> +#include <gpio.h> #include <mach/mfp-pxa27x.h> #include <mach/pxa-regs.h> #include <mach/pxafb.h> diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h deleted file mode 100644 index b3c1efe739..0000000000 --- a/arch/arm/include/asm/gpio.h +++ /dev/null @@ -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 */ diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h index 4e9d6865ab..bdc0cb6879 100644 --- a/arch/arm/mach-at91/include/mach/gpio.h +++ b/arch/arm/mach-at91/include/mach/gpio.h @@ -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) diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-ep93xx/include/mach/gpio.h deleted file mode 100644 index 306ab4c9f2..0000000000 --- a/arch/arm/mach-ep93xx/include/mach/gpio.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/gpio.h> diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h deleted file mode 100644 index 8643c98d5a..0000000000 --- a/arch/arm/mach-mxs/include/mach/gpio.h +++ /dev/null @@ -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 */ diff --git a/arch/arm/mach-pxa/gpio.c b/arch/arm/mach-pxa/gpio.c index 4e98493e73..7dd6ac0648 100644 --- a/arch/arm/mach-pxa/gpio.c +++ b/arch/arm/mach-pxa/gpio.c @@ -66,3 +66,35 @@ int __init pxa_init_gpio(int start, int end) return 0; } + +int gpio_get_value(unsigned gpio) +{ + return GPLR(gpio) & GPIO_bit(gpio); +} + +void gpio_set_value(unsigned gpio, int value) +{ + if (value) + GPSR(gpio) = GPIO_bit(gpio); + else + GPCR(gpio) = GPIO_bit(gpio); +} + +int gpio_direction_input(unsigned gpio) +{ + if (__gpio_is_inverted(gpio)) + GPDR(gpio) |= GPIO_bit(gpio); + else + GPDR(gpio) &= ~GPIO_bit(gpio); + return 0; +} + +int gpio_direction_output(unsigned gpio, int value) +{ + gpio_set_value(gpio, value); + if (__gpio_is_inverted(gpio)) + GPDR(gpio) &= ~GPIO_bit(gpio); + else + GPDR(gpio) |= GPIO_bit(gpio); + return 0; +} diff --git a/arch/arm/mach-pxa/include/plat/gpio.h b/arch/arm/mach-pxa/include/plat/gpio.h index 4c7b5266fb..35f90715e0 100644 --- a/arch/arm/mach-pxa/include/plat/gpio.h +++ b/arch/arm/mach-pxa/include/plat/gpio.h @@ -31,38 +31,6 @@ #define GFER_OFFSET 0x3C #define GEDR_OFFSET 0x48 -static inline int gpio_get_value(unsigned gpio) -{ - return GPLR(gpio) & GPIO_bit(gpio); -} - -static inline void gpio_set_value(unsigned gpio, int value) -{ - if (value) - GPSR(gpio) = GPIO_bit(gpio); - else - GPCR(gpio) = GPIO_bit(gpio); -} - -static inline int gpio_direction_input(unsigned gpio) -{ - if (__gpio_is_inverted(gpio)) - GPDR(gpio) |= GPIO_bit(gpio); - else - GPDR(gpio) &= ~GPIO_bit(gpio); - return 0; -} - -static inline int gpio_direction_output(unsigned gpio, int value) -{ - gpio_set_value(gpio, value); - if (__gpio_is_inverted(gpio)) - GPDR(gpio) &= ~GPIO_bit(gpio); - else - GPDR(gpio) |= GPIO_bit(gpio); - return 0; -} - /* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85). * Those cases currently cause holes in the GPIO number space, the * actual number of the last GPIO is recorded by 'pxa_last_gpio'. diff --git a/arch/arm/mach-samsung/gpio-s3c24x0.c b/arch/arm/mach-samsung/gpio-s3c24x0.c index f62588f0e7..58ca284eab 100644 --- a/arch/arm/mach-samsung/gpio-s3c24x0.c +++ b/arch/arm/mach-samsung/gpio-s3c24x0.c @@ -15,7 +15,7 @@ #include <errno.h> #include <io.h> #include <mach/s3c-iomap.h> -#include <mach/gpio.h> +#include <gpio.h> #include <mach/s3c24xx-gpio.h> #include <mach/iomux.h> diff --git a/arch/arm/mach-samsung/include/mach/gpio.h b/arch/arm/mach-samsung/include/mach/gpio.h deleted file mode 100644 index 39206676f8..0000000000 --- a/arch/arm/mach-samsung/include/mach/gpio.h +++ /dev/null @@ -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 */ |