From 5130216265f6f924a4ba8214787241be96d93467 Mon Sep 17 00:00:00 2001 From: Barry Song Date: Tue, 19 Jun 2012 15:00:05 +0800 Subject: PINCTRL: SiRF: add GPIO and GPIO irq support in CSR SiRFprimaII In SiRFprimaII, Each GPIO pin can be configured as input or output independently. If a GPIO is configured as input, it can also be enabled as an interrupt source (either edge or level triggered). These pins must be either MUXed as GPIO or other function pads. Signed-off-by: Yuping Luo Signed-off-by: Barry Song Acked-by: Linus Walleij --- arch/arm/Kconfig | 1 + arch/arm/mach-prima2/include/mach/gpio.h | 13 +++++++++++++ arch/arm/mach-prima2/include/mach/irqs.h | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-prima2/include/mach/gpio.h (limited to 'arch/arm') diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index a91009c6187..571b3d25c9b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -389,6 +389,7 @@ config ARCH_PRIMA2 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" select CPU_V7 select NO_IOPORT + select ARCH_WANT_OPTIONAL_GPIOLIB select GENERIC_CLOCKEVENTS select CLKDEV_LOOKUP select GENERIC_IRQ_CHIP diff --git a/arch/arm/mach-prima2/include/mach/gpio.h b/arch/arm/mach-prima2/include/mach/gpio.h new file mode 100644 index 00000000000..1904bb03876 --- /dev/null +++ b/arch/arm/mach-prima2/include/mach/gpio.h @@ -0,0 +1,13 @@ +#ifndef __MACH_GPIO_H +#define __MACH_GPIO_H + +/* Pull up/down values */ +enum sirfsoc_gpio_pull { + SIRFSOC_GPIO_PULL_NONE, + SIRFSOC_GPIO_PULL_UP, + SIRFSOC_GPIO_PULL_DOWN, +}; + +void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode); + +#endif diff --git a/arch/arm/mach-prima2/include/mach/irqs.h b/arch/arm/mach-prima2/include/mach/irqs.h index bb354f952fd..f6014a07541 100644 --- a/arch/arm/mach-prima2/include/mach/irqs.h +++ b/arch/arm/mach-prima2/include/mach/irqs.h @@ -11,7 +11,7 @@ #define SIRFSOC_INTENAL_IRQ_START 0 #define SIRFSOC_INTENAL_IRQ_END 59 - +#define SIRFSOC_GPIO_IRQ_START (SIRFSOC_INTENAL_IRQ_END + 1) #define NR_IRQS 220 #endif -- cgit v1.2.3-70-g09d2 From f63870924f83ebb66b5eb8fb8dde83bf9be252cc Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Wed, 4 Jul 2012 14:33:01 +0000 Subject: ARM: prima2: enable gpiolib unconditionally The pinctrl code needs GPIOLIB to be enabled, so make sure that it cannot be built otherwise. This fixes the prima2_defconfig. Signed-off-by: Arnd Bergmann Acked-by: Barry Song <21cnbao@gmail.com> --- arch/arm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 571b3d25c9b..a851307f875 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -389,7 +389,7 @@ config ARCH_PRIMA2 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" select CPU_V7 select NO_IOPORT - select ARCH_WANT_OPTIONAL_GPIOLIB + select ARCH_REQUIRE_GPIOLIB select GENERIC_CLOCKEVENTS select CLKDEV_LOOKUP select GENERIC_IRQ_CHIP -- cgit v1.2.3-70-g09d2