Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'depends/rmk/gpio' into next/devel

Conflicts:
arch/arm/mach-mxs/include/mach/gpio.h
arch/arm/plat-mxc/include/mach/gpio.h

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+1688 -1811
+1
arch/arm/Kconfig
··· 836 836 select CLKDEV_LOOKUP 837 837 select HAVE_MACH_CLKDEV 838 838 select GENERIC_GPIO 839 + select ARCH_REQUIRE_GPIOLIB 839 840 help 840 841 Support for ST-Ericsson U300 series mobile platforms. 841 842
+1 -1
arch/arm/common/scoop.c
··· 12 12 */ 13 13 14 14 #include <linux/device.h> 15 + #include <linux/gpio.h> 15 16 #include <linux/string.h> 16 17 #include <linux/slab.h> 17 18 #include <linux/platform_device.h> 18 19 #include <linux/io.h> 19 - #include <asm/gpio.h> 20 20 #include <asm/hardware/scoop.h> 21 21 22 22 /* PCMCIA to Scoop linkage
+19
arch/arm/include/asm/gpio.h
··· 4 4 /* not all ARM platforms necessarily support this API ... */ 5 5 #include <mach/gpio.h> 6 6 7 + #ifndef __ARM_GPIOLIB_COMPLEX 8 + /* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */ 9 + #include <asm-generic/gpio.h> 10 + 11 + /* The trivial gpiolib dispatchers */ 12 + #define gpio_get_value __gpio_get_value 13 + #define gpio_set_value __gpio_set_value 14 + #define gpio_cansleep __gpio_cansleep 15 + #endif 16 + 17 + /* 18 + * Provide a default gpio_to_irq() which should satisfy every case. 19 + * However, some platforms want to do this differently, so allow them 20 + * to override it. 21 + */ 22 + #ifndef gpio_to_irq 23 + #define gpio_to_irq __gpio_to_irq 24 + #endif 25 + 7 26 #endif /* _ARCH_ARM_GPIO_H */
+2
arch/arm/include/asm/hardware/iop3xx-gpio.h
··· 28 28 #include <mach/hardware.h> 29 29 #include <asm-generic/gpio.h> 30 30 31 + #define __ARM_GPIOLIB_COMPLEX 32 + 31 33 #define IOP3XX_N_GPIOS 8 32 34 33 35 static inline int gpio_get_value(unsigned gpio)
+1 -1
arch/arm/mach-at91/at91cap9_devices.c
··· 16 16 #include <asm/mach/irq.h> 17 17 18 18 #include <linux/dma-mapping.h> 19 + #include <linux/gpio.h> 19 20 #include <linux/platform_device.h> 20 21 #include <linux/i2c-gpio.h> 21 22 ··· 24 23 25 24 #include <mach/board.h> 26 25 #include <mach/cpu.h> 27 - #include <mach/gpio.h> 28 26 #include <mach/at91cap9.h> 29 27 #include <mach/at91cap9_matrix.h> 30 28 #include <mach/at91sam9_smc.h>
+1 -1
arch/arm/mach-at91/at91rm9200_devices.c
··· 14 14 #include <asm/mach/map.h> 15 15 16 16 #include <linux/dma-mapping.h> 17 + #include <linux/gpio.h> 17 18 #include <linux/platform_device.h> 18 19 #include <linux/i2c-gpio.h> 19 20 20 21 #include <mach/board.h> 21 - #include <mach/gpio.h> 22 22 #include <mach/at91rm9200.h> 23 23 #include <mach/at91rm9200_mc.h> 24 24
+1 -1
arch/arm/mach-at91/at91sam9260_devices.c
··· 13 13 #include <asm/mach/map.h> 14 14 15 15 #include <linux/dma-mapping.h> 16 + #include <linux/gpio.h> 16 17 #include <linux/platform_device.h> 17 18 #include <linux/i2c-gpio.h> 18 19 19 20 #include <mach/board.h> 20 - #include <mach/gpio.h> 21 21 #include <mach/cpu.h> 22 22 #include <mach/at91sam9260.h> 23 23 #include <mach/at91sam9260_matrix.h>
+1 -1
arch/arm/mach-at91/at91sam9261_devices.c
··· 14 14 #include <asm/mach/map.h> 15 15 16 16 #include <linux/dma-mapping.h> 17 + #include <linux/gpio.h> 17 18 #include <linux/platform_device.h> 18 19 #include <linux/i2c-gpio.h> 19 20 ··· 22 21 #include <video/atmel_lcdc.h> 23 22 24 23 #include <mach/board.h> 25 - #include <mach/gpio.h> 26 24 #include <mach/at91sam9261.h> 27 25 #include <mach/at91sam9261_matrix.h> 28 26 #include <mach/at91sam9_smc.h>
+1 -1
arch/arm/mach-at91/at91sam9263_devices.c
··· 13 13 #include <asm/mach/map.h> 14 14 15 15 #include <linux/dma-mapping.h> 16 + #include <linux/gpio.h> 16 17 #include <linux/platform_device.h> 17 18 #include <linux/i2c-gpio.h> 18 19 ··· 21 20 #include <video/atmel_lcdc.h> 22 21 23 22 #include <mach/board.h> 24 - #include <mach/gpio.h> 25 23 #include <mach/at91sam9263.h> 26 24 #include <mach/at91sam9263_matrix.h> 27 25 #include <mach/at91sam9_smc.h>
+1 -1
arch/arm/mach-at91/at91sam9g45_devices.c
··· 13 13 #include <asm/mach/map.h> 14 14 15 15 #include <linux/dma-mapping.h> 16 + #include <linux/gpio.h> 16 17 #include <linux/platform_device.h> 17 18 #include <linux/i2c-gpio.h> 18 19 #include <linux/atmel-mci.h> ··· 22 21 #include <video/atmel_lcdc.h> 23 22 24 23 #include <mach/board.h> 25 - #include <mach/gpio.h> 26 24 #include <mach/at91sam9g45.h> 27 25 #include <mach/at91sam9g45_matrix.h> 28 26 #include <mach/at91sam9_smc.h>
+1 -1
arch/arm/mach-at91/at91sam9rl_devices.c
··· 10 10 #include <asm/mach/map.h> 11 11 12 12 #include <linux/dma-mapping.h> 13 + #include <linux/gpio.h> 13 14 #include <linux/platform_device.h> 14 15 #include <linux/i2c-gpio.h> 15 16 ··· 18 17 #include <video/atmel_lcdc.h> 19 18 20 19 #include <mach/board.h> 21 - #include <mach/gpio.h> 22 20 #include <mach/at91sam9rl.h> 23 21 #include <mach/at91sam9rl_matrix.h> 24 22 #include <mach/at91sam9_smc.h>
+1 -1
arch/arm/mach-at91/board-1arm.c
··· 19 19 */ 20 20 21 21 #include <linux/types.h> 22 + #include <linux/gpio.h> 22 23 #include <linux/init.h> 23 24 #include <linux/mm.h> 24 25 #include <linux/module.h> ··· 35 34 #include <asm/mach/irq.h> 36 35 37 36 #include <mach/board.h> 38 - #include <mach/gpio.h> 39 37 #include <mach/cpu.h> 40 38 41 39 #include "generic.h"
+1 -1
arch/arm/mach-at91/board-afeb-9260v1.c
··· 25 25 */ 26 26 27 27 #include <linux/types.h> 28 + #include <linux/gpio.h> 28 29 #include <linux/init.h> 29 30 #include <linux/mm.h> 30 31 #include <linux/module.h> ··· 44 43 #include <asm/mach/irq.h> 45 44 46 45 #include <mach/board.h> 47 - #include <mach/gpio.h> 48 46 49 47 #include "generic.h" 50 48
+1 -1
arch/arm/mach-at91/board-cam60.c
··· 21 21 */ 22 22 23 23 #include <linux/types.h> 24 + #include <linux/gpio.h> 24 25 #include <linux/init.h> 25 26 #include <linux/mm.h> 26 27 #include <linux/module.h> ··· 39 38 #include <asm/mach/irq.h> 40 39 41 40 #include <mach/board.h> 42 - #include <mach/gpio.h> 43 41 #include <mach/at91sam9_smc.h> 44 42 45 43 #include "sam9_smc.h"
+1 -1
arch/arm/mach-at91/board-cap9adk.c
··· 22 22 */ 23 23 24 24 #include <linux/types.h> 25 + #include <linux/gpio.h> 25 26 #include <linux/init.h> 26 27 #include <linux/mm.h> 27 28 #include <linux/module.h> ··· 42 41 #include <asm/mach/map.h> 43 42 44 43 #include <mach/board.h> 45 - #include <mach/gpio.h> 46 44 #include <mach/at91cap9_matrix.h> 47 45 #include <mach/at91sam9_smc.h> 48 46 #include <mach/system_rev.h>
+1 -1
arch/arm/mach-at91/board-carmeva.c
··· 20 20 */ 21 21 22 22 #include <linux/types.h> 23 + #include <linux/gpio.h> 23 24 #include <linux/init.h> 24 25 #include <linux/mm.h> 25 26 #include <linux/module.h> ··· 36 35 37 36 #include <mach/hardware.h> 38 37 #include <mach/board.h> 39 - #include <mach/gpio.h> 40 38 41 39 #include "generic.h" 42 40
+1 -1
arch/arm/mach-at91/board-cpu9krea.c
··· 21 21 */ 22 22 23 23 #include <linux/types.h> 24 + #include <linux/gpio.h> 24 25 #include <linux/init.h> 25 26 #include <linux/mm.h> 26 27 #include <linux/module.h> ··· 41 40 42 41 #include <mach/hardware.h> 43 42 #include <mach/board.h> 44 - #include <mach/gpio.h> 45 43 #include <mach/at91sam9_smc.h> 46 44 #include <mach/at91sam9260_matrix.h> 47 45
+1 -1
arch/arm/mach-at91/board-cpuat91.c
··· 19 19 */ 20 20 21 21 #include <linux/types.h> 22 + #include <linux/gpio.h> 22 23 #include <linux/init.h> 23 24 #include <linux/mm.h> 24 25 #include <linux/module.h> ··· 37 36 #include <asm/mach/irq.h> 38 37 39 38 #include <mach/board.h> 40 - #include <mach/gpio.h> 41 39 #include <mach/at91rm9200_mc.h> 42 40 #include <mach/cpu.h> 43 41
+1 -1
arch/arm/mach-at91/board-csb337.c
··· 19 19 */ 20 20 21 21 #include <linux/types.h> 22 + #include <linux/gpio.h> 22 23 #include <linux/init.h> 23 24 #include <linux/mm.h> 24 25 #include <linux/module.h> ··· 39 38 40 39 #include <mach/hardware.h> 41 40 #include <mach/board.h> 42 - #include <mach/gpio.h> 43 41 44 42 #include "generic.h" 45 43
+1 -1
arch/arm/mach-at91/board-csb637.c
··· 20 20 21 21 #include <linux/types.h> 22 22 #include <linux/init.h> 23 + #include <linux/gpio.h> 23 24 #include <linux/mm.h> 24 25 #include <linux/module.h> 25 26 #include <linux/platform_device.h> ··· 36 35 37 36 #include <mach/hardware.h> 38 37 #include <mach/board.h> 39 - #include <mach/gpio.h> 40 38 41 39 #include "generic.h" 42 40
+1 -1
arch/arm/mach-at91/board-eb9200.c
··· 20 20 */ 21 21 22 22 #include <linux/types.h> 23 + #include <linux/gpio.h> 23 24 #include <linux/init.h> 24 25 #include <linux/mm.h> 25 26 #include <linux/module.h> ··· 36 35 #include <asm/mach/irq.h> 37 36 38 37 #include <mach/board.h> 39 - #include <mach/gpio.h> 40 38 41 39 #include "generic.h" 42 40
+1 -1
arch/arm/mach-at91/board-ecbat91.c
··· 20 20 */ 21 21 22 22 #include <linux/types.h> 23 + #include <linux/gpio.h> 23 24 #include <linux/init.h> 24 25 #include <linux/mm.h> 25 26 #include <linux/module.h> ··· 38 37 #include <asm/mach/irq.h> 39 38 40 39 #include <mach/board.h> 41 - #include <mach/gpio.h> 42 40 #include <mach/cpu.h> 43 41 44 42 #include "generic.h"
+1 -1
arch/arm/mach-at91/board-kafa.c
··· 19 19 */ 20 20 21 21 #include <linux/types.h> 22 + #include <linux/gpio.h> 22 23 #include <linux/init.h> 23 24 #include <linux/mm.h> 24 25 #include <linux/module.h> ··· 35 34 #include <asm/mach/irq.h> 36 35 37 36 #include <mach/board.h> 38 - #include <mach/gpio.h> 39 37 #include <mach/cpu.h> 40 38 41 39 #include "generic.h"
+1 -1
arch/arm/mach-at91/board-kb9202.c
··· 20 20 */ 21 21 22 22 #include <linux/types.h> 23 + #include <linux/gpio.h> 23 24 #include <linux/init.h> 24 25 #include <linux/mm.h> 25 26 #include <linux/module.h> ··· 36 35 #include <asm/mach/irq.h> 37 36 38 37 #include <mach/board.h> 39 - #include <mach/gpio.h> 40 38 #include <mach/cpu.h> 41 39 #include <mach/at91rm9200_mc.h> 42 40
+1 -1
arch/arm/mach-at91/board-neocore926.c
··· 21 21 */ 22 22 23 23 #include <linux/types.h> 24 + #include <linux/gpio.h> 24 25 #include <linux/init.h> 25 26 #include <linux/mm.h> 26 27 #include <linux/module.h> ··· 45 44 46 45 #include <mach/hardware.h> 47 46 #include <mach/board.h> 48 - #include <mach/gpio.h> 49 47 #include <mach/at91sam9_smc.h> 50 48 51 49 #include "sam9_smc.h"
+1 -1
arch/arm/mach-at91/board-picotux200.c
··· 20 20 */ 21 21 22 22 #include <linux/types.h> 23 + #include <linux/gpio.h> 23 24 #include <linux/init.h> 24 25 #include <linux/mm.h> 25 26 #include <linux/module.h> ··· 38 37 #include <asm/mach/irq.h> 39 38 40 39 #include <mach/board.h> 41 - #include <mach/gpio.h> 42 40 #include <mach/at91rm9200_mc.h> 43 41 44 42 #include "generic.h"
+1 -1
arch/arm/mach-at91/board-qil-a9260.c
··· 21 21 */ 22 22 23 23 #include <linux/types.h> 24 + #include <linux/gpio.h> 24 25 #include <linux/init.h> 25 26 #include <linux/mm.h> 26 27 #include <linux/module.h> ··· 41 40 42 41 #include <mach/hardware.h> 43 42 #include <mach/board.h> 44 - #include <mach/gpio.h> 45 43 #include <mach/at91sam9_smc.h> 46 44 #include <mach/at91_shdwc.h> 47 45
+1 -1
arch/arm/mach-at91/board-rm9200dk.c
··· 22 22 */ 23 23 24 24 #include <linux/types.h> 25 + #include <linux/gpio.h> 25 26 #include <linux/init.h> 26 27 #include <linux/mm.h> 27 28 #include <linux/module.h> ··· 40 39 41 40 #include <mach/hardware.h> 42 41 #include <mach/board.h> 43 - #include <mach/gpio.h> 44 42 #include <mach/at91rm9200_mc.h> 45 43 46 44 #include "generic.h"
+1 -1
arch/arm/mach-at91/board-rm9200ek.c
··· 22 22 */ 23 23 24 24 #include <linux/types.h> 25 + #include <linux/gpio.h> 25 26 #include <linux/init.h> 26 27 #include <linux/mm.h> 27 28 #include <linux/module.h> ··· 40 39 41 40 #include <mach/hardware.h> 42 41 #include <mach/board.h> 43 - #include <mach/gpio.h> 44 42 #include <mach/at91rm9200_mc.h> 45 43 46 44 #include "generic.h"
+1 -1
arch/arm/mach-at91/board-sam9-l9260.c
··· 21 21 */ 22 22 23 23 #include <linux/types.h> 24 + #include <linux/gpio.h> 24 25 #include <linux/init.h> 25 26 #include <linux/mm.h> 26 27 #include <linux/module.h> ··· 38 37 #include <asm/mach/irq.h> 39 38 40 39 #include <mach/board.h> 41 - #include <mach/gpio.h> 42 40 #include <mach/at91sam9_smc.h> 43 41 44 42 #include "sam9_smc.h"
+1 -1
arch/arm/mach-at91/board-sam9260ek.c
··· 20 20 */ 21 21 22 22 #include <linux/types.h> 23 + #include <linux/gpio.h> 23 24 #include <linux/init.h> 24 25 #include <linux/mm.h> 25 26 #include <linux/module.h> ··· 42 41 43 42 #include <mach/hardware.h> 44 43 #include <mach/board.h> 45 - #include <mach/gpio.h> 46 44 #include <mach/at91sam9_smc.h> 47 45 #include <mach/at91_shdwc.h> 48 46 #include <mach/system_rev.h>
+1 -1
arch/arm/mach-at91/board-sam9261ek.c
··· 20 20 */ 21 21 22 22 #include <linux/types.h> 23 + #include <linux/gpio.h> 23 24 #include <linux/init.h> 24 25 #include <linux/mm.h> 25 26 #include <linux/module.h> ··· 46 45 47 46 #include <mach/hardware.h> 48 47 #include <mach/board.h> 49 - #include <mach/gpio.h> 50 48 #include <mach/at91sam9_smc.h> 51 49 #include <mach/at91_shdwc.h> 52 50 #include <mach/system_rev.h>
+1 -1
arch/arm/mach-at91/board-sam9263ek.c
··· 20 20 */ 21 21 22 22 #include <linux/types.h> 23 + #include <linux/gpio.h> 23 24 #include <linux/init.h> 24 25 #include <linux/mm.h> 25 26 #include <linux/module.h> ··· 45 44 46 45 #include <mach/hardware.h> 47 46 #include <mach/board.h> 48 - #include <mach/gpio.h> 49 47 #include <mach/at91sam9_smc.h> 50 48 #include <mach/at91_shdwc.h> 51 49 #include <mach/system_rev.h>
+1 -1
arch/arm/mach-at91/board-sam9g20ek.c
··· 18 18 */ 19 19 20 20 #include <linux/types.h> 21 + #include <linux/gpio.h> 21 22 #include <linux/init.h> 22 23 #include <linux/mm.h> 23 24 #include <linux/module.h> ··· 42 41 #include <asm/mach/irq.h> 43 42 44 43 #include <mach/board.h> 45 - #include <mach/gpio.h> 46 44 #include <mach/at91sam9_smc.h> 47 45 #include <mach/system_rev.h> 48 46
+1 -1
arch/arm/mach-at91/board-sam9m10g45ek.c
··· 14 14 */ 15 15 16 16 #include <linux/types.h> 17 + #include <linux/gpio.h> 17 18 #include <linux/init.h> 18 19 #include <linux/mm.h> 19 20 #include <linux/module.h> ··· 39 38 #include <asm/mach/irq.h> 40 39 41 40 #include <mach/board.h> 42 - #include <mach/gpio.h> 43 41 #include <mach/at91sam9_smc.h> 44 42 #include <mach/at91_shdwc.h> 45 43 #include <mach/system_rev.h>
+1 -1
arch/arm/mach-at91/board-sam9rlek.c
··· 8 8 */ 9 9 10 10 #include <linux/types.h> 11 + #include <linux/gpio.h> 11 12 #include <linux/init.h> 12 13 #include <linux/mm.h> 13 14 #include <linux/module.h> ··· 31 30 32 31 #include <mach/hardware.h> 33 32 #include <mach/board.h> 34 - #include <mach/gpio.h> 35 33 #include <mach/at91sam9_smc.h> 36 34 #include <mach/at91_shdwc.h> 37 35
+1 -1
arch/arm/mach-at91/board-usb-a9260.c
··· 21 21 */ 22 22 23 23 #include <linux/types.h> 24 + #include <linux/gpio.h> 24 25 #include <linux/init.h> 25 26 #include <linux/mm.h> 26 27 #include <linux/module.h> ··· 41 40 42 41 #include <mach/hardware.h> 43 42 #include <mach/board.h> 44 - #include <mach/gpio.h> 45 43 #include <mach/at91sam9_smc.h> 46 44 #include <mach/at91_shdwc.h> 47 45
+1 -1
arch/arm/mach-at91/board-usb-a9263.c
··· 21 21 */ 22 22 23 23 #include <linux/types.h> 24 + #include <linux/gpio.h> 24 25 #include <linux/init.h> 25 26 #include <linux/mm.h> 26 27 #include <linux/module.h> ··· 40 39 41 40 #include <mach/hardware.h> 42 41 #include <mach/board.h> 43 - #include <mach/gpio.h> 44 42 #include <mach/at91sam9_smc.h> 45 43 #include <mach/at91_shdwc.h> 46 44
+1 -1
arch/arm/mach-at91/board-yl-9200.c
··· 22 22 */ 23 23 24 24 #include <linux/types.h> 25 + #include <linux/gpio.h> 25 26 #include <linux/init.h> 26 27 #include <linux/mm.h> 27 28 #include <linux/module.h> ··· 44 43 45 44 #include <mach/hardware.h> 46 45 #include <mach/board.h> 47 - #include <mach/gpio.h> 48 46 #include <mach/at91rm9200_mc.h> 49 47 #include <mach/cpu.h> 50 48
+1 -3
arch/arm/mach-at91/gpio.c
··· 11 11 12 12 #include <linux/clk.h> 13 13 #include <linux/errno.h> 14 + #include <linux/gpio.h> 14 15 #include <linux/interrupt.h> 15 16 #include <linux/irq.h> 16 17 #include <linux/debugfs.h> ··· 23 22 24 23 #include <mach/hardware.h> 25 24 #include <mach/at91_pio.h> 26 - #include <mach/gpio.h> 27 - 28 - #include <asm/gpio.h> 29 25 30 26 #include "generic.h" 31 27
-5
arch/arm/mach-at91/include/mach/gpio.h
··· 214 214 */ 215 215 216 216 #include <asm/errno.h> 217 - #include <asm-generic/gpio.h> /* cansleep wrappers */ 218 - 219 - #define gpio_get_value __gpio_get_value 220 - #define gpio_set_value __gpio_set_value 221 - #define gpio_cansleep __gpio_cansleep 222 217 223 218 #define gpio_to_irq(gpio) (gpio) 224 219 #define irq_to_gpio(irq) (irq)
+1 -1
arch/arm/mach-at91/leds.c
··· 9 9 * 2 of the License, or (at your option) any later version. 10 10 */ 11 11 12 + #include <linux/gpio.h> 12 13 #include <linux/kernel.h> 13 14 #include <linux/module.h> 14 15 #include <linux/init.h> 15 16 #include <linux/platform_device.h> 16 17 17 18 #include <mach/board.h> 18 - #include <mach/gpio.h> 19 19 20 20 21 21 /* ------------------------------------------------------------------------- */
+1 -1
arch/arm/mach-at91/pm.c
··· 10 10 * (at your option) any later version. 11 11 */ 12 12 13 + #include <linux/gpio.h> 13 14 #include <linux/suspend.h> 14 15 #include <linux/sched.h> 15 16 #include <linux/proc_fs.h> ··· 26 25 #include <asm/mach/irq.h> 27 26 28 27 #include <mach/at91_pmc.h> 29 - #include <mach/gpio.h> 30 28 #include <mach/cpu.h> 31 29 32 30 #include "generic.h"
+1 -2
arch/arm/mach-davinci/Makefile
··· 5 5 6 6 # Common objects 7 7 obj-y := time.o clock.o serial.o io.o psc.o \ 8 - gpio.o dma.o usb.o common.o sram.o aemif.o 8 + dma.o usb.o common.o sram.o aemif.o 9 9 10 10 obj-$(CONFIG_DAVINCI_MUX) += mux.o 11 11 ··· 17 17 obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o 18 18 obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o 19 19 obj-$(CONFIG_ARCH_DAVINCI_TNETV107X) += tnetv107x.o devices-tnetv107x.o 20 - obj-$(CONFIG_ARCH_DAVINCI_TNETV107X) += gpio-tnetv107x.o 21 20 22 21 obj-$(CONFIG_AINTC) += irq.o 23 22 obj-$(CONFIG_CP_INTC) += cp_intc.o
+2 -1
arch/arm/mach-davinci/da830.c
··· 8 8 * is licensed "as is" without any warranty of any kind, whether express 9 9 * or implied. 10 10 */ 11 + #include <linux/gpio.h> 11 12 #include <linux/init.h> 12 13 #include <linux/clk.h> 13 14 ··· 20 19 #include <mach/common.h> 21 20 #include <mach/time.h> 22 21 #include <mach/da8xx.h> 23 - #include <mach/gpio.h> 22 + #include <mach/gpio-davinci.h> 24 23 25 24 #include "clock.h" 26 25 #include "mux.h"
+2 -1
arch/arm/mach-davinci/da850.c
··· 11 11 * is licensed "as is" without any warranty of any kind, whether express 12 12 * or implied. 13 13 */ 14 + #include <linux/gpio.h> 14 15 #include <linux/init.h> 15 16 #include <linux/clk.h> 16 17 #include <linux/platform_device.h> ··· 28 27 #include <mach/da8xx.h> 29 28 #include <mach/cpufreq.h> 30 29 #include <mach/pm.h> 31 - #include <mach/gpio.h> 30 + #include <mach/gpio-davinci.h> 32 31 33 32 #include "clock.h" 34 33 #include "mux.h"
+1 -1
arch/arm/mach-davinci/dm355.c
··· 13 13 #include <linux/serial_8250.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/dma-mapping.h> 16 - #include <linux/gpio.h> 17 16 18 17 #include <linux/spi/spi.h> 19 18 ··· 29 30 #include <mach/common.h> 30 31 #include <mach/asp.h> 31 32 #include <mach/spi.h> 33 + #include <mach/gpio-davinci.h> 32 34 33 35 #include "clock.h" 34 36 #include "mux.h"
+1 -2
arch/arm/mach-davinci/dm365.c
··· 17 17 #include <linux/serial_8250.h> 18 18 #include <linux/platform_device.h> 19 19 #include <linux/dma-mapping.h> 20 - #include <linux/gpio.h> 21 20 #include <linux/spi/spi.h> 22 21 23 22 #include <asm/mach/map.h> ··· 33 34 #include <mach/asp.h> 34 35 #include <mach/keyscan.h> 35 36 #include <mach/spi.h> 36 - 37 + #include <mach/gpio-davinci.h> 37 38 38 39 #include "clock.h" 39 40 #include "mux.h"
+1 -1
arch/arm/mach-davinci/dm644x.c
··· 12 12 #include <linux/clk.h> 13 13 #include <linux/serial_8250.h> 14 14 #include <linux/platform_device.h> 15 - #include <linux/gpio.h> 16 15 17 16 #include <asm/mach/map.h> 18 17 ··· 25 26 #include <mach/serial.h> 26 27 #include <mach/common.h> 27 28 #include <mach/asp.h> 29 + #include <mach/gpio-davinci.h> 28 30 29 31 #include "clock.h" 30 32 #include "mux.h"
+1 -1
arch/arm/mach-davinci/dm646x.c
··· 13 13 #include <linux/clk.h> 14 14 #include <linux/serial_8250.h> 15 15 #include <linux/platform_device.h> 16 - #include <linux/gpio.h> 17 16 18 17 #include <asm/mach/map.h> 19 18 ··· 26 27 #include <mach/serial.h> 27 28 #include <mach/common.h> 28 29 #include <mach/asp.h> 30 + #include <mach/gpio-davinci.h> 29 31 30 32 #include "clock.h" 31 33 #include "mux.h"
arch/arm/mach-davinci/gpio-tnetv107x.c drivers/gpio/gpio-tnetv107x.c
+1 -6
arch/arm/mach-davinci/gpio.c drivers/gpio/gpio-davinci.c
··· 9 9 * the Free Software Foundation; either version 2 of the License, or 10 10 * (at your option) any later version. 11 11 */ 12 - 12 + #include <linux/gpio.h> 13 13 #include <linux/errno.h> 14 14 #include <linux/kernel.h> 15 15 #include <linux/clk.h> 16 16 #include <linux/err.h> 17 17 #include <linux/io.h> 18 - 19 - #include <mach/gpio.h> 20 18 21 19 #include <asm/mach/irq.h> 22 20 ··· 230 232 231 233 static int gpio_irq_type(struct irq_data *d, unsigned trigger) 232 234 { 233 - struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); 234 - u32 mask = (u32) irq_data_get_irq_handler_data(d); 235 - 236 235 if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 237 236 return -EINVAL; 238 237
+91
arch/arm/mach-davinci/include/mach/gpio-davinci.h
··· 1 + /* 2 + * TI DaVinci GPIO Support 3 + * 4 + * Copyright (c) 2006 David Brownell 5 + * Copyright (c) 2007, MontaVista Software, Inc. <source@mvista.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License as published by 9 + * the Free Software Foundation; either version 2 of the License, or 10 + * (at your option) any later version. 11 + */ 12 + 13 + #ifndef __DAVINCI_DAVINCI_GPIO_H 14 + #define __DAVINCI_DAVINCI_GPIO_H 15 + 16 + #include <linux/io.h> 17 + #include <linux/spinlock.h> 18 + 19 + #include <asm-generic/gpio.h> 20 + 21 + #include <mach/irqs.h> 22 + #include <mach/common.h> 23 + 24 + #define DAVINCI_GPIO_BASE 0x01C67000 25 + 26 + enum davinci_gpio_type { 27 + GPIO_TYPE_DAVINCI = 0, 28 + GPIO_TYPE_TNETV107X, 29 + }; 30 + 31 + /* 32 + * basic gpio routines 33 + * 34 + * board-specific init should be done by arch/.../.../board-XXX.c (maybe 35 + * initializing banks together) rather than boot loaders; kexec() won't 36 + * go through boot loaders. 37 + * 38 + * the gpio clock will be turned on when gpios are used, and you may also 39 + * need to pay attention to PINMUX registers to be sure those pins are 40 + * used as gpios, not with other peripherals. 41 + * 42 + * On-chip GPIOs are numbered 0..(DAVINCI_N_GPIO-1). For documentation, 43 + * and maybe for later updates, code may write GPIO(N). These may be 44 + * all 1.8V signals, all 3.3V ones, or a mix of the two. A given chip 45 + * may not support all the GPIOs in that range. 46 + * 47 + * GPIOs can also be on external chips, numbered after the ones built-in 48 + * to the DaVinci chip. For now, they won't be usable as IRQ sources. 49 + */ 50 + #define GPIO(X) (X) /* 0 <= X <= (DAVINCI_N_GPIO - 1) */ 51 + 52 + /* Convert GPIO signal to GPIO pin number */ 53 + #define GPIO_TO_PIN(bank, gpio) (16 * (bank) + (gpio)) 54 + 55 + struct davinci_gpio_controller { 56 + struct gpio_chip chip; 57 + int irq_base; 58 + spinlock_t lock; 59 + void __iomem *regs; 60 + void __iomem *set_data; 61 + void __iomem *clr_data; 62 + void __iomem *in_data; 63 + }; 64 + 65 + /* The __gpio_to_controller() and __gpio_mask() functions inline to constants 66 + * with constant parameters; or in outlined code they execute at runtime. 67 + * 68 + * You'd access the controller directly when reading or writing more than 69 + * one gpio value at a time, and to support wired logic where the value 70 + * being driven by the cpu need not match the value read back. 71 + * 72 + * These are NOT part of the cross-platform GPIO interface 73 + */ 74 + static inline struct davinci_gpio_controller * 75 + __gpio_to_controller(unsigned gpio) 76 + { 77 + struct davinci_gpio_controller *ctlrs = davinci_soc_info.gpio_ctlrs; 78 + int index = gpio / 32; 79 + 80 + if (!ctlrs || index >= davinci_soc_info.gpio_ctlrs_num) 81 + return NULL; 82 + 83 + return ctlrs + index; 84 + } 85 + 86 + static inline u32 __gpio_mask(unsigned gpio) 87 + { 88 + return 1 << (gpio % 32); 89 + } 90 + 91 + #endif /* __DAVINCI_DAVINCI_GPIO_H */
+2 -77
arch/arm/mach-davinci/include/mach/gpio.h
··· 13 13 #ifndef __DAVINCI_GPIO_H 14 14 #define __DAVINCI_GPIO_H 15 15 16 - #include <linux/io.h> 17 - #include <linux/spinlock.h> 18 - 19 16 #include <asm-generic/gpio.h> 20 17 21 - #include <mach/irqs.h> 22 - #include <mach/common.h> 23 - 24 - #define DAVINCI_GPIO_BASE 0x01C67000 25 - 26 - enum davinci_gpio_type { 27 - GPIO_TYPE_DAVINCI = 0, 28 - GPIO_TYPE_TNETV107X, 29 - }; 30 - 31 - /* 32 - * basic gpio routines 33 - * 34 - * board-specific init should be done by arch/.../.../board-XXX.c (maybe 35 - * initializing banks together) rather than boot loaders; kexec() won't 36 - * go through boot loaders. 37 - * 38 - * the gpio clock will be turned on when gpios are used, and you may also 39 - * need to pay attention to PINMUX registers to be sure those pins are 40 - * used as gpios, not with other peripherals. 41 - * 42 - * On-chip GPIOs are numbered 0..(DAVINCI_N_GPIO-1). For documentation, 43 - * and maybe for later updates, code may write GPIO(N). These may be 44 - * all 1.8V signals, all 3.3V ones, or a mix of the two. A given chip 45 - * may not support all the GPIOs in that range. 46 - * 47 - * GPIOs can also be on external chips, numbered after the ones built-in 48 - * to the DaVinci chip. For now, they won't be usable as IRQ sources. 49 - */ 50 - #define GPIO(X) (X) /* 0 <= X <= (DAVINCI_N_GPIO - 1) */ 51 - 52 - /* Convert GPIO signal to GPIO pin number */ 53 - #define GPIO_TO_PIN(bank, gpio) (16 * (bank) + (gpio)) 54 - 55 - struct davinci_gpio_controller { 56 - struct gpio_chip chip; 57 - int irq_base; 58 - spinlock_t lock; 59 - void __iomem *regs; 60 - void __iomem *set_data; 61 - void __iomem *clr_data; 62 - void __iomem *in_data; 63 - }; 64 - 65 - /* The __gpio_to_controller() and __gpio_mask() functions inline to constants 66 - * with constant parameters; or in outlined code they execute at runtime. 67 - * 68 - * You'd access the controller directly when reading or writing more than 69 - * one gpio value at a time, and to support wired logic where the value 70 - * being driven by the cpu need not match the value read back. 71 - * 72 - * These are NOT part of the cross-platform GPIO interface 73 - */ 74 - static inline struct davinci_gpio_controller * 75 - __gpio_to_controller(unsigned gpio) 76 - { 77 - struct davinci_gpio_controller *ctlrs = davinci_soc_info.gpio_ctlrs; 78 - int index = gpio / 32; 79 - 80 - if (!ctlrs || index >= davinci_soc_info.gpio_ctlrs_num) 81 - return NULL; 82 - 83 - return ctlrs + index; 84 - } 85 - 86 - static inline u32 __gpio_mask(unsigned gpio) 87 - { 88 - return 1 << (gpio % 32); 89 - } 18 + /* The inline versions use the static inlines in the driver header */ 19 + #include "gpio-davinci.h" 90 20 91 21 /* 92 22 * The get/set/clear functions will inline when called with constant ··· 75 145 return 0; 76 146 else 77 147 return __gpio_cansleep(gpio); 78 - } 79 - 80 - static inline int gpio_to_irq(unsigned gpio) 81 - { 82 - return __gpio_to_irq(gpio); 83 148 } 84 149 85 150 static inline int irq_to_gpio(unsigned irq)
+2 -1
arch/arm/mach-davinci/tnetv107x.c
··· 12 12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 13 * GNU General Public License for more details. 14 14 */ 15 + #include <linux/gpio.h> 15 16 #include <linux/kernel.h> 16 17 #include <linux/init.h> 17 18 #include <linux/clk.h> ··· 28 27 #include <mach/psc.h> 29 28 #include <mach/cp_intc.h> 30 29 #include <mach/irqs.h> 31 - #include <mach/gpio.h> 32 30 #include <mach/hardware.h> 33 31 #include <mach/tnetv107x.h> 32 + #include <mach/gpio-davinci.h> 34 33 35 34 #include "clock.h" 36 35 #include "mux.h"
+1
arch/arm/mach-ep93xx/core.c
··· 38 38 #include <mach/fb.h> 39 39 #include <mach/ep93xx_keypad.h> 40 40 #include <mach/ep93xx_spi.h> 41 + #include <mach/gpio-ep93xx.h> 41 42 42 43 #include <asm/mach/map.h> 43 44 #include <asm/mach/time.h>
+1
arch/arm/mach-ep93xx/edb93xx.c
··· 37 37 #include <mach/hardware.h> 38 38 #include <mach/fb.h> 39 39 #include <mach/ep93xx_spi.h> 40 + #include <mach/gpio-ep93xx.h> 40 41 41 42 #include <asm/mach-types.h> 42 43 #include <asm/mach/arch.h>
+4 -24
arch/arm/mach-ep93xx/include/mach/gpio.h arch/arm/mach-ep93xx/include/mach/gpio-ep93xx.h
··· 1 - /* 2 - * arch/arm/mach-ep93xx/include/mach/gpio.h 3 - */ 1 + /* Include file for the EP93XX GPIO controller machine specifics */ 4 2 5 - #ifndef __ASM_ARCH_GPIO_H 6 - #define __ASM_ARCH_GPIO_H 3 + #ifndef __GPIO_EP93XX_H 4 + #define __GPIO_EP93XX_H 7 5 8 6 /* GPIO port A. */ 9 7 #define EP93XX_GPIO_LINE_A(x) ((x) + 0) ··· 97 99 /* maximum value for irq capable line identifiers */ 98 100 #define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7) 99 101 100 - /* new generic GPIO API - see Documentation/gpio.txt */ 101 - 102 - #include <asm-generic/gpio.h> 103 - 104 - #define gpio_get_value __gpio_get_value 105 - #define gpio_set_value __gpio_set_value 106 - #define gpio_cansleep __gpio_cansleep 107 - 108 - /* 109 - * Map GPIO A0..A7 (0..7) to irq 64..71, 110 - * B0..B7 (7..15) to irq 72..79, and 111 - * F0..F7 (16..24) to irq 80..87. 112 - */ 113 - #define gpio_to_irq(gpio) \ 114 - (((gpio) <= EP93XX_GPIO_LINE_MAX_IRQ) ? (64 + (gpio)) : -EINVAL) 115 - 116 - #define irq_to_gpio(irq) ((irq) - gpio_to_irq(0)) 117 - 118 - #endif 102 + #endif /* __GPIO_EP93XX_H */
+1 -1
arch/arm/mach-ep93xx/simone.c
··· 18 18 #include <linux/kernel.h> 19 19 #include <linux/init.h> 20 20 #include <linux/platform_device.h> 21 - #include <linux/gpio.h> 22 21 #include <linux/i2c.h> 23 22 #include <linux/i2c-gpio.h> 24 23 25 24 #include <mach/hardware.h> 26 25 #include <mach/fb.h> 26 + #include <mach/gpio-ep93xx.h> 27 27 28 28 #include <asm/mach-types.h> 29 29 #include <asm/mach/arch.h>
+1 -1
arch/arm/mach-ep93xx/snappercl15.c
··· 20 20 #include <linux/kernel.h> 21 21 #include <linux/init.h> 22 22 #include <linux/io.h> 23 - #include <linux/gpio.h> 24 23 #include <linux/i2c.h> 25 24 #include <linux/i2c-gpio.h> 26 25 #include <linux/fb.h> ··· 29 30 30 31 #include <mach/hardware.h> 31 32 #include <mach/fb.h> 33 + #include <mach/gpio-ep93xx.h> 32 34 33 35 #include <asm/mach-types.h> 34 36 #include <asm/mach/arch.h>
-7
arch/arm/mach-exynos4/include/mach/gpio.h
··· 13 13 #ifndef __ASM_ARCH_GPIO_H 14 14 #define __ASM_ARCH_GPIO_H __FILE__ 15 15 16 - #define gpio_get_value __gpio_get_value 17 - #define gpio_set_value __gpio_set_value 18 - #define gpio_cansleep __gpio_cansleep 19 - #define gpio_to_irq __gpio_to_irq 20 - 21 16 /* Practically, GPIO banks up to GPZ are the configurable gpio banks */ 22 17 23 18 /* GPIO bank sizes */ ··· 145 150 /* define the number of gpios we need to the one after the GPZ() range */ 146 151 #define ARCH_NR_GPIOS (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + \ 147 152 CONFIG_SAMSUNG_GPIO_EXTRA + 1) 148 - 149 - #include <asm-generic/gpio.h> 150 153 151 154 #endif /* __ASM_ARCH_GPIO_H */
-5
arch/arm/mach-gemini/include/mach/gpio.h
··· 13 13 #define __MACH_GPIO_H__ 14 14 15 15 #include <mach/irqs.h> 16 - #include <asm-generic/gpio.h> 17 - 18 - #define gpio_get_value __gpio_get_value 19 - #define gpio_set_value __gpio_set_value 20 - #define gpio_cansleep __gpio_cansleep 21 16 22 17 #define gpio_to_irq(x) ((x) + GPIO_IRQ_BASE) 23 18 #define irq_to_gpio(x) ((x) - GPIO_IRQ_BASE)
+1 -2
arch/arm/mach-imx/iomux-imx31.c
··· 17 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 18 18 * MA 02110-1301, USA. 19 19 */ 20 - 20 + #include <linux/gpio.h> 21 21 #include <linux/module.h> 22 22 #include <linux/spinlock.h> 23 23 #include <linux/io.h> 24 24 #include <linux/kernel.h> 25 25 #include <mach/hardware.h> 26 - #include <mach/gpio.h> 27 26 #include <mach/iomux-mx3.h> 28 27 29 28 /*
+1 -2
arch/arm/mach-imx/mach-mx27ads.c
··· 13 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 * GNU General Public License for more details. 15 15 */ 16 - 16 + #include <linux/gpio.h> 17 17 #include <linux/platform_device.h> 18 18 #include <linux/mtd/mtd.h> 19 19 #include <linux/mtd/map.h> ··· 27 27 #include <asm/mach/arch.h> 28 28 #include <asm/mach/time.h> 29 29 #include <asm/mach/map.h> 30 - #include <mach/gpio.h> 31 30 #include <mach/iomux-mx27.h> 32 31 33 32 #include "devices-imx27.h"
+2 -2
arch/arm/mach-ixp2000/core.c
··· 13 13 * License version 2. This program is licensed "as is" without any 14 14 * warranty of any kind, whether express or implied. 15 15 */ 16 - 16 + #include <linux/gpio.h> 17 17 #include <linux/kernel.h> 18 18 #include <linux/init.h> 19 19 #include <linux/spinlock.h> ··· 39 39 #include <asm/mach/time.h> 40 40 #include <asm/mach/irq.h> 41 41 42 - #include <mach/gpio.h> 42 + #include <mach/gpio-ixp2000.h> 43 43 44 44 static DEFINE_SPINLOCK(ixp2000_slowport_lock); 45 45 static unsigned long ixp2000_slowport_irq_flags;
+2 -2
arch/arm/mach-ixp2000/include/mach/gpio.h arch/arm/mach-ixp2000/include/mach/gpio-ixp2000.h
··· 3 3 * 4 4 * Copyright (C) 2002 Intel Corporation. 5 5 * 6 - * This program is free software, you can redistribute it and/or modify 6 + * This program is free software, you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License version 2 as 8 8 * published by the Free Software Foundation. 9 9 */ ··· 11 11 /* 12 12 * IXP2000 GPIO in/out, edge/level detection for IRQs: 13 13 * IRQs are generated on Falling-edge, Rising-Edge, Level-low, Level-High 14 - * or both Falling-edge and Rising-edge. 14 + * or both Falling-edge and Rising-edge. 15 15 * This must be called *before* the corresponding IRQ is registerd. 16 16 * Use this instead of directly setting the GPIO registers. 17 17 * GPIOs may also be used as GPIOs (e.g. for emulating i2c/smb)
+2 -2
arch/arm/mach-ixp2000/ixdp2x00.c
··· 14 14 * Free Software Foundation; either version 2 of the License, or (at your 15 15 * option) any later version. 16 16 */ 17 + #include <linux/gpio.h> 17 18 #include <linux/kernel.h> 18 19 #include <linux/init.h> 19 20 #include <linux/mm.h> ··· 41 40 #include <asm/mach/flash.h> 42 41 #include <asm/mach/arch.h> 43 42 44 - #include <mach/gpio.h> 45 - 43 + #include <mach/gpio-ixp2000.h> 46 44 47 45 /************************************************************************* 48 46 * IXDP2x00 IRQ Initialization
+1 -2
arch/arm/mach-ixp4xx/dsmg600-setup.c
··· 16 16 * Author: Rod Whitby <rod@whitby.id.au> 17 17 * Maintainers: http://www.nslu2-linux.org/ 18 18 */ 19 - 19 + #include <linux/gpio.h> 20 20 #include <linux/irq.h> 21 21 #include <linux/jiffies.h> 22 22 #include <linux/timer.h> ··· 31 31 #include <asm/mach/arch.h> 32 32 #include <asm/mach/flash.h> 33 33 #include <asm/mach/time.h> 34 - #include <asm/gpio.h> 35 34 36 35 #define DSMG600_SDA_PIN 5 37 36 #define DSMG600_SCL_PIN 4
+1 -2
arch/arm/mach-ixp4xx/fsg-setup.c
··· 14 14 * Maintainers: http://www.nslu2-linux.org/ 15 15 * 16 16 */ 17 - 17 + #include <linux/gpio.h> 18 18 #include <linux/if_ether.h> 19 19 #include <linux/irq.h> 20 20 #include <linux/serial.h> ··· 27 27 #include <asm/mach-types.h> 28 28 #include <asm/mach/arch.h> 29 29 #include <asm/mach/flash.h> 30 - #include <asm/gpio.h> 31 30 32 31 #define FSG_SDA_PIN 12 33 32 #define FSG_SCL_PIN 13
+3
arch/arm/mach-ixp4xx/include/mach/gpio.h
··· 28 28 #include <linux/kernel.h> 29 29 #include <mach/hardware.h> 30 30 31 + #define __ARM_GPIOLIB_COMPLEX 32 + 31 33 static inline int gpio_request(unsigned gpio, const char *label) 32 34 { 33 35 return 0; ··· 72 70 #include <asm-generic/gpio.h> /* cansleep wrappers */ 73 71 74 72 extern int gpio_to_irq(int gpio); 73 + #define gpio_to_irq gpio_to_irq 75 74 extern int irq_to_gpio(unsigned int irq); 76 75 77 76 #endif
+1 -2
arch/arm/mach-ixp4xx/nas100d-setup.c
··· 17 17 * Maintainers: http://www.nslu2-linux.org/ 18 18 * 19 19 */ 20 - 20 + #include <linux/gpio.h> 21 21 #include <linux/if_ether.h> 22 22 #include <linux/irq.h> 23 23 #include <linux/jiffies.h> ··· 32 32 #include <asm/mach-types.h> 33 33 #include <asm/mach/arch.h> 34 34 #include <asm/mach/flash.h> 35 - #include <asm/gpio.h> 36 35 37 36 #define NAS100D_SDA_PIN 5 38 37 #define NAS100D_SCL_PIN 6
+1 -2
arch/arm/mach-ixp4xx/nslu2-setup.c
··· 16 16 * Maintainers: http://www.nslu2-linux.org/ 17 17 * 18 18 */ 19 - 19 + #include <linux/gpio.h> 20 20 #include <linux/if_ether.h> 21 21 #include <linux/irq.h> 22 22 #include <linux/serial.h> ··· 30 30 #include <asm/mach/arch.h> 31 31 #include <asm/mach/flash.h> 32 32 #include <asm/mach/time.h> 33 - #include <asm/gpio.h> 34 33 35 34 #define NSLU2_SDA_PIN 7 36 35 #define NSLU2_SCL_PIN 6
+1 -2
arch/arm/mach-kirkwood/irq.c
··· 7 7 * License version 2. This program is licensed "as is" without any 8 8 * warranty of any kind, whether express or implied. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/init.h> 13 13 #include <linux/irq.h> 14 14 #include <linux/io.h> 15 15 #include <mach/bridge-regs.h> 16 16 #include <plat/irq.h> 17 - #include <asm/gpio.h> 18 17 #include "common.h" 19 18 20 19 static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+1 -2
arch/arm/mach-kirkwood/mpp.c
··· 7 7 * License version 2. This program is licensed "as is" without any 8 8 * warranty of any kind, whether express or implied. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/init.h> 13 13 #include <linux/mbus.h> 14 14 #include <linux/io.h> 15 - #include <asm/gpio.h> 16 15 #include <mach/hardware.h> 17 16 #include <plat/mpp.h> 18 17 #include "common.h"
+1 -1
arch/arm/mach-ks8695/Makefile
··· 3 3 # Makefile for KS8695 architecture support 4 4 # 5 5 6 - obj-y := cpu.o irq.o time.o gpio.o devices.o 6 + obj-y := cpu.o irq.o time.o devices.o 7 7 obj-m := 8 8 obj-n := 9 9 obj- :=
+2 -2
arch/arm/mach-ks8695/board-acs5k.c
··· 10 10 * it under the terms of the GNU General Public License version 2 as 11 11 * published by the Free Software Foundation. 12 12 */ 13 - 13 + #include <linux/gpio.h> 14 14 #include <linux/kernel.h> 15 15 #include <linux/types.h> 16 16 #include <linux/interrupt.h> ··· 34 34 #include <asm/mach/irq.h> 35 35 36 36 #include <mach/devices.h> 37 - #include <mach/gpio.h> 37 + #include <mach/gpio-ks8695.h> 38 38 39 39 #include "generic.h" 40 40
+2 -2
arch/arm/mach-ks8695/board-dsm320.c
··· 10 10 * it under the terms of the GNU General Public License version 2 as 11 11 * published by the Free Software Foundation. 12 12 */ 13 - 13 + #include <linux/gpio.h> 14 14 #include <linux/kernel.h> 15 15 #include <linux/types.h> 16 16 #include <linux/interrupt.h> ··· 29 29 #include <asm/mach/irq.h> 30 30 31 31 #include <mach/devices.h> 32 - #include <mach/gpio.h> 32 + #include <mach/gpio-ks8695.h> 33 33 34 34 #include "generic.h" 35 35
+2 -2
arch/arm/mach-ks8695/board-micrel.c
··· 5 5 * it under the terms of the GNU General Public License version 2 as 6 6 * published by the Free Software Foundation. 7 7 */ 8 - 8 + #include <linux/gpio.h> 9 9 #include <linux/kernel.h> 10 10 #include <linux/types.h> 11 11 #include <linux/interrupt.h> ··· 18 18 #include <asm/mach/map.h> 19 19 #include <asm/mach/irq.h> 20 20 21 - #include <mach/gpio.h> 21 + #include <mach/gpio-ks8695.h> 22 22 #include <mach/devices.h> 23 23 24 24 #include "generic.h"
+1
arch/arm/mach-ks8695/devices.c
··· 20 20 #include <asm/mach/arch.h> 21 21 #include <asm/mach/map.h> 22 22 23 + #include <linux/gpio.h> 23 24 #include <linux/platform_device.h> 24 25 25 26 #include <mach/irqs.h>
+2 -2
arch/arm/mach-ks8695/gpio.c drivers/gpio/gpio-ks8695.c
··· 18 18 * along with this program; if not, write to the Free Software 19 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 */ 21 - 21 + #include <linux/gpio.h> 22 22 #include <linux/kernel.h> 23 23 #include <linux/mm.h> 24 24 #include <linux/init.h> ··· 31 31 #include <asm/mach/irq.h> 32 32 33 33 #include <mach/regs-gpio.h> 34 - #include <mach/gpio.h> 34 + #include <mach/gpio-ks8695.h> 35 35 36 36 /* 37 37 * Configure a GPIO line for either GPIO function, or its internal
+39
arch/arm/mach-ks8695/include/mach/gpio-ks8695.h
··· 1 + /* 2 + * Copyright (C) 2006 Andrew Victor 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + 9 + #ifndef __MACH_KS8659_GPIO_H 10 + #define __MACH_KS8659_GPIO_H 11 + 12 + #include <linux/kernel.h> 13 + 14 + #define KS8695_GPIO_0 0 15 + #define KS8695_GPIO_1 1 16 + #define KS8695_GPIO_2 2 17 + #define KS8695_GPIO_3 3 18 + #define KS8695_GPIO_4 4 19 + #define KS8695_GPIO_5 5 20 + #define KS8695_GPIO_6 6 21 + #define KS8695_GPIO_7 7 22 + #define KS8695_GPIO_8 8 23 + #define KS8695_GPIO_9 9 24 + #define KS8695_GPIO_10 10 25 + #define KS8695_GPIO_11 11 26 + #define KS8695_GPIO_12 12 27 + #define KS8695_GPIO_13 13 28 + #define KS8695_GPIO_14 14 29 + #define KS8695_GPIO_15 15 30 + 31 + /* 32 + * Configure GPIO pin as external interrupt source. 33 + */ 34 + extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); 35 + 36 + /* Register the GPIOs */ 37 + extern void ks8695_register_gpios(void); 38 + 39 + #endif /* __MACH_KS8659_GPIO_H */
-38
arch/arm/mach-ks8695/include/mach/gpio.h
··· 11 11 #ifndef __ASM_ARCH_GPIO_H_ 12 12 #define __ASM_ARCH_GPIO_H_ 13 13 14 - #include <linux/kernel.h> 15 - 16 - #define KS8695_GPIO_0 0 17 - #define KS8695_GPIO_1 1 18 - #define KS8695_GPIO_2 2 19 - #define KS8695_GPIO_3 3 20 - #define KS8695_GPIO_4 4 21 - #define KS8695_GPIO_5 5 22 - #define KS8695_GPIO_6 6 23 - #define KS8695_GPIO_7 7 24 - #define KS8695_GPIO_8 8 25 - #define KS8695_GPIO_9 9 26 - #define KS8695_GPIO_10 10 27 - #define KS8695_GPIO_11 11 28 - #define KS8695_GPIO_12 12 29 - #define KS8695_GPIO_13 13 30 - #define KS8695_GPIO_14 14 31 - #define KS8695_GPIO_15 15 32 - 33 - /* 34 - * Configure GPIO pin as external interrupt source. 35 - */ 36 - extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); 37 - 38 14 /* 39 15 * Map IRQ number to GPIO line. 40 16 */ 41 17 extern int irq_to_gpio(unsigned int irq); 42 - 43 - #include <asm-generic/gpio.h> 44 - 45 - /* If it turns out that we need to optimise GPIO access for the 46 - * Micrel's GPIOs, then these can be changed to check their argument 47 - * directly as static inlines. However for now it's probably not 48 - * worthwhile. 49 - */ 50 - #define gpio_get_value __gpio_get_value 51 - #define gpio_set_value __gpio_set_value 52 - #define gpio_to_irq __gpio_to_irq 53 - 54 - /* Register the GPIOs */ 55 - extern void ks8695_register_gpios(void); 56 18 57 19 #endif
+2 -2
arch/arm/mach-ks8695/leds.c
··· 7 7 * it under the terms of the GNU General Public License version 2 as 8 8 * published by the Free Software Foundation. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/module.h> 13 13 #include <linux/init.h> 14 + #include <linux/gpio.h> 14 15 15 16 #include <asm/leds.h> 16 17 #include <mach/devices.h> 17 - #include <mach/gpio.h> 18 18 19 19 20 20 static inline void ks8695_led_on(unsigned int led)
+1 -1
arch/arm/mach-lpc32xx/Makefile
··· 3 3 # 4 4 5 5 obj-y := timer.o irq.o common.o serial.o clock.o 6 - obj-y += gpiolib.o pm.o suspend.o 6 + obj-y += pm.o suspend.o 7 7 obj-y += phy3250.o 8 8
+1 -1
arch/arm/mach-lpc32xx/gpiolib.c drivers/gpio/gpio-lpc32xx.c
··· 24 24 25 25 #include <mach/hardware.h> 26 26 #include <mach/platform.h> 27 - #include "common.h" 27 + #include <mach/gpio-lpc32xx.h> 28 28 29 29 #define LPC32XX_GPIO_P3_INP_STATE _GPREG(0x000) 30 30 #define LPC32XX_GPIO_P3_OUTP_SET _GPREG(0x004)
+50
arch/arm/mach-lpc32xx/include/mach/gpio-lpc32xx.h
··· 1 + /* 2 + * Author: Kevin Wells <kevin.wells@nxp.com> 3 + * 4 + * Copyright (C) 2010 NXP Semiconductors 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; either version 2 of the License, or 9 + * (at your option) any later version. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + */ 16 + 17 + #ifndef __MACH_GPIO_LPC32XX_H 18 + #define __MACH_GPIO_LPC32XX_H 19 + 20 + /* 21 + * Note! 22 + * Muxed GP pins need to be setup to the GP state in the board level 23 + * code prior to using this driver. 24 + * GPI pins : 28xP3 group 25 + * GPO pins : 24xP3 group 26 + * GPIO pins: 8xP0 group, 24xP1 group, 13xP2 group, 6xP3 group 27 + */ 28 + 29 + #define LPC32XX_GPIO_P0_MAX 8 30 + #define LPC32XX_GPIO_P1_MAX 24 31 + #define LPC32XX_GPIO_P2_MAX 13 32 + #define LPC32XX_GPIO_P3_MAX 6 33 + #define LPC32XX_GPI_P3_MAX 28 34 + #define LPC32XX_GPO_P3_MAX 24 35 + 36 + #define LPC32XX_GPIO_P0_GRP 0 37 + #define LPC32XX_GPIO_P1_GRP (LPC32XX_GPIO_P0_GRP + LPC32XX_GPIO_P0_MAX) 38 + #define LPC32XX_GPIO_P2_GRP (LPC32XX_GPIO_P1_GRP + LPC32XX_GPIO_P1_MAX) 39 + #define LPC32XX_GPIO_P3_GRP (LPC32XX_GPIO_P2_GRP + LPC32XX_GPIO_P2_MAX) 40 + #define LPC32XX_GPI_P3_GRP (LPC32XX_GPIO_P3_GRP + LPC32XX_GPIO_P3_MAX) 41 + #define LPC32XX_GPO_P3_GRP (LPC32XX_GPI_P3_GRP + LPC32XX_GPI_P3_MAX) 42 + 43 + /* 44 + * A specific GPIO can be selected with this macro 45 + * ie, GPIO_05 can be selected with LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5) 46 + * See the LPC32x0 User's guide for GPIO group numbers 47 + */ 48 + #define LPC32XX_GPIO(x, y) ((x) + (y)) 49 + 50 + #endif /* __MACH_GPIO_LPC32XX_H */
-74
arch/arm/mach-lpc32xx/include/mach/gpio.h
··· 1 - /* 2 - * arch/arm/mach-lpc32xx/include/mach/gpio.h 3 - * 4 - * Author: Kevin Wells <kevin.wells@nxp.com> 5 - * 6 - * Copyright (C) 2010 NXP Semiconductors 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License as published by 10 - * the Free Software Foundation; either version 2 of the License, or 11 - * (at your option) any later version. 12 - * 13 - * This program is distributed in the hope that it will be useful, 14 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 - * GNU General Public License for more details. 17 - */ 18 - 19 - #ifndef __ASM_ARCH_GPIO_H 20 - #define __ASM_ARCH_GPIO_H 21 - 22 - #include <asm-generic/gpio.h> 23 - 24 - /* 25 - * Note! 26 - * Muxed GP pins need to be setup to the GP state in the board level 27 - * code prior to using this driver. 28 - * GPI pins : 28xP3 group 29 - * GPO pins : 24xP3 group 30 - * GPIO pins: 8xP0 group, 24xP1 group, 13xP2 group, 6xP3 group 31 - */ 32 - 33 - #define LPC32XX_GPIO_P0_MAX 8 34 - #define LPC32XX_GPIO_P1_MAX 24 35 - #define LPC32XX_GPIO_P2_MAX 13 36 - #define LPC32XX_GPIO_P3_MAX 6 37 - #define LPC32XX_GPI_P3_MAX 28 38 - #define LPC32XX_GPO_P3_MAX 24 39 - 40 - #define LPC32XX_GPIO_P0_GRP 0 41 - #define LPC32XX_GPIO_P1_GRP (LPC32XX_GPIO_P0_GRP + LPC32XX_GPIO_P0_MAX) 42 - #define LPC32XX_GPIO_P2_GRP (LPC32XX_GPIO_P1_GRP + LPC32XX_GPIO_P1_MAX) 43 - #define LPC32XX_GPIO_P3_GRP (LPC32XX_GPIO_P2_GRP + LPC32XX_GPIO_P2_MAX) 44 - #define LPC32XX_GPI_P3_GRP (LPC32XX_GPIO_P3_GRP + LPC32XX_GPIO_P3_MAX) 45 - #define LPC32XX_GPO_P3_GRP (LPC32XX_GPI_P3_GRP + LPC32XX_GPI_P3_MAX) 46 - 47 - /* 48 - * A specific GPIO can be selected with this macro 49 - * ie, GPIO_05 can be selected with LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5) 50 - * See the LPC32x0 User's guide for GPIO group numbers 51 - */ 52 - #define LPC32XX_GPIO(x, y) ((x) + (y)) 53 - 54 - static inline int gpio_get_value(unsigned gpio) 55 - { 56 - return __gpio_get_value(gpio); 57 - } 58 - 59 - static inline void gpio_set_value(unsigned gpio, int value) 60 - { 61 - __gpio_set_value(gpio, value); 62 - } 63 - 64 - static inline int gpio_cansleep(unsigned gpio) 65 - { 66 - return __gpio_cansleep(gpio); 67 - } 68 - 69 - static inline int gpio_to_irq(unsigned gpio) 70 - { 71 - return __gpio_to_irq(gpio); 72 - } 73 - 74 - #endif
+1
arch/arm/mach-lpc32xx/phy3250.c
··· 37 37 38 38 #include <mach/hardware.h> 39 39 #include <mach/platform.h> 40 + #include <mach/gpio-lpc32xx.h> 40 41 #include "common.h" 41 42 42 43 /*
+2 -2
arch/arm/mach-mmp/aspenite.c
··· 8 8 * it under the terms of the GNU General Public License version 2 as 9 9 * publishhed by the Free Software Foundation. 10 10 */ 11 - 11 + #include <linux/gpio.h> 12 12 #include <linux/init.h> 13 13 #include <linux/kernel.h> 14 14 #include <linux/platform_device.h> ··· 17 17 #include <linux/mtd/partitions.h> 18 18 #include <linux/mtd/nand.h> 19 19 #include <linux/interrupt.h> 20 + #include <linux/gpio.h> 20 21 21 22 #include <asm/mach-types.h> 22 23 #include <asm/mach/arch.h> 23 24 #include <mach/addr-map.h> 24 25 #include <mach/mfp-pxa168.h> 25 26 #include <mach/pxa168.h> 26 - #include <mach/gpio.h> 27 27 #include <video/pxa168fb.h> 28 28 #include <linux/input.h> 29 29 #include <plat/pxa27x_keypad.h>
-1
arch/arm/mach-mmp/brownstone.c
··· 14 14 #include <linux/kernel.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/io.h> 17 - #include <linux/gpio.h> 18 17 #include <linux/regulator/machine.h> 19 18 #include <linux/regulator/max8649.h> 20 19 #include <linux/regulator/fixed.h>
+1 -1
arch/arm/mach-mmp/gplugd.c
··· 9 9 */ 10 10 11 11 #include <linux/init.h> 12 + #include <linux/gpio.h> 12 13 13 14 #include <asm/mach/arch.h> 14 15 #include <asm/mach-types.h> 15 16 16 - #include <mach/gpio.h> 17 17 #include <mach/pxa168.h> 18 18 #include <mach/mfp-pxa168.h> 19 19
+30
arch/arm/mach-mmp/include/mach/gpio-pxa.h
··· 1 + #ifndef __ASM_MACH_GPIO_PXA_H 2 + #define __ASM_MACH_GPIO_PXA_H 3 + 4 + #include <mach/addr-map.h> 5 + #include <mach/irqs.h> 6 + 7 + #define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000) 8 + 9 + #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) 10 + #define GPIO_REG(x) (*((volatile u32 *)(GPIO_REGS_VIRT + (x)))) 11 + 12 + #define NR_BUILTIN_GPIO IRQ_GPIO_NUM 13 + 14 + #define gpio_to_bank(gpio) ((gpio) >> 5) 15 + 16 + /* NOTE: these macros are defined here to make optimization of 17 + * gpio_{get,set}_value() to work when 'gpio' is a constant. 18 + * Usage of these macros otherwise is no longer recommended, 19 + * use generic GPIO API whenever possible. 20 + */ 21 + #define GPIO_bit(gpio) (1 << ((gpio) & 0x1f)) 22 + 23 + #define GPLR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x00) 24 + #define GPDR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x0c) 25 + #define GPSR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x18) 26 + #define GPCR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x24) 27 + 28 + #include <plat/gpio-pxa.h> 29 + 30 + #endif /* __ASM_MACH_GPIO_PXA_H */
-23
arch/arm/mach-mmp/include/mach/gpio.h
··· 1 1 #ifndef __ASM_MACH_GPIO_H 2 2 #define __ASM_MACH_GPIO_H 3 3 4 - #include <mach/addr-map.h> 5 - #include <mach/irqs.h> 6 4 #include <asm-generic/gpio.h> 7 5 8 - #define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000) 9 - 10 - #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) 11 - #define GPIO_REG(x) (*((volatile u32 *)(GPIO_REGS_VIRT + (x)))) 12 - 13 - #define NR_BUILTIN_GPIO IRQ_GPIO_NUM 14 - 15 - #define gpio_to_bank(gpio) ((gpio) >> 5) 16 6 #define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio)) 17 7 #define irq_to_gpio(irq) ((irq) - IRQ_GPIO_START) 18 8 19 - 20 9 #define __gpio_is_inverted(gpio) (0) 21 10 #define __gpio_is_occupied(gpio) (0) 22 - 23 - /* NOTE: these macros are defined here to make optimization of 24 - * gpio_{get,set}_value() to work when 'gpio' is a constant. 25 - * Usage of these macros otherwise is no longer recommended, 26 - * use generic GPIO API whenever possible. 27 - */ 28 - #define GPIO_bit(gpio) (1 << ((gpio) & 0x1f)) 29 - 30 - #define GPLR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x00) 31 - #define GPDR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x0c) 32 - #define GPSR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x18) 33 - #define GPCR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x24) 34 11 35 12 #include <plat/gpio.h> 36 13 #endif /* __ASM_MACH_GPIO_H */
-1
arch/arm/mach-mmp/jasper.c
··· 14 14 #include <linux/kernel.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/io.h> 17 - #include <linux/gpio.h> 18 17 #include <linux/regulator/machine.h> 19 18 #include <linux/regulator/max8649.h> 20 19 #include <linux/mfd/max8925.h>
+1 -2
arch/arm/mach-mmp/mmp2.c
··· 9 9 * it under the terms of the GNU General Public License version 2 as 10 10 * published by the Free Software Foundation. 11 11 */ 12 - 13 12 #include <linux/module.h> 14 13 #include <linux/kernel.h> 15 14 #include <linux/init.h> ··· 24 25 #include <mach/irqs.h> 25 26 #include <mach/dma.h> 26 27 #include <mach/mfp.h> 27 - #include <mach/gpio.h> 28 + #include <mach/gpio-pxa.h> 28 29 #include <mach/devices.h> 29 30 #include <mach/mmp2.h> 30 31
+1 -2
arch/arm/mach-mmp/pxa168.c
··· 7 7 * it under the terms of the GNU General Public License version 2 as 8 8 * published by the Free Software Foundation. 9 9 */ 10 - 11 10 #include <linux/module.h> 12 11 #include <linux/kernel.h> 13 12 #include <linux/init.h> ··· 20 21 #include <mach/regs-apbc.h> 21 22 #include <mach/regs-apmu.h> 22 23 #include <mach/irqs.h> 23 - #include <mach/gpio.h> 24 + #include <mach/gpio-pxa.h> 24 25 #include <mach/dma.h> 25 26 #include <mach/devices.h> 26 27 #include <mach/mfp.h>
+1 -2
arch/arm/mach-mmp/pxa910.c
··· 7 7 * it under the terms of the GNU General Public License version 2 as 8 8 * published by the Free Software Foundation. 9 9 */ 10 - 11 10 #include <linux/module.h> 12 11 #include <linux/kernel.h> 13 12 #include <linux/init.h> ··· 19 20 #include <mach/regs-apmu.h> 20 21 #include <mach/cputype.h> 21 22 #include <mach/irqs.h> 22 - #include <mach/gpio.h> 23 + #include <mach/gpio-pxa.h> 23 24 #include <mach/dma.h> 24 25 #include <mach/mfp.h> 25 26 #include <mach/devices.h>
+2 -2
arch/arm/mach-mmp/tavorevb.c
··· 7 7 * it under the terms of the GNU General Public License version 2 as 8 8 * publishhed by the Free Software Foundation. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/init.h> 12 12 #include <linux/kernel.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/smc91x.h> 15 + #include <linux/gpio.h> 15 16 16 17 #include <asm/mach-types.h> 17 18 #include <asm/mach/arch.h> 18 19 #include <mach/addr-map.h> 19 20 #include <mach/mfp-pxa910.h> 20 21 #include <mach/pxa910.h> 21 - #include <mach/gpio.h> 22 22 23 23 #include "common.h" 24 24
+1 -2
arch/arm/mach-msm/board-msm7x27.c
··· 13 13 * GNU General Public License for more details. 14 14 * 15 15 */ 16 - 16 + #include <linux/gpio.h> 17 17 #include <linux/kernel.h> 18 18 #include <linux/init.h> 19 19 #include <linux/platform_device.h> ··· 34 34 35 35 #include <mach/vreg.h> 36 36 #include <mach/mpp.h> 37 - #include <mach/gpio.h> 38 37 #include <mach/board.h> 39 38 #include <mach/msm_iomap.h> 40 39
+1 -2
arch/arm/mach-msm/board-msm7x30.c
··· 14 14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 15 15 * 02110-1301, USA. 16 16 */ 17 - 17 + #include <linux/gpio.h> 18 18 #include <linux/kernel.h> 19 19 #include <linux/irq.h> 20 20 #include <linux/gpio.h> ··· 30 30 #include <asm/memory.h> 31 31 #include <asm/setup.h> 32 32 33 - #include <mach/gpio.h> 34 33 #include <mach/board.h> 35 34 #include <mach/msm_iomap.h> 36 35 #include <mach/dma.h>
+1 -2
arch/arm/mach-msm/board-qsd8x50.c
··· 14 14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 15 15 * 02110-1301, USA. 16 16 */ 17 - 17 + #include <linux/gpio.h> 18 18 #include <linux/kernel.h> 19 19 #include <linux/irq.h> 20 20 #include <linux/gpio.h> ··· 32 32 #include <mach/board.h> 33 33 #include <mach/irqs.h> 34 34 #include <mach/sirc.h> 35 - #include <mach/gpio.h> 36 35 #include <mach/vreg.h> 37 36 #include <mach/mmc.h> 38 37
+1 -2
arch/arm/mach-msm/board-sapphire.c
··· 11 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 12 * GNU General Public License for more details. 13 13 */ 14 - 14 + #include <linux/gpio.h> 15 15 #include <linux/kernel.h> 16 16 #include <linux/init.h> 17 17 #include <linux/platform_device.h> ··· 22 22 23 23 #include <linux/delay.h> 24 24 25 - #include <asm/gpio.h> 26 25 #include <mach/hardware.h> 27 26 #include <asm/mach-types.h> 28 27 #include <asm/mach/arch.h>
+1 -2
arch/arm/mach-msm/board-trout-mmc.c
··· 1 1 /* linux/arch/arm/mach-msm/board-trout-mmc.c 2 2 ** Author: Brian Swetland <swetland@google.com> 3 3 */ 4 - 4 + #include <linux/gpio.h> 5 5 #include <linux/kernel.h> 6 6 #include <linux/init.h> 7 7 #include <linux/platform_device.h> ··· 11 11 #include <linux/err.h> 12 12 #include <linux/debugfs.h> 13 13 14 - #include <asm/gpio.h> 15 14 #include <asm/io.h> 16 15 17 16 #include <mach/vreg.h>
+1 -2
arch/arm/mach-msm/board-trout-panel.c
··· 1 1 /* linux/arch/arm/mach-msm/board-trout-mddi.c 2 2 ** Author: Brian Swetland <swetland@google.com> 3 3 */ 4 - 4 + #include <linux/gpio.h> 5 5 #include <linux/kernel.h> 6 6 #include <linux/init.h> 7 7 #include <linux/platform_device.h> ··· 11 11 #include <linux/err.h> 12 12 13 13 #include <asm/io.h> 14 - #include <asm/gpio.h> 15 14 #include <asm/mach-types.h> 16 15 17 16 #include <mach/msm_fb.h>
+1 -26
arch/arm/mach-msm/include/mach/gpio.h
··· 1 - /* 2 - * Copyright (C) 2007 Google, Inc. 3 - * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved. 4 - * Author: Mike Lockwood <lockwood@android.com> 5 - * 6 - * This software is licensed under the terms of the GNU General Public 7 - * License version 2, as published by the Free Software Foundation, and 8 - * may be copied, distributed, and modified under those terms. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 16 - #ifndef __ASM_ARCH_MSM_GPIO_H 17 - #define __ASM_ARCH_MSM_GPIO_H 18 - 19 - #include <asm-generic/gpio.h> 20 - 21 - #define gpio_get_value __gpio_get_value 22 - #define gpio_set_value __gpio_set_value 23 - #define gpio_cansleep __gpio_cansleep 24 - #define gpio_to_irq __gpio_to_irq 25 - 26 - #endif /* __ASM_ARCH_MSM_GPIO_H */ 1 + /* empty */
+1 -2
arch/arm/mach-mv78xx0/irq.c
··· 7 7 * License version 2. This program is licensed "as is" without any 8 8 * warranty of any kind, whether express or implied. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/init.h> 13 13 #include <linux/pci.h> 14 14 #include <linux/irq.h> 15 - #include <asm/gpio.h> 16 15 #include <mach/bridge-regs.h> 17 16 #include <plat/irq.h> 18 17 #include "common.h"
+1 -2
arch/arm/mach-mv78xx0/mpp.c
··· 7 7 * License version 2. This program is licensed "as is" without any 8 8 * warranty of any kind, whether express or implied. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/init.h> 13 13 #include <linux/mbus.h> 14 14 #include <linux/io.h> 15 15 #include <plat/mpp.h> 16 - #include <asm/gpio.h> 17 16 #include <mach/hardware.h> 18 17 #include "common.h" 19 18 #include "mpp.h"
+1 -31
arch/arm/mach-mxs/include/mach/gpio.h
··· 1 - /* 2 - * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. 3 - * Copyright 2008 Juergen Beisert, kernel@pengutronix.de 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * This program is distributed in the hope that it will be useful, 10 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 - * GNU General Public License for more details. 13 - * 14 - * You should have received a copy of the GNU General Public License 15 - * along with this program; if not, write to the Free Software 16 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 - * MA 02110-1301, USA. 18 - */ 19 - 20 - #ifndef __MACH_MXS_GPIO_H__ 21 - #define __MACH_MXS_GPIO_H__ 22 - 23 - #include <asm-generic/gpio.h> 24 - 25 - /* use gpiolib dispatchers */ 26 - #define gpio_get_value __gpio_get_value 27 - #define gpio_set_value __gpio_set_value 28 - #define gpio_cansleep __gpio_cansleep 29 - #define gpio_to_irq __gpio_to_irq 30 - 31 - #endif /* __MACH_MXS_GPIO_H__ */ 1 + /* empty */
+1
arch/arm/mach-nomadik/board-nhk8815.c
··· 27 27 #include <asm/mach/irq.h> 28 28 #include <asm/mach/flash.h> 29 29 30 + #include <plat/gpio-nomadik.h> 30 31 #include <plat/mtu.h> 31 32 32 33 #include <mach/setup.h>
+1 -1
arch/arm/mach-nomadik/cpu-8815.c
··· 21 21 #include <linux/device.h> 22 22 #include <linux/amba/bus.h> 23 23 #include <linux/platform_device.h> 24 - #include <linux/gpio.h> 25 24 25 + #include <plat/gpio-nomadik.h> 26 26 #include <mach/hardware.h> 27 27 #include <mach/irqs.h> 28 28 #include <asm/mach/map.h>
+1 -1
arch/arm/mach-nomadik/i2c-8815nhk.c
··· 3 3 #include <linux/i2c.h> 4 4 #include <linux/i2c-algo-bit.h> 5 5 #include <linux/i2c-gpio.h> 6 - #include <linux/gpio.h> 7 6 #include <linux/platform_device.h> 7 + #include <plat/gpio-nomadik.h> 8 8 9 9 /* 10 10 * There are two busses in the 8815NHK.
-2
arch/arm/mach-nomadik/include/mach/gpio.h
··· 1 1 #ifndef __ASM_ARCH_GPIO_H 2 2 #define __ASM_ARCH_GPIO_H 3 3 4 - #include <plat/gpio.h> 5 - 6 4 #endif /* __ASM_ARCH_GPIO_H */
+1 -2
arch/arm/mach-omap1/board-ams-delta.c
··· 11 11 * it under the terms of the GNU General Public License version 2 as 12 12 * published by the Free Software Foundation. 13 13 */ 14 - 14 + #include <linux/gpio.h> 15 15 #include <linux/kernel.h> 16 16 #include <linux/init.h> 17 17 #include <linux/input.h> ··· 30 30 31 31 #include <plat/io.h> 32 32 #include <plat/board-ams-delta.h> 33 - #include <mach/gpio.h> 34 33 #include <plat/keypad.h> 35 34 #include <plat/mux.h> 36 35 #include <plat/usb.h>
+1 -2
arch/arm/mach-omap1/board-fsample.c
··· 10 10 * it under the terms of the GNU General Public License version 2 as 11 11 * published by the Free Software Foundation. 12 12 */ 13 - 13 + #include <linux/gpio.h> 14 14 #include <linux/kernel.h> 15 15 #include <linux/init.h> 16 16 #include <linux/platform_device.h> ··· 28 28 #include <asm/mach/map.h> 29 29 30 30 #include <plat/tc.h> 31 - #include <mach/gpio.h> 32 31 #include <plat/mux.h> 33 32 #include <plat/flash.h> 34 33 #include <plat/fpga.h>
+1 -2
arch/arm/mach-omap1/board-generic.c
··· 12 12 * it under the terms of the GNU General Public License version 2 as 13 13 * published by the Free Software Foundation. 14 14 */ 15 - 15 + #include <linux/gpio.h> 16 16 #include <linux/kernel.h> 17 17 #include <linux/init.h> 18 18 #include <linux/platform_device.h> ··· 22 22 #include <asm/mach/arch.h> 23 23 #include <asm/mach/map.h> 24 24 25 - #include <mach/gpio.h> 26 25 #include <plat/mux.h> 27 26 #include <plat/usb.h> 28 27 #include <plat/board.h>
+1 -2
arch/arm/mach-omap1/board-h2-mmc.c
··· 11 11 * it under the terms of the GNU General Public License version 2 as 12 12 * published by the Free Software Foundation. 13 13 */ 14 - 14 + #include <linux/gpio.h> 15 15 #include <linux/platform_device.h> 16 16 17 17 #include <linux/i2c/tps65010.h> 18 18 19 19 #include <plat/mmc.h> 20 - #include <mach/gpio.h> 21 20 22 21 #include "board-h2.h" 23 22
+1 -2
arch/arm/mach-omap1/board-h2.c
··· 18 18 * it under the terms of the GNU General Public License version 2 as 19 19 * published by the Free Software Foundation. 20 20 */ 21 - 21 + #include <linux/gpio.h> 22 22 #include <linux/kernel.h> 23 23 #include <linux/platform_device.h> 24 24 #include <linux/delay.h> ··· 32 32 #include <linux/smc91x.h> 33 33 34 34 #include <mach/hardware.h> 35 - #include <asm/gpio.h> 36 35 37 36 #include <asm/mach-types.h> 38 37 #include <asm/mach/arch.h>
+1 -2
arch/arm/mach-omap1/board-h3-mmc.c
··· 11 11 * it under the terms of the GNU General Public License version 2 as 12 12 * published by the Free Software Foundation. 13 13 */ 14 - 14 + #include <linux/gpio.h> 15 15 #include <linux/platform_device.h> 16 16 17 17 #include <linux/i2c/tps65010.h> 18 18 19 19 #include <plat/mmc.h> 20 - #include <mach/gpio.h> 21 20 22 21 #include "board-h3.h" 23 22
+1 -2
arch/arm/mach-omap1/board-h3.c
··· 13 13 * it under the terms of the GNU General Public License version 2 as 14 14 * published by the Free Software Foundation. 15 15 */ 16 - 16 + #include <linux/gpio.h> 17 17 #include <linux/types.h> 18 18 #include <linux/init.h> 19 19 #include <linux/major.h> ··· 34 34 #include <asm/setup.h> 35 35 #include <asm/page.h> 36 36 #include <mach/hardware.h> 37 - #include <asm/gpio.h> 38 37 39 38 #include <asm/mach-types.h> 40 39 #include <asm/mach/arch.h>
-1
arch/arm/mach-omap1/board-htcherald.c
··· 23 23 * 02110-1301, USA. 24 24 * 25 25 */ 26 - 27 26 #include <linux/kernel.h> 28 27 #include <linux/init.h> 29 28 #include <linux/platform_device.h>
+1 -2
arch/arm/mach-omap1/board-innovator.c
··· 15 15 * it under the terms of the GNU General Public License version 2 as 16 16 * published by the Free Software Foundation. 17 17 */ 18 - 18 + #include <linux/gpio.h> 19 19 #include <linux/kernel.h> 20 20 #include <linux/init.h> 21 21 #include <linux/platform_device.h> ··· 34 34 #include <plat/mux.h> 35 35 #include <plat/flash.h> 36 36 #include <plat/fpga.h> 37 - #include <mach/gpio.h> 38 37 #include <plat/tc.h> 39 38 #include <plat/usb.h> 40 39 #include <plat/keypad.h>
+1 -2
arch/arm/mach-omap1/board-nokia770.c
··· 7 7 * it under the terms of the GNU General Public License version 2 as 8 8 * published by the Free Software Foundation. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/init.h> 13 13 #include <linux/mutex.h> ··· 26 26 #include <asm/mach/arch.h> 27 27 #include <asm/mach/map.h> 28 28 29 - #include <mach/gpio.h> 30 29 #include <plat/mux.h> 31 30 #include <plat/usb.h> 32 31 #include <plat/board.h>
+1 -2
arch/arm/mach-omap1/board-osk.c
··· 25 25 * with this program; if not, write to the Free Software Foundation, Inc., 26 26 * 675 Mass Ave, Cambridge, MA 02139, USA. 27 27 */ 28 - 28 + #include <linux/gpio.h> 29 29 #include <linux/kernel.h> 30 30 #include <linux/init.h> 31 31 #include <linux/platform_device.h> ··· 42 42 #include <linux/i2c/tps65010.h> 43 43 44 44 #include <mach/hardware.h> 45 - #include <asm/gpio.h> 46 45 47 46 #include <asm/mach-types.h> 48 47 #include <asm/mach/arch.h>
+1 -2
arch/arm/mach-omap1/board-palmte.c
··· 16 16 * it under the terms of the GNU General Public License version 2 as 17 17 * published by the Free Software Foundation. 18 18 */ 19 - 19 + #include <linux/gpio.h> 20 20 #include <linux/kernel.h> 21 21 #include <linux/init.h> 22 22 #include <linux/input.h> ··· 33 33 #include <asm/mach/arch.h> 34 34 #include <asm/mach/map.h> 35 35 36 - #include <mach/gpio.h> 37 36 #include <plat/flash.h> 38 37 #include <plat/mux.h> 39 38 #include <plat/usb.h>
+1 -1
arch/arm/mach-omap1/board-palmtt.c
··· 12 12 */ 13 13 14 14 #include <linux/delay.h> 15 + #include <linux/gpio.h> 15 16 #include <linux/kernel.h> 16 17 #include <linux/init.h> 17 18 #include <linux/platform_device.h> ··· 31 30 #include <asm/mach/map.h> 32 31 33 32 #include <plat/led.h> 34 - #include <mach/gpio.h> 35 33 #include <plat/flash.h> 36 34 #include <plat/mux.h> 37 35 #include <plat/usb.h>
+1 -1
arch/arm/mach-omap1/board-palmz71.c
··· 15 15 */ 16 16 17 17 #include <linux/delay.h> 18 + #include <linux/gpio.h> 18 19 #include <linux/kernel.h> 19 20 #include <linux/init.h> 20 21 #include <linux/platform_device.h> ··· 33 32 #include <asm/mach/arch.h> 34 33 #include <asm/mach/map.h> 35 34 36 - #include <mach/gpio.h> 37 35 #include <plat/flash.h> 38 36 #include <plat/mux.h> 39 37 #include <plat/usb.h>
+1 -2
arch/arm/mach-omap1/board-perseus2.c
··· 10 10 * it under the terms of the GNU General Public License version 2 as 11 11 * published by the Free Software Foundation. 12 12 */ 13 - 13 + #include <linux/gpio.h> 14 14 #include <linux/kernel.h> 15 15 #include <linux/init.h> 16 16 #include <linux/platform_device.h> ··· 28 28 #include <asm/mach/map.h> 29 29 30 30 #include <plat/tc.h> 31 - #include <mach/gpio.h> 32 31 #include <plat/mux.h> 33 32 #include <plat/fpga.h> 34 33 #include <plat/flash.h>
+1 -1
arch/arm/mach-omap1/board-sx1-mmc.c
··· 12 12 * published by the Free Software Foundation. 13 13 */ 14 14 15 + #include <linux/gpio.h> 15 16 #include <linux/platform_device.h> 16 17 17 18 #include <mach/hardware.h> 18 19 #include <plat/mmc.h> 19 - #include <mach/gpio.h> 20 20 #include <plat/board-sx1.h> 21 21 22 22 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
+1 -2
arch/arm/mach-omap1/board-sx1.c
··· 14 14 * it under the terms of the GNU General Public License version 2 as 15 15 * published by the Free Software Foundation. 16 16 */ 17 - 17 + #include <linux/gpio.h> 18 18 #include <linux/kernel.h> 19 19 #include <linux/init.h> 20 20 #include <linux/input.h> ··· 32 32 #include <asm/mach/arch.h> 33 33 #include <asm/mach/map.h> 34 34 35 - #include <mach/gpio.h> 36 35 #include <plat/flash.h> 37 36 #include <plat/mux.h> 38 37 #include <plat/dma.h>
+1 -1
arch/arm/mach-omap1/board-voiceblue.c
··· 13 13 */ 14 14 15 15 #include <linux/delay.h> 16 + #include <linux/gpio.h> 16 17 #include <linux/platform_device.h> 17 18 #include <linux/interrupt.h> 18 19 #include <linux/irq.h> ··· 34 33 35 34 #include <plat/board-voiceblue.h> 36 35 #include <plat/common.h> 37 - #include <mach/gpio.h> 38 36 #include <plat/flash.h> 39 37 #include <plat/mux.h> 40 38 #include <plat/tc.h>
+1 -1
arch/arm/mach-omap1/devices.c
··· 10 10 */ 11 11 12 12 #include <linux/dma-mapping.h> 13 + #include <linux/gpio.h> 13 14 #include <linux/module.h> 14 15 #include <linux/kernel.h> 15 16 #include <linux/init.h> ··· 25 24 #include <plat/tc.h> 26 25 #include <plat/board.h> 27 26 #include <plat/mux.h> 28 - #include <mach/gpio.h> 29 27 #include <plat/mmc.h> 30 28 #include <plat/omap7xx.h> 31 29 #include <plat/mcbsp.h>
+1 -1
arch/arm/mach-omap1/fpga.c
··· 17 17 */ 18 18 19 19 #include <linux/types.h> 20 + #include <linux/gpio.h> 20 21 #include <linux/init.h> 21 22 #include <linux/kernel.h> 22 23 #include <linux/device.h> ··· 29 28 #include <asm/mach/irq.h> 30 29 31 30 #include <plat/fpga.h> 32 - #include <mach/gpio.h> 33 31 34 32 static void fpga_mask_irq(struct irq_data *d) 35 33 {
+1 -2
arch/arm/mach-omap1/irq.c
··· 35 35 * with this program; if not, write to the Free Software Foundation, Inc., 36 36 * 675 Mass Ave, Cambridge, MA 02139, USA. 37 37 */ 38 - 38 + #include <linux/gpio.h> 39 39 #include <linux/init.h> 40 40 #include <linux/module.h> 41 41 #include <linux/sched.h> ··· 45 45 #include <mach/hardware.h> 46 46 #include <asm/irq.h> 47 47 #include <asm/mach/irq.h> 48 - #include <mach/gpio.h> 49 48 #include <plat/cpu.h> 50 49 51 50 #define IRQ_BANK(irq) ((irq) >> 5)
+1 -1
arch/arm/mach-omap1/leds-h2p2-debug.c
··· 9 9 * The "surfer" expansion board and H2 sample board also have two-color 10 10 * green+red LEDs (in parallel), used here for timer and idle indicators. 11 11 */ 12 + #include <linux/gpio.h> 12 13 #include <linux/init.h> 13 14 #include <linux/kernel_stat.h> 14 15 #include <linux/sched.h> ··· 21 20 #include <asm/mach-types.h> 22 21 23 22 #include <plat/fpga.h> 24 - #include <mach/gpio.h> 25 23 26 24 #include "leds.h" 27 25
+1 -2
arch/arm/mach-omap1/leds-osk.c
··· 3 3 * 4 4 * LED driver for OSK with optional Mistral QVGA board 5 5 */ 6 + #include <linux/gpio.h> 6 7 #include <linux/init.h> 7 8 8 9 #include <mach/hardware.h> 9 10 #include <asm/leds.h> 10 11 #include <asm/system.h> 11 - 12 - #include <mach/gpio.h> 13 12 14 13 #include "leds.h" 15 14
+1 -1
arch/arm/mach-omap1/leds.c
··· 3 3 * 4 4 * OMAP LEDs dispatcher 5 5 */ 6 + #include <linux/gpio.h> 6 7 #include <linux/kernel.h> 7 8 #include <linux/init.h> 8 9 9 10 #include <asm/leds.h> 10 11 #include <asm/mach-types.h> 11 12 12 - #include <mach/gpio.h> 13 13 #include <plat/mux.h> 14 14 15 15 #include "leds.h"
+1 -2
arch/arm/mach-omap1/serial.c
··· 7 7 * it under the terms of the GNU General Public License version 2 as 8 8 * published by the Free Software Foundation. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/module.h> 12 12 #include <linux/kernel.h> 13 13 #include <linux/init.h> ··· 24 24 25 25 #include <plat/board.h> 26 26 #include <plat/mux.h> 27 - #include <mach/gpio.h> 28 27 #include <plat/fpga.h> 29 28 30 29 #include "pm.h"
+1 -2
arch/arm/mach-omap2/board-generic.c
··· 15 15 * it under the terms of the GNU General Public License version 2 as 16 16 * published by the Free Software Foundation. 17 17 */ 18 - 18 + #include <linux/gpio.h> 19 19 #include <linux/kernel.h> 20 20 #include <linux/init.h> 21 21 #include <linux/device.h> ··· 25 25 #include <asm/mach/arch.h> 26 26 #include <asm/mach/map.h> 27 27 28 - #include <mach/gpio.h> 29 28 #include <plat/usb.h> 30 29 #include <plat/board.h> 31 30 #include <plat/common.h>
+1 -2
arch/arm/mach-omap2/board-h4.c
··· 10 10 * it under the terms of the GNU General Public License version 2 as 11 11 * published by the Free Software Foundation. 12 12 */ 13 - 13 + #include <linux/gpio.h> 14 14 #include <linux/kernel.h> 15 15 #include <linux/init.h> 16 16 #include <linux/platform_device.h> ··· 31 31 #include <asm/mach/arch.h> 32 32 #include <asm/mach/map.h> 33 33 34 - #include <mach/gpio.h> 35 34 #include <plat/usb.h> 36 35 #include <plat/board.h> 37 36 #include <plat/common.h>
+1 -2
arch/arm/mach-omap2/board-ldp.c
··· 10 10 * it under the terms of the GNU General Public License version 2 as 11 11 * published by the Free Software Foundation. 12 12 */ 13 - 13 + #include <linux/gpio.h> 14 14 #include <linux/kernel.h> 15 15 #include <linux/init.h> 16 16 #include <linux/platform_device.h> ··· 34 34 #include <asm/mach/map.h> 35 35 36 36 #include <plat/mcspi.h> 37 - #include <mach/gpio.h> 38 37 #include <plat/board.h> 39 38 #include <plat/common.h> 40 39 #include <plat/gpmc.h>
+1 -2
arch/arm/mach-omap2/devices.c
··· 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 10 */ 11 - 11 + #include <linux/gpio.h> 12 12 #include <linux/kernel.h> 13 13 #include <linux/init.h> 14 14 #include <linux/platform_device.h> ··· 26 26 #include <plat/tc.h> 27 27 #include <plat/board.h> 28 28 #include <plat/mcbsp.h> 29 - #include <mach/gpio.h> 30 29 #include <plat/mmc.h> 31 30 #include <plat/dma.h> 32 31 #include <plat/omap_hwmod.h>
+1 -2
arch/arm/mach-orion5x/db88f5281-setup.c
··· 9 9 * License version 2. This program is licensed "as is" without any 10 10 * warranty of any kind, whether express or implied. 11 11 */ 12 - 12 + #include <linux/gpio.h> 13 13 #include <linux/kernel.h> 14 14 #include <linux/init.h> 15 15 #include <linux/platform_device.h> ··· 21 21 #include <linux/mv643xx_eth.h> 22 22 #include <linux/i2c.h> 23 23 #include <asm/mach-types.h> 24 - #include <asm/gpio.h> 25 24 #include <asm/mach/arch.h> 26 25 #include <asm/mach/pci.h> 27 26 #include <mach/orion5x.h>
+1 -2
arch/arm/mach-orion5x/dns323-setup.c
··· 13 13 * License, or (at your option) any later version. 14 14 * 15 15 */ 16 - 16 + #include <linux/gpio.h> 17 17 #include <linux/kernel.h> 18 18 #include <linux/init.h> 19 19 #include <linux/delay.h> ··· 30 30 #include <linux/phy.h> 31 31 #include <linux/marvell_phy.h> 32 32 #include <asm/mach-types.h> 33 - #include <asm/gpio.h> 34 33 #include <asm/mach/arch.h> 35 34 #include <asm/mach/pci.h> 36 35 #include <mach/orion5x.h>
+1 -2
arch/arm/mach-orion5x/irq.c
··· 9 9 * License version 2. This program is licensed "as is" without any 10 10 * warranty of any kind, whether express or implied. 11 11 */ 12 - 12 + #include <linux/gpio.h> 13 13 #include <linux/kernel.h> 14 14 #include <linux/init.h> 15 15 #include <linux/irq.h> 16 16 #include <linux/io.h> 17 - #include <asm/gpio.h> 18 17 #include <mach/bridge-regs.h> 19 18 #include <plat/irq.h> 20 19 #include "common.h"
+1 -2
arch/arm/mach-orion5x/kurobox_pro-setup.c
··· 7 7 * License version 2. This program is licensed "as is" without any 8 8 * warranty of any kind, whether express or implied. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/init.h> 13 13 #include <linux/platform_device.h> ··· 21 21 #include <linux/serial_reg.h> 22 22 #include <linux/ata_platform.h> 23 23 #include <asm/mach-types.h> 24 - #include <asm/gpio.h> 25 24 #include <asm/mach/arch.h> 26 25 #include <asm/mach/pci.h> 27 26 #include <mach/orion5x.h>
+1 -2
arch/arm/mach-orion5x/mv2120-setup.c
··· 7 7 * published by the Free Software Foundation; either version 2 of the 8 8 * License, or (at your option) any later version. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/init.h> 13 13 #include <linux/platform_device.h> ··· 20 20 #include <linux/i2c.h> 21 21 #include <linux/ata_platform.h> 22 22 #include <asm/mach-types.h> 23 - #include <asm/gpio.h> 24 23 #include <asm/mach/arch.h> 25 24 #include <mach/orion5x.h> 26 25 #include "common.h"
+1 -2
arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
··· 7 7 * License version 2. This program is licensed "as is" without any 8 8 * warranty of any kind, whether express or implied. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/init.h> 13 13 #include <linux/platform_device.h> ··· 18 18 #include <linux/ethtool.h> 19 19 #include <net/dsa.h> 20 20 #include <asm/mach-types.h> 21 - #include <asm/gpio.h> 22 21 #include <asm/leds.h> 23 22 #include <asm/mach/arch.h> 24 23 #include <asm/mach/pci.h>
+1 -2
arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
··· 7 7 * License version 2. This program is licensed "as is" without any 8 8 * warranty of any kind, whether express or implied. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/init.h> 13 13 #include <linux/platform_device.h> ··· 19 19 #include <linux/i2c.h> 20 20 #include <net/dsa.h> 21 21 #include <asm/mach-types.h> 22 - #include <asm/gpio.h> 23 22 #include <asm/leds.h> 24 23 #include <asm/mach/arch.h> 25 24 #include <asm/mach/pci.h>
+1 -2
arch/arm/mach-orion5x/rd88f5182-setup.c
··· 9 9 * License version 2. This program is licensed "as is" without any 10 10 * warranty of any kind, whether express or implied. 11 11 */ 12 - 12 + #include <linux/gpio.h> 13 13 #include <linux/kernel.h> 14 14 #include <linux/init.h> 15 15 #include <linux/platform_device.h> ··· 20 20 #include <linux/ata_platform.h> 21 21 #include <linux/i2c.h> 22 22 #include <asm/mach-types.h> 23 - #include <asm/gpio.h> 24 23 #include <asm/leds.h> 25 24 #include <asm/mach/arch.h> 26 25 #include <asm/mach/pci.h>
+1 -2
arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
··· 7 7 * License version 2. This program is licensed "as is" without any 8 8 * warranty of any kind, whether express or implied. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/init.h> 13 13 #include <linux/platform_device.h> ··· 21 21 #include <linux/ethtool.h> 22 22 #include <net/dsa.h> 23 23 #include <asm/mach-types.h> 24 - #include <asm/gpio.h> 25 24 #include <asm/leds.h> 26 25 #include <asm/mach/arch.h> 27 26 #include <asm/mach/pci.h>
+1 -2
arch/arm/mach-orion5x/terastation_pro2-setup.c
··· 8 8 * as published by the Free Software Foundation; either version 9 9 * 2 of the License, or (at your option) any later version. 10 10 */ 11 - 11 + #include <linux/gpio.h> 12 12 #include <linux/kernel.h> 13 13 #include <linux/init.h> 14 14 #include <linux/platform_device.h> ··· 20 20 #include <linux/i2c.h> 21 21 #include <linux/serial_reg.h> 22 22 #include <asm/mach-types.h> 23 - #include <asm/gpio.h> 24 23 #include <asm/mach/arch.h> 25 24 #include <asm/mach/pci.h> 26 25 #include <mach/orion5x.h>
+1 -2
arch/arm/mach-orion5x/ts209-setup.c
··· 8 8 * as published by the Free Software Foundation; either version 9 9 * 2 of the License, or (at your option) any later version. 10 10 */ 11 - 11 + #include <linux/gpio.h> 12 12 #include <linux/kernel.h> 13 13 #include <linux/init.h> 14 14 #include <linux/platform_device.h> ··· 23 23 #include <linux/serial_reg.h> 24 24 #include <linux/ata_platform.h> 25 25 #include <asm/mach-types.h> 26 - #include <asm/gpio.h> 27 26 #include <asm/mach/arch.h> 28 27 #include <asm/mach/pci.h> 29 28 #include <mach/orion5x.h>
+1 -2
arch/arm/mach-orion5x/ts409-setup.c
··· 11 11 * as published by the Free Software Foundation; either version 12 12 * 2 of the License, or (at your option) any later version. 13 13 */ 14 - 14 + #include <linux/gpio.h> 15 15 #include <linux/kernel.h> 16 16 #include <linux/init.h> 17 17 #include <linux/platform_device.h> ··· 25 25 #include <linux/i2c.h> 26 26 #include <linux/serial_reg.h> 27 27 #include <asm/mach-types.h> 28 - #include <asm/gpio.h> 29 28 #include <asm/mach/arch.h> 30 29 #include <asm/mach/pci.h> 31 30 #include <mach/orion5x.h>
+1 -2
arch/arm/mach-orion5x/wnr854t-setup.c
··· 5 5 * License version 2. This program is licensed "as is" without any 6 6 * warranty of any kind, whether express or implied. 7 7 */ 8 - 8 + #include <linux/gpio.h> 9 9 #include <linux/kernel.h> 10 10 #include <linux/init.h> 11 11 #include <linux/platform_device.h> ··· 17 17 #include <linux/ethtool.h> 18 18 #include <net/dsa.h> 19 19 #include <asm/mach-types.h> 20 - #include <asm/gpio.h> 21 20 #include <asm/mach/arch.h> 22 21 #include <asm/mach/pci.h> 23 22 #include <mach/orion5x.h>
+1 -2
arch/arm/mach-orion5x/wrt350n-v2-setup.c
··· 5 5 * License version 2. This program is licensed "as is" without any 6 6 * warranty of any kind, whether express or implied. 7 7 */ 8 - 8 + #include <linux/gpio.h> 9 9 #include <linux/kernel.h> 10 10 #include <linux/init.h> 11 11 #include <linux/platform_device.h> ··· 20 20 #include <linux/input.h> 21 21 #include <net/dsa.h> 22 22 #include <asm/mach-types.h> 23 - #include <asm/gpio.h> 24 23 #include <asm/mach/arch.h> 25 24 #include <asm/mach/pci.h> 26 25 #include <mach/orion5x.h>
+1 -2
arch/arm/mach-pnx4008/gpio.c
··· 13 13 * is licensed "as is" without any warranty of any kind, whether express 14 14 * or implied. 15 15 */ 16 - 17 16 #include <linux/types.h> 18 17 #include <linux/kernel.h> 19 18 #include <linux/module.h> 20 19 #include <linux/io.h> 21 20 #include <mach/hardware.h> 22 21 #include <mach/platform.h> 23 - #include <mach/gpio.h> 22 + #include <mach/gpio-pnx4008.h> 24 23 25 24 /* register definitions */ 26 25 #define PIO_VA_BASE IO_ADDRESS(PNX4008_PIO_BASE)
+1 -1
arch/arm/mach-pnx4008/include/mach/gpio.h arch/arm/mach-pnx4008/include/mach/gpio-pnx4008.h
··· 1 1 /* 2 - * arch/arm/mach-pnx4008/include/mach/gpio.h 2 + * arch/arm/mach-pnx4008/include/mach/gpio-pnx4008.h 3 3 * 4 4 * PNX4008 GPIO driver - header file 5 5 *
+1 -2
arch/arm/mach-pnx4008/serial.c
··· 9 9 * it under the terms of the GNU General Public License version 2 as 10 10 * published by the Free Software Foundation. 11 11 */ 12 - 13 12 #include <linux/kernel.h> 14 13 #include <linux/types.h> 15 14 #include <linux/io.h> ··· 18 19 19 20 #include <linux/serial_core.h> 20 21 #include <linux/serial_reg.h> 21 - #include <mach/gpio.h> 22 22 23 + #include <mach/gpio-pnx4008.h> 23 24 #include <mach/clock.h> 24 25 25 26 #define UART_3 0
-1
arch/arm/mach-pxa/cm-x255.c
··· 11 11 12 12 #include <linux/platform_device.h> 13 13 #include <linux/irq.h> 14 - #include <linux/gpio.h> 15 14 #include <linux/mtd/partitions.h> 16 15 #include <linux/mtd/physmap.h> 17 16 #include <linux/mtd/nand-gpio.h>
+1 -1
arch/arm/mach-pxa/generic.c
··· 16 16 * initialization stuff for PXA machines which can be overridden later if 17 17 * need be. 18 18 */ 19 + #include <linux/gpio.h> 19 20 #include <linux/module.h> 20 21 #include <linux/kernel.h> 21 22 #include <linux/init.h> ··· 27 26 #include <asm/mach-types.h> 28 27 29 28 #include <mach/reset.h> 30 - #include <mach/gpio.h> 31 29 #include <mach/smemc.h> 32 30 #include <mach/pxa3xx-regs.h> 33 31
+133
arch/arm/mach-pxa/include/mach/gpio-pxa.h
··· 1 + /* 2 + * Written by Philipp Zabel <philipp.zabel@gmail.com> 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License as published by 6 + * the Free Software Foundation; either version 2 of the License, or 7 + * (at your option) any later version. 8 + * 9 + * This program is distributed in the hope that it will be useful, 10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 + * GNU General Public License for more details. 13 + * 14 + * You should have received a copy of the GNU General Public License 15 + * along with this program; if not, write to the Free Software 16 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 + * 18 + */ 19 + #ifndef __MACH_PXA_GPIO_PXA_H 20 + #define __MACH_PXA_GPIO_PXA_H 21 + 22 + #include <mach/irqs.h> 23 + #include <mach/hardware.h> 24 + 25 + #define GPIO_REGS_VIRT io_p2v(0x40E00000) 26 + 27 + #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) 28 + #define GPIO_REG(x) (*(volatile u32 *)(GPIO_REGS_VIRT + (x))) 29 + 30 + /* GPIO Pin Level Registers */ 31 + #define GPLR0 GPIO_REG(BANK_OFF(0) + 0x00) 32 + #define GPLR1 GPIO_REG(BANK_OFF(1) + 0x00) 33 + #define GPLR2 GPIO_REG(BANK_OFF(2) + 0x00) 34 + #define GPLR3 GPIO_REG(BANK_OFF(3) + 0x00) 35 + 36 + /* GPIO Pin Direction Registers */ 37 + #define GPDR0 GPIO_REG(BANK_OFF(0) + 0x0c) 38 + #define GPDR1 GPIO_REG(BANK_OFF(1) + 0x0c) 39 + #define GPDR2 GPIO_REG(BANK_OFF(2) + 0x0c) 40 + #define GPDR3 GPIO_REG(BANK_OFF(3) + 0x0c) 41 + 42 + /* GPIO Pin Output Set Registers */ 43 + #define GPSR0 GPIO_REG(BANK_OFF(0) + 0x18) 44 + #define GPSR1 GPIO_REG(BANK_OFF(1) + 0x18) 45 + #define GPSR2 GPIO_REG(BANK_OFF(2) + 0x18) 46 + #define GPSR3 GPIO_REG(BANK_OFF(3) + 0x18) 47 + 48 + /* GPIO Pin Output Clear Registers */ 49 + #define GPCR0 GPIO_REG(BANK_OFF(0) + 0x24) 50 + #define GPCR1 GPIO_REG(BANK_OFF(1) + 0x24) 51 + #define GPCR2 GPIO_REG(BANK_OFF(2) + 0x24) 52 + #define GPCR3 GPIO_REG(BANK_OFF(3) + 0x24) 53 + 54 + /* GPIO Rising Edge Detect Registers */ 55 + #define GRER0 GPIO_REG(BANK_OFF(0) + 0x30) 56 + #define GRER1 GPIO_REG(BANK_OFF(1) + 0x30) 57 + #define GRER2 GPIO_REG(BANK_OFF(2) + 0x30) 58 + #define GRER3 GPIO_REG(BANK_OFF(3) + 0x30) 59 + 60 + /* GPIO Falling Edge Detect Registers */ 61 + #define GFER0 GPIO_REG(BANK_OFF(0) + 0x3c) 62 + #define GFER1 GPIO_REG(BANK_OFF(1) + 0x3c) 63 + #define GFER2 GPIO_REG(BANK_OFF(2) + 0x3c) 64 + #define GFER3 GPIO_REG(BANK_OFF(3) + 0x3c) 65 + 66 + /* GPIO Edge Detect Status Registers */ 67 + #define GEDR0 GPIO_REG(BANK_OFF(0) + 0x48) 68 + #define GEDR1 GPIO_REG(BANK_OFF(1) + 0x48) 69 + #define GEDR2 GPIO_REG(BANK_OFF(2) + 0x48) 70 + #define GEDR3 GPIO_REG(BANK_OFF(3) + 0x48) 71 + 72 + /* GPIO Alternate Function Select Registers */ 73 + #define GAFR0_L GPIO_REG(0x0054) 74 + #define GAFR0_U GPIO_REG(0x0058) 75 + #define GAFR1_L GPIO_REG(0x005C) 76 + #define GAFR1_U GPIO_REG(0x0060) 77 + #define GAFR2_L GPIO_REG(0x0064) 78 + #define GAFR2_U GPIO_REG(0x0068) 79 + #define GAFR3_L GPIO_REG(0x006C) 80 + #define GAFR3_U GPIO_REG(0x0070) 81 + 82 + /* More handy macros. The argument is a literal GPIO number. */ 83 + 84 + #define GPIO_bit(x) (1 << ((x) & 0x1f)) 85 + 86 + #define GPLR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x00) 87 + #define GPDR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x0c) 88 + #define GPSR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x18) 89 + #define GPCR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x24) 90 + #define GRER(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x30) 91 + #define GFER(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x3c) 92 + #define GEDR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x48) 93 + #define GAFR(x) GPIO_REG(0x54 + (((x) & 0x70) >> 2)) 94 + 95 + 96 + #define NR_BUILTIN_GPIO PXA_GPIO_IRQ_NUM 97 + 98 + #define gpio_to_bank(gpio) ((gpio) >> 5) 99 + 100 + #ifdef CONFIG_CPU_PXA26x 101 + /* GPIO86/87/88/89 on PXA26x have their direction bits in GPDR2 inverted, 102 + * as well as their Alternate Function value being '1' for GPIO in GAFRx. 103 + */ 104 + static inline int __gpio_is_inverted(unsigned gpio) 105 + { 106 + return cpu_is_pxa25x() && gpio > 85; 107 + } 108 + #else 109 + static inline int __gpio_is_inverted(unsigned gpio) { return 0; } 110 + #endif 111 + 112 + /* 113 + * On PXA25x and PXA27x, GAFRx and GPDRx together decide the alternate 114 + * function of a GPIO, and GPDRx cannot be altered once configured. It 115 + * is attributed as "occupied" here (I know this terminology isn't 116 + * accurate, you are welcome to propose a better one :-) 117 + */ 118 + static inline int __gpio_is_occupied(unsigned gpio) 119 + { 120 + if (cpu_is_pxa27x() || cpu_is_pxa25x()) { 121 + int af = (GAFR(gpio) >> ((gpio & 0xf) * 2)) & 0x3; 122 + int dir = GPDR(gpio) & GPIO_bit(gpio); 123 + 124 + if (__gpio_is_inverted(gpio)) 125 + return af != 1 || dir == 0; 126 + else 127 + return af != 0 || dir != 0; 128 + } else 129 + return GPDR(gpio) & GPIO_bit(gpio); 130 + } 131 + 132 + #include <plat/gpio-pxa.h> 133 + #endif /* __MACH_PXA_GPIO_PXA_H */
+2 -108
arch/arm/mach-pxa/include/mach/gpio.h
··· 24 24 #ifndef __ASM_ARCH_PXA_GPIO_H 25 25 #define __ASM_ARCH_PXA_GPIO_H 26 26 27 - #include <mach/irqs.h> 28 - #include <mach/hardware.h> 29 27 #include <asm-generic/gpio.h> 28 + /* The defines for the driver are needed for the accelerated accessors */ 29 + #include "gpio-pxa.h" 30 30 31 - #define GPIO_REGS_VIRT io_p2v(0x40E00000) 32 - 33 - #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) 34 - #define GPIO_REG(x) (*(volatile u32 *)(GPIO_REGS_VIRT + (x))) 35 - 36 - /* GPIO Pin Level Registers */ 37 - #define GPLR0 GPIO_REG(BANK_OFF(0) + 0x00) 38 - #define GPLR1 GPIO_REG(BANK_OFF(1) + 0x00) 39 - #define GPLR2 GPIO_REG(BANK_OFF(2) + 0x00) 40 - #define GPLR3 GPIO_REG(BANK_OFF(3) + 0x00) 41 - 42 - /* GPIO Pin Direction Registers */ 43 - #define GPDR0 GPIO_REG(BANK_OFF(0) + 0x0c) 44 - #define GPDR1 GPIO_REG(BANK_OFF(1) + 0x0c) 45 - #define GPDR2 GPIO_REG(BANK_OFF(2) + 0x0c) 46 - #define GPDR3 GPIO_REG(BANK_OFF(3) + 0x0c) 47 - 48 - /* GPIO Pin Output Set Registers */ 49 - #define GPSR0 GPIO_REG(BANK_OFF(0) + 0x18) 50 - #define GPSR1 GPIO_REG(BANK_OFF(1) + 0x18) 51 - #define GPSR2 GPIO_REG(BANK_OFF(2) + 0x18) 52 - #define GPSR3 GPIO_REG(BANK_OFF(3) + 0x18) 53 - 54 - /* GPIO Pin Output Clear Registers */ 55 - #define GPCR0 GPIO_REG(BANK_OFF(0) + 0x24) 56 - #define GPCR1 GPIO_REG(BANK_OFF(1) + 0x24) 57 - #define GPCR2 GPIO_REG(BANK_OFF(2) + 0x24) 58 - #define GPCR3 GPIO_REG(BANK_OFF(3) + 0x24) 59 - 60 - /* GPIO Rising Edge Detect Registers */ 61 - #define GRER0 GPIO_REG(BANK_OFF(0) + 0x30) 62 - #define GRER1 GPIO_REG(BANK_OFF(1) + 0x30) 63 - #define GRER2 GPIO_REG(BANK_OFF(2) + 0x30) 64 - #define GRER3 GPIO_REG(BANK_OFF(3) + 0x30) 65 - 66 - /* GPIO Falling Edge Detect Registers */ 67 - #define GFER0 GPIO_REG(BANK_OFF(0) + 0x3c) 68 - #define GFER1 GPIO_REG(BANK_OFF(1) + 0x3c) 69 - #define GFER2 GPIO_REG(BANK_OFF(2) + 0x3c) 70 - #define GFER3 GPIO_REG(BANK_OFF(3) + 0x3c) 71 - 72 - /* GPIO Edge Detect Status Registers */ 73 - #define GEDR0 GPIO_REG(BANK_OFF(0) + 0x48) 74 - #define GEDR1 GPIO_REG(BANK_OFF(1) + 0x48) 75 - #define GEDR2 GPIO_REG(BANK_OFF(2) + 0x48) 76 - #define GEDR3 GPIO_REG(BANK_OFF(3) + 0x48) 77 - 78 - /* GPIO Alternate Function Select Registers */ 79 - #define GAFR0_L GPIO_REG(0x0054) 80 - #define GAFR0_U GPIO_REG(0x0058) 81 - #define GAFR1_L GPIO_REG(0x005C) 82 - #define GAFR1_U GPIO_REG(0x0060) 83 - #define GAFR2_L GPIO_REG(0x0064) 84 - #define GAFR2_U GPIO_REG(0x0068) 85 - #define GAFR3_L GPIO_REG(0x006C) 86 - #define GAFR3_U GPIO_REG(0x0070) 87 - 88 - /* More handy macros. The argument is a literal GPIO number. */ 89 - 90 - #define GPIO_bit(x) (1 << ((x) & 0x1f)) 91 - 92 - #define GPLR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x00) 93 - #define GPDR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x0c) 94 - #define GPSR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x18) 95 - #define GPCR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x24) 96 - #define GRER(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x30) 97 - #define GFER(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x3c) 98 - #define GEDR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x48) 99 - #define GAFR(x) GPIO_REG(0x54 + (((x) & 0x70) >> 2)) 100 - 101 - 102 - #define NR_BUILTIN_GPIO PXA_GPIO_IRQ_NUM 103 - 104 - #define gpio_to_bank(gpio) ((gpio) >> 5) 105 31 #define gpio_to_irq(gpio) IRQ_GPIO(gpio) 106 32 107 33 static inline int irq_to_gpio(unsigned int irq) ··· 42 116 return gpio; 43 117 44 118 return -1; 45 - } 46 - 47 - #ifdef CONFIG_CPU_PXA26x 48 - /* GPIO86/87/88/89 on PXA26x have their direction bits in GPDR2 inverted, 49 - * as well as their Alternate Function value being '1' for GPIO in GAFRx. 50 - */ 51 - static inline int __gpio_is_inverted(unsigned gpio) 52 - { 53 - return cpu_is_pxa25x() && gpio > 85; 54 - } 55 - #else 56 - static inline int __gpio_is_inverted(unsigned gpio) { return 0; } 57 - #endif 58 - 59 - /* 60 - * On PXA25x and PXA27x, GAFRx and GPDRx together decide the alternate 61 - * function of a GPIO, and GPDRx cannot be altered once configured. It 62 - * is attributed as "occupied" here (I know this terminology isn't 63 - * accurate, you are welcome to propose a better one :-) 64 - */ 65 - static inline int __gpio_is_occupied(unsigned gpio) 66 - { 67 - if (cpu_is_pxa27x() || cpu_is_pxa25x()) { 68 - int af = (GAFR(gpio) >> ((gpio & 0xf) * 2)) & 0x3; 69 - int dir = GPDR(gpio) & GPIO_bit(gpio); 70 - 71 - if (__gpio_is_inverted(gpio)) 72 - return af != 1 || dir == 0; 73 - else 74 - return af != 0 || dir != 0; 75 - } else 76 - return GPDR(gpio) & GPIO_bit(gpio); 77 119 } 78 120 79 121 #include <plat/gpio.h>
+1 -1
arch/arm/mach-pxa/include/mach/littleton.h
··· 1 1 #ifndef __ASM_ARCH_LITTLETON_H 2 2 #define __ASM_ARCH_LITTLETON_H 3 3 4 - #include <mach/gpio.h> 4 + #include <mach/gpio-pxa.h> 5 5 6 6 #define LITTLETON_ETH_PHYS 0x30000000 7 7
+1 -2
arch/arm/mach-pxa/irq.c
··· 11 11 * it under the terms of the GNU General Public License version 2 as 12 12 * published by the Free Software Foundation. 13 13 */ 14 - 15 14 #include <linux/init.h> 16 15 #include <linux/module.h> 17 16 #include <linux/interrupt.h> ··· 20 21 21 22 #include <mach/hardware.h> 22 23 #include <mach/irqs.h> 23 - #include <mach/gpio.h> 24 + #include <mach/gpio-pxa.h> 24 25 25 26 #include "generic.h" 26 27
+1 -2
arch/arm/mach-pxa/lpd270.c
··· 12 12 * it under the terms of the GNU General Public License version 2 as 13 13 * published by the Free Software Foundation. 14 14 */ 15 - 15 + #include <linux/gpio.h> 16 16 #include <linux/init.h> 17 17 #include <linux/platform_device.h> 18 18 #include <linux/syscore_ops.h> ··· 39 39 #include <asm/mach/flash.h> 40 40 41 41 #include <mach/pxa27x.h> 42 - #include <mach/gpio.h> 43 42 #include <mach/lpd270.h> 44 43 #include <mach/audio.h> 45 44 #include <mach/pxafb.h>
+1 -1
arch/arm/mach-pxa/lubbock.c
··· 11 11 * it under the terms of the GNU General Public License version 2 as 12 12 * published by the Free Software Foundation. 13 13 */ 14 + #include <linux/gpio.h> 14 15 #include <linux/module.h> 15 16 #include <linux/kernel.h> 16 17 #include <linux/init.h> ··· 43 42 #include <asm/hardware/sa1111.h> 44 43 45 44 #include <mach/pxa25x.h> 46 - #include <mach/gpio.h> 47 45 #include <mach/audio.h> 48 46 #include <mach/lubbock.h> 49 47 #include <mach/udc.h>
+1 -2
arch/arm/mach-pxa/mainstone.c
··· 12 12 * it under the terms of the GNU General Public License version 2 as 13 13 * published by the Free Software Foundation. 14 14 */ 15 - 15 + #include <linux/gpio.h> 16 16 #include <linux/init.h> 17 17 #include <linux/platform_device.h> 18 18 #include <linux/syscore_ops.h> ··· 43 43 #include <asm/mach/flash.h> 44 44 45 45 #include <mach/pxa27x.h> 46 - #include <mach/gpio.h> 47 46 #include <mach/mainstone.h> 48 47 #include <mach/audio.h> 49 48 #include <mach/pxafb.h>
+2 -2
arch/arm/mach-pxa/mfp-pxa2xx.c
··· 12 12 * it under the terms of the GNU General Public License version 2 as 13 13 * published by the Free Software Foundation. 14 14 */ 15 - 15 + #include <linux/gpio.h> 16 16 #include <linux/module.h> 17 17 #include <linux/kernel.h> 18 18 #include <linux/init.h> 19 19 #include <linux/syscore_ops.h> 20 20 21 - #include <mach/gpio.h> 22 21 #include <mach/pxa2xx-regs.h> 23 22 #include <mach/mfp-pxa2xx.h> 23 + #include <mach/gpio-pxa.h> 24 24 25 25 #include "generic.h" 26 26
+1 -2
arch/arm/mach-pxa/pcm990-baseboard.c
··· 19 19 * it under the terms of the GNU General Public License version 2 as 20 20 * published by the Free Software Foundation. 21 21 */ 22 - 22 + #include <linux/gpio.h> 23 23 #include <linux/irq.h> 24 24 #include <linux/platform_device.h> 25 25 #include <linux/i2c.h> ··· 28 28 29 29 #include <media/soc_camera.h> 30 30 31 - #include <asm/gpio.h> 32 31 #include <mach/camera.h> 33 32 #include <asm/mach/map.h> 34 33 #include <mach/pxa27x.h>
+2 -1
arch/arm/mach-pxa/pxa25x.c
··· 16 16 * initialization stuff for PXA machines which can be overridden later if 17 17 * need be. 18 18 */ 19 + #include <linux/gpio.h> 19 20 #include <linux/module.h> 20 21 #include <linux/kernel.h> 21 22 #include <linux/init.h> ··· 24 23 #include <linux/suspend.h> 25 24 #include <linux/syscore_ops.h> 26 25 #include <linux/irq.h> 26 + #include <linux/gpio.h> 27 27 28 28 #include <asm/mach/map.h> 29 29 #include <asm/suspend.h> 30 30 #include <mach/hardware.h> 31 31 #include <mach/irqs.h> 32 - #include <mach/gpio.h> 33 32 #include <mach/pxa25x.h> 34 33 #include <mach/reset.h> 35 34 #include <mach/pm.h>
+2 -1
arch/arm/mach-pxa/pxa27x.c
··· 11 11 * it under the terms of the GNU General Public License version 2 as 12 12 * published by the Free Software Foundation. 13 13 */ 14 + #include <linux/gpio.h> 14 15 #include <linux/module.h> 15 16 #include <linux/kernel.h> 16 17 #include <linux/init.h> ··· 21 20 #include <linux/io.h> 22 21 #include <linux/irq.h> 23 22 #include <linux/i2c/pxa-i2c.h> 23 + #include <linux/gpio.h> 24 24 25 25 #include <asm/mach/map.h> 26 26 #include <mach/hardware.h> 27 27 #include <asm/irq.h> 28 28 #include <asm/suspend.h> 29 29 #include <mach/irqs.h> 30 - #include <mach/gpio.h> 31 30 #include <mach/pxa27x.h> 32 31 #include <mach/reset.h> 33 32 #include <mach/ohci.h>
+1 -2
arch/arm/mach-pxa/pxa3xx.c
··· 12 12 * it under the terms of the GNU General Public License version 2 as 13 13 * published by the Free Software Foundation. 14 14 */ 15 - 16 15 #include <linux/module.h> 17 16 #include <linux/kernel.h> 18 17 #include <linux/init.h> ··· 25 26 #include <asm/mach/map.h> 26 27 #include <asm/suspend.h> 27 28 #include <mach/hardware.h> 28 - #include <mach/gpio.h> 29 + #include <mach/gpio-pxa.h> 29 30 #include <mach/pxa3xx-regs.h> 30 31 #include <mach/reset.h> 31 32 #include <mach/ohci.h>
+1 -2
arch/arm/mach-pxa/pxa95x.c
··· 9 9 * it under the terms of the GNU General Public License version 2 as 10 10 * published by the Free Software Foundation. 11 11 */ 12 - 13 12 #include <linux/module.h> 14 13 #include <linux/kernel.h> 15 14 #include <linux/init.h> ··· 20 21 #include <linux/syscore_ops.h> 21 22 22 23 #include <mach/hardware.h> 23 - #include <mach/gpio.h> 24 + #include <mach/gpio-pxa.h> 24 25 #include <mach/pxa3xx-regs.h> 25 26 #include <mach/pxa930.h> 26 27 #include <mach/reset.h>
+2 -2
arch/arm/mach-pxa/saarb.c
··· 9 9 * it under the terms of the GNU General Public License version 2 as 10 10 * publishhed by the Free Software Foundation. 11 11 */ 12 - 12 + #include <linux/gpio.h> 13 13 #include <linux/init.h> 14 14 #include <linux/kernel.h> 15 15 #include <linux/i2c.h> 16 16 #include <linux/i2c/pxa-i2c.h> 17 17 #include <linux/mfd/88pm860x.h> 18 + #include <linux/gpio.h> 18 19 19 20 #include <asm/mach-types.h> 20 21 #include <asm/mach/arch.h> ··· 24 23 #include <mach/hardware.h> 25 24 #include <mach/mfp.h> 26 25 #include <mach/mfp-pxa930.h> 27 - #include <mach/gpio.h> 28 26 29 27 #include "generic.h" 30 28
+1 -6
arch/arm/mach-realview/include/mach/gpio.h
··· 1 - #include <asm-generic/gpio.h> 2 - 3 - #define gpio_get_value __gpio_get_value 4 - #define gpio_set_value __gpio_set_value 5 - #define gpio_cansleep __gpio_cansleep 6 - #define gpio_to_irq __gpio_to_irq 1 + /* empty */
-6
arch/arm/mach-s3c2410/include/mach/gpio.h
··· 11 11 * published by the Free Software Foundation. 12 12 */ 13 13 14 - #define gpio_get_value __gpio_get_value 15 - #define gpio_set_value __gpio_set_value 16 - #define gpio_cansleep __gpio_cansleep 17 - #define gpio_to_irq __gpio_to_irq 18 - 19 14 /* some boards require extra gpio capacity to support external 20 15 * devices that need GPIO. 21 16 */ ··· 23 28 #define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA) 24 29 #endif 25 30 26 - #include <asm-generic/gpio.h> 27 31 #include <mach/gpio-nrs.h> 28 32 #include <mach/gpio-fns.h> 29 33
+1 -1
arch/arm/mach-s3c2410/include/mach/h1940-latch.h
··· 14 14 #ifndef __ASM_ARCH_H1940_LATCH_H 15 15 #define __ASM_ARCH_H1940_LATCH_H 16 16 17 - #include <mach/gpio.h> 17 + #include <asm/gpio.h> 18 18 19 19 #define H1940_LATCH_GPIO(x) (S3C_GPIO_END + (x)) 20 20
-7
arch/arm/mach-s3c64xx/include/mach/gpio.h
··· 12 12 * published by the Free Software Foundation. 13 13 */ 14 14 15 - #define gpio_get_value __gpio_get_value 16 - #define gpio_set_value __gpio_set_value 17 - #define gpio_cansleep __gpio_cansleep 18 - #define gpio_to_irq __gpio_to_irq 19 - 20 15 /* GPIO bank sizes */ 21 16 #define S3C64XX_GPIO_A_NR (8) 22 17 #define S3C64XX_GPIO_B_NR (7) ··· 91 96 #define BOARD_NR_GPIOS 16 92 97 93 98 #define ARCH_NR_GPIOS (GPIO_BOARD_START + BOARD_NR_GPIOS) 94 - 95 - #include <asm-generic/gpio.h>
-7
arch/arm/mach-s5p64x0/include/mach/gpio.h
··· 13 13 #ifndef __ASM_ARCH_GPIO_H 14 14 #define __ASM_ARCH_GPIO_H __FILE__ 15 15 16 - #define gpio_get_value __gpio_get_value 17 - #define gpio_set_value __gpio_set_value 18 - #define gpio_cansleep __gpio_cansleep 19 - #define gpio_to_irq __gpio_to_irq 20 - 21 16 /* GPIO bank sizes */ 22 17 23 18 #define S5P6440_GPIO_A_NR (6) ··· 128 133 /* define the number of gpios we need to the one after the last GPIO range */ 129 134 130 135 #define ARCH_NR_GPIOS (S5P64X0_GPIO_END + CONFIG_SAMSUNG_GPIO_EXTRA) 131 - 132 - #include <asm-generic/gpio.h> 133 136 134 137 #endif /* __ASM_ARCH_GPIO_H */
-7
arch/arm/mach-s5pc100/include/mach/gpio.h
··· 15 15 #ifndef __ASM_ARCH_GPIO_H 16 16 #define __ASM_ARCH_GPIO_H __FILE__ 17 17 18 - #define gpio_get_value __gpio_get_value 19 - #define gpio_set_value __gpio_set_value 20 - #define gpio_cansleep __gpio_cansleep 21 - #define gpio_to_irq __gpio_to_irq 22 - 23 18 /* GPIO bank sizes */ 24 19 #define S5PC100_GPIO_A0_NR (8) 25 20 #define S5PC100_GPIO_A1_NR (5) ··· 140 145 141 146 /* define the number of gpios we need to the one after the MP04() range */ 142 147 #define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1) 143 - 144 - #include <asm-generic/gpio.h> 145 148 146 149 #endif /* __ASM_ARCH_GPIO_H */
-7
arch/arm/mach-s5pv210/include/mach/gpio.h
··· 13 13 #ifndef __ASM_ARCH_GPIO_H 14 14 #define __ASM_ARCH_GPIO_H __FILE__ 15 15 16 - #define gpio_get_value __gpio_get_value 17 - #define gpio_set_value __gpio_set_value 18 - #define gpio_cansleep __gpio_cansleep 19 - #define gpio_to_irq __gpio_to_irq 20 - 21 16 /* Practically, GPIO banks up to MP03 are the configurable gpio banks */ 22 17 23 18 /* GPIO bank sizes */ ··· 136 141 /* define the number of gpios we need to the one after the MP05() range */ 137 142 #define ARCH_NR_GPIOS (S5PV210_MP05(S5PV210_GPIO_MP05_NR) + \ 138 143 CONFIG_SAMSUNG_GPIO_EXTRA + 1) 139 - 140 - #include <asm-generic/gpio.h> 141 144 142 145 #endif /* __ASM_ARCH_GPIO_H */
+1 -1
arch/arm/mach-sa1100/Makefile
··· 3 3 # 4 4 5 5 # Common support 6 - obj-y := clock.o generic.o gpio.o irq.o dma.o time.o #nmi-oopser.o 6 + obj-y := clock.o generic.o irq.o dma.o time.o #nmi-oopser.o 7 7 obj-m := 8 8 obj-n := 9 9 obj- :=
+1 -1
arch/arm/mach-sa1100/generic.c
··· 9 9 * it under the terms of the GNU General Public License version 2 as 10 10 * published by the Free Software Foundation. 11 11 */ 12 + #include <linux/gpio.h> 12 13 #include <linux/module.h> 13 14 #include <linux/kernel.h> 14 15 #include <linux/init.h> ··· 25 24 #include <asm/mach/map.h> 26 25 #include <asm/mach/flash.h> 27 26 #include <asm/irq.h> 28 - #include <asm/gpio.h> 29 27 30 28 #include "generic.h" 31 29
+1 -3
arch/arm/mach-sa1100/gpio.c drivers/gpio/gpio-sa1100.c
··· 7 7 * it under the terms of the GNU General Public License version 2 as 8 8 * published by the Free Software Foundation. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/init.h> 12 12 #include <linux/module.h> 13 13 14 - #include <asm/gpio.h> 15 14 #include <mach/hardware.h> 16 - #include "generic.h" 17 15 18 16 static int sa1100_gpio_get(struct gpio_chip *chip, unsigned offset) 19 17 {
+2 -2
arch/arm/mach-sa1100/include/mach/gpio.h
··· 28 28 #include <asm/irq.h> 29 29 #include <asm-generic/gpio.h> 30 30 31 + #define __ARM_GPIOLIB_COMPLEX 32 + 31 33 static inline int gpio_get_value(unsigned gpio) 32 34 { 33 35 if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX)) ··· 53 51 54 52 #define gpio_to_irq(gpio) ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \ 55 53 (IRQ_GPIO11 - 11 + gpio)) 56 - #define irq_to_gpio(irq) ((irq < IRQ_GPIO11_27) ? (irq - IRQ_GPIO0) : \ 57 - (irq - IRQ_GPIO11 + 11)) 58 54 59 55 #endif
+4 -20
arch/arm/mach-shmobile/include/mach/gpio.h
··· 18 18 19 19 #ifdef CONFIG_GPIOLIB 20 20 21 - static inline int gpio_get_value(unsigned gpio) 22 - { 23 - return __gpio_get_value(gpio); 24 - } 25 - 26 - static inline void gpio_set_value(unsigned gpio, int value) 27 - { 28 - __gpio_set_value(gpio, value); 29 - } 30 - 31 - static inline int gpio_cansleep(unsigned gpio) 32 - { 33 - return __gpio_cansleep(gpio); 34 - } 35 - 36 - static inline int gpio_to_irq(unsigned gpio) 37 - { 38 - return __gpio_to_irq(gpio); 39 - } 40 - 41 21 static inline int irq_to_gpio(unsigned int irq) 42 22 { 43 23 return -ENOSYS; 44 24 } 25 + 26 + #else 27 + 28 + #define __ARM_GPIOLIB_COMPLEX 45 29 46 30 #endif /* CONFIG_GPIOLIB */ 47 31
+4 -6
arch/arm/mach-tegra/board-harmony-pcie.c
··· 24 24 25 25 #include <mach/pinmux.h> 26 26 #include "board.h" 27 + #include "board-harmony.h" 27 28 28 29 #ifdef CONFIG_TEGRA_PCI 29 - 30 - /* GPIO 3 of the PMIC */ 31 - #define EN_VDD_1V05_GPIO (TEGRA_NR_GPIOS + 2) 32 30 33 31 static int __init harmony_pcie_init(void) 34 32 { ··· 36 38 if (!machine_is_harmony()) 37 39 return 0; 38 40 39 - err = gpio_request(EN_VDD_1V05_GPIO, "EN_VDD_1V05"); 41 + err = gpio_request(TEGRA_GPIO_EN_VDD_1V05_GPIO, "EN_VDD_1V05"); 40 42 if (err) 41 43 return err; 42 44 43 - gpio_direction_output(EN_VDD_1V05_GPIO, 1); 45 + gpio_direction_output(TEGRA_GPIO_EN_VDD_1V05_GPIO, 1); 44 46 45 47 regulator = regulator_get(NULL, "pex_clk"); 46 48 if (IS_ERR_OR_NULL(regulator)) ··· 66 68 regulator_disable(regulator); 67 69 regulator_put(regulator); 68 70 err_reg: 69 - gpio_free(EN_VDD_1V05_GPIO); 71 + gpio_free(TEGRA_GPIO_EN_VDD_1V05_GPIO); 70 72 71 73 return err; 72 74 }
+3
arch/arm/mach-tegra/board-harmony.h
··· 17 17 #ifndef _MACH_TEGRA_BOARD_HARMONY_H 18 18 #define _MACH_TEGRA_BOARD_HARMONY_H 19 19 20 + #include <mach/gpio-tegra.h> 21 + 20 22 #define HARMONY_GPIO_TPS6586X(_x_) (TEGRA_NR_GPIOS + (_x_)) 21 23 #define HARMONY_GPIO_WM8903(_x_) (HARMONY_GPIO_TPS6586X(4) + (_x_)) 22 24 ··· 33 31 #define TEGRA_GPIO_HP_DET TEGRA_GPIO_PW2 34 32 #define TEGRA_GPIO_INT_MIC_EN TEGRA_GPIO_PX0 35 33 #define TEGRA_GPIO_EXT_MIC_EN TEGRA_GPIO_PX1 34 + #define TEGRA_GPIO_EN_VDD_1V05_GPIO HARMONY_GPIO_TPS6586X(2) 36 35 37 36 void harmony_pinmux_init(void); 38 37 int harmony_regulator_init(void);
+2
arch/arm/mach-tegra/board-paz00.h
··· 17 17 #ifndef _MACH_TEGRA_BOARD_PAZ00_H 18 18 #define _MACH_TEGRA_BOARD_PAZ00_H 19 19 20 + #include <mach/gpio-tegra.h> 21 + 20 22 #define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5 21 23 #define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1 22 24 #define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3
+2
arch/arm/mach-tegra/board-seaboard.h
··· 17 17 #ifndef _MACH_TEGRA_BOARD_SEABOARD_H 18 18 #define _MACH_TEGRA_BOARD_SEABOARD_H 19 19 20 + #include <mach/gpio-tegra.h> 21 + 20 22 #define TEGRA_GPIO_SD2_CD TEGRA_GPIO_PI5 21 23 #define TEGRA_GPIO_SD2_WP TEGRA_GPIO_PH1 22 24 #define TEGRA_GPIO_SD2_POWER TEGRA_GPIO_PI6
+1 -2
arch/arm/mach-tegra/board-trimslice-pinmux.c
··· 13 13 * GNU General Public License for more details. 14 14 * 15 15 */ 16 - 16 + #include <linux/gpio.h> 17 17 #include <linux/kernel.h> 18 18 #include <linux/init.h> 19 19 20 20 #include <mach/pinmux.h> 21 - #include <mach/gpio.h> 22 21 23 22 #include "gpio-names.h" 24 23 #include "board-trimslice.h"
+2
arch/arm/mach-tegra/board-trimslice.h
··· 17 17 #ifndef _MACH_TEGRA_BOARD_TRIMSLICE_H 18 18 #define _MACH_TEGRA_BOARD_TRIMSLICE_H 19 19 20 + #include <mach/gpio-tegra.h> 21 + 20 22 #define TRIMSLICE_GPIO_SD4_CD TEGRA_GPIO_PP1 /* mmc4 cd */ 21 23 #define TRIMSLICE_GPIO_SD4_WP TEGRA_GPIO_PP2 /* mmc4 wp */ 22 24
+39
arch/arm/mach-tegra/include/mach/gpio-tegra.h
··· 1 + /* 2 + * arch/arm/mach-tegra/include/mach/gpio.h 3 + * 4 + * Copyright (C) 2010 Google, Inc. 5 + * 6 + * Author: 7 + * Erik Gilling <konkers@google.com> 8 + * 9 + * This software is licensed under the terms of the GNU General Public 10 + * License version 2, as published by the Free Software Foundation, and 11 + * may be copied, distributed, and modified under those terms. 12 + * 13 + * This program is distributed in the hope that it will be useful, 14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 + * GNU General Public License for more details. 17 + * 18 + */ 19 + 20 + #ifndef __MACH_TEGRA_GPIO_TEGRA_H 21 + #define __MACH_TEGRA_GPIO_TEGRA_H 22 + 23 + #include <linux/types.h> 24 + #include <mach/irqs.h> 25 + 26 + #define TEGRA_NR_GPIOS INT_GPIO_NR 27 + 28 + #define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio)) 29 + 30 + struct tegra_gpio_table { 31 + int gpio; /* GPIO number */ 32 + bool enable; /* Enable for GPIO at init? */ 33 + }; 34 + 35 + void tegra_gpio_config(struct tegra_gpio_table *table, int num); 36 + void tegra_gpio_enable(int gpio); 37 + void tegra_gpio_disable(int gpio); 38 + 39 + #endif
-60
arch/arm/mach-tegra/include/mach/gpio.h
··· 1 - /* 2 - * arch/arm/mach-tegra/include/mach/gpio.h 3 - * 4 - * Copyright (C) 2010 Google, Inc. 5 - * 6 - * Author: 7 - * Erik Gilling <konkers@google.com> 8 - * 9 - * This software is licensed under the terms of the GNU General Public 10 - * License version 2, as published by the Free Software Foundation, and 11 - * may be copied, distributed, and modified under those terms. 12 - * 13 - * This program is distributed in the hope that it will be useful, 14 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 - * GNU General Public License for more details. 17 - * 18 - */ 19 - 20 - #ifndef __MACH_TEGRA_GPIO_H 21 - #define __MACH_TEGRA_GPIO_H 22 - 23 - #include <linux/init.h> 24 - #include <mach/irqs.h> 25 - 26 - #define TEGRA_NR_GPIOS INT_GPIO_NR 27 - 28 - #include <asm-generic/gpio.h> 29 - 30 - #define gpio_get_value __gpio_get_value 31 - #define gpio_set_value __gpio_set_value 32 - #define gpio_cansleep __gpio_cansleep 33 - 34 - #define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio)) 35 - #define TEGRA_IRQ_TO_GPIO(irq) ((irq) - INT_GPIO_BASE) 36 - 37 - static inline int gpio_to_irq(unsigned int gpio) 38 - { 39 - if (gpio < TEGRA_NR_GPIOS) 40 - return INT_GPIO_BASE + gpio; 41 - return -EINVAL; 42 - } 43 - 44 - static inline int irq_to_gpio(unsigned int irq) 45 - { 46 - if ((irq >= INT_GPIO_BASE) && (irq < INT_GPIO_BASE + INT_GPIO_NR)) 47 - return irq - INT_GPIO_BASE; 48 - return -EINVAL; 49 - } 50 - 51 - struct tegra_gpio_table { 52 - int gpio; /* GPIO number */ 53 - bool enable; /* Enable for GPIO at init? */ 54 - }; 55 - 56 - void tegra_gpio_config(struct tegra_gpio_table *table, int num); 57 - void tegra_gpio_enable(int gpio); 58 - void tegra_gpio_disable(int gpio); 59 - 60 - #endif
+1
arch/arm/mach-tegra/usb_phy.c
··· 28 28 #include <linux/usb/otg.h> 29 29 #include <linux/usb/ulpi.h> 30 30 #include <asm/mach-types.h> 31 + #include <mach/gpio-tegra.h> 31 32 #include <mach/usb_phy.h> 32 33 #include <mach/iomap.h> 33 34
+1
arch/arm/mach-u300/Kconfig
··· 6 6 7 7 config MACH_U300 8 8 bool "U300" 9 + select GPIO_U300 9 10 10 11 comment "ST-Ericsson U300/U330/U335/U365 Feature Selections" 11 12
+28 -3
arch/arm/mach-u300/core.c
··· 37 37 #include <mach/hardware.h> 38 38 #include <mach/syscon.h> 39 39 #include <mach/dma_channels.h> 40 + #include <mach/gpio-u300.h> 40 41 41 42 #include "clock.h" 42 43 #include "mmc.h" ··· 240 239 .end = IRQ_U300_GPIO_PORT2, 241 240 .flags = IORESOURCE_IRQ, 242 241 }, 243 - #ifdef U300_COH901571_3 242 + #if defined(CONFIG_MACH_U300_BS365) || defined(CONFIG_MACH_U300_BS335) 244 243 { 245 244 .name = "gpio3", 246 245 .start = IRQ_U300_GPIO_PORT3, ··· 253 252 .end = IRQ_U300_GPIO_PORT4, 254 253 .flags = IORESOURCE_IRQ, 255 254 }, 255 + #endif 256 256 #ifdef CONFIG_MACH_U300_BS335 257 257 { 258 258 .name = "gpio5", ··· 268 266 .flags = IORESOURCE_IRQ, 269 267 }, 270 268 #endif /* CONFIG_MACH_U300_BS335 */ 271 - #endif /* U300_COH901571_3 */ 272 269 }; 273 270 274 271 static struct resource keypad_resources[] = { ··· 1557 1556 .resource = i2c1_resources, 1558 1557 }; 1559 1558 1559 + /* 1560 + * The different variants have a few different versions of the 1561 + * GPIO block, with different number of ports. 1562 + */ 1563 + static struct u300_gpio_platform u300_gpio_plat = { 1564 + #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) 1565 + .variant = U300_GPIO_COH901335, 1566 + .ports = 3, 1567 + #endif 1568 + #ifdef CONFIG_MACH_U300_BS335 1569 + .variant = U300_GPIO_COH901571_3_BS335, 1570 + .ports = 7, 1571 + #endif 1572 + #ifdef CONFIG_MACH_U300_BS365 1573 + .variant = U300_GPIO_COH901571_3_BS365, 1574 + .ports = 5, 1575 + #endif 1576 + .gpio_base = 0, 1577 + .gpio_irq_base = IRQ_U300_GPIO_BASE, 1578 + }; 1579 + 1560 1580 static struct platform_device gpio_device = { 1561 1581 .name = "u300-gpio", 1562 1582 .id = -1, 1563 1583 .num_resources = ARRAY_SIZE(gpio_resources), 1564 1584 .resource = gpio_resources, 1585 + .dev = { 1586 + .platform_data = &u300_gpio_plat, 1587 + }, 1565 1588 }; 1566 1589 1567 1590 static struct platform_device keypad_device = { ··· 1691 1666 BUG_ON(IS_ERR(clk)); 1692 1667 clk_enable(clk); 1693 1668 1694 - for (i = 0; i < NR_IRQS; i++) 1669 + for (i = 0; i < U300_VIC_IRQS_END; i++) 1695 1670 set_bit(i, (unsigned long *) &mask[0]); 1696 1671 vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], mask[0]); 1697 1672 vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], mask[1]);
+150
arch/arm/mach-u300/include/mach/gpio-u300.h
··· 1 + /* 2 + * Copyright (C) 2007-2011 ST-Ericsson AB 3 + * License terms: GNU General Public License (GPL) version 2 4 + * GPIO block resgister definitions and inline macros for 5 + * U300 GPIO COH 901 335 or COH 901 571/3 6 + * Author: Linus Walleij <linus.walleij@stericsson.com> 7 + */ 8 + 9 + #ifndef __MACH_U300_GPIO_U300_H 10 + #define __MACH_U300_GPIO_U300_H 11 + 12 + /* 13 + * Individual pin assignments for the B26/S26. Notice that the 14 + * actual usage of these pins depends on the PAD MUX settings, that 15 + * is why the same number can potentially appear several times. 16 + * In the reference design each pin is only used for one purpose. 17 + * These were determined by inspecting the B26/S26 schematic: 18 + * 2/1911-ROA 128 1603 19 + */ 20 + #ifdef CONFIG_MACH_U300_BS2X 21 + #define U300_GPIO_PIN_UART_RX 0 22 + #define U300_GPIO_PIN_UART_TX 1 23 + #define U300_GPIO_PIN_GPIO02 2 /* Unrouted */ 24 + #define U300_GPIO_PIN_GPIO03 3 /* Unrouted */ 25 + #define U300_GPIO_PIN_CAM_SLEEP 4 26 + #define U300_GPIO_PIN_CAM_REG_EN 5 27 + #define U300_GPIO_PIN_GPIO06 6 /* Unrouted */ 28 + #define U300_GPIO_PIN_GPIO07 7 /* Unrouted */ 29 + 30 + #define U300_GPIO_PIN_GPIO08 8 /* Service point SP2321 */ 31 + #define U300_GPIO_PIN_GPIO09 9 /* Service point SP2322 */ 32 + #define U300_GPIO_PIN_PHFSENSE 10 /* Headphone jack sensing */ 33 + #define U300_GPIO_PIN_MMC_CLKRET 11 /* Clock return from MMC/SD card */ 34 + #define U300_GPIO_PIN_MMC_CD 12 /* MMC Card insertion detection */ 35 + #define U300_GPIO_PIN_FLIPSENSE 13 /* Mechanical flip sensing */ 36 + #define U300_GPIO_PIN_GPIO14 14 /* DSP JTAG Port RTCK */ 37 + #define U300_GPIO_PIN_GPIO15 15 /* Unrouted */ 38 + 39 + #define U300_GPIO_PIN_GPIO16 16 /* Unrouted */ 40 + #define U300_GPIO_PIN_GPIO17 17 /* Unrouted */ 41 + #define U300_GPIO_PIN_GPIO18 18 /* Unrouted */ 42 + #define U300_GPIO_PIN_GPIO19 19 /* Unrouted */ 43 + #define U300_GPIO_PIN_GPIO20 20 /* Unrouted */ 44 + #define U300_GPIO_PIN_GPIO21 21 /* Unrouted */ 45 + #define U300_GPIO_PIN_GPIO22 22 /* Unrouted */ 46 + #define U300_GPIO_PIN_GPIO23 23 /* Unrouted */ 47 + #endif 48 + 49 + /* 50 + * Individual pin assignments for the B330/S330 and B365/S365. 51 + * Notice that the actual usage of these pins depends on the 52 + * PAD MUX settings, that is why the same number can potentially 53 + * appear several times. In the reference design each pin is only 54 + * used for one purpose. These were determined by inspecting the 55 + * S365 schematic. 56 + */ 57 + #if defined(CONFIG_MACH_U300_BS330) || defined(CONFIG_MACH_U300_BS365) || \ 58 + defined(CONFIG_MACH_U300_BS335) 59 + #define U300_GPIO_PIN_UART_RX 0 60 + #define U300_GPIO_PIN_UART_TX 1 61 + #define U300_GPIO_PIN_UART_CTS 2 62 + #define U300_GPIO_PIN_UART_RTS 3 63 + #define U300_GPIO_PIN_CAM_MAIN_STANDBY 4 /* Camera MAIN standby */ 64 + #define U300_GPIO_PIN_GPIO05 5 /* Unrouted */ 65 + #define U300_GPIO_PIN_MS_CD 6 /* Memory Stick Card insertion */ 66 + #define U300_GPIO_PIN_GPIO07 7 /* Test point TP2430 */ 67 + 68 + #define U300_GPIO_PIN_GPIO08 8 /* Test point TP2437 */ 69 + #define U300_GPIO_PIN_GPIO09 9 /* Test point TP2431 */ 70 + #define U300_GPIO_PIN_GPIO10 10 /* Test point TP2432 */ 71 + #define U300_GPIO_PIN_MMC_CLKRET 11 /* Clock return from MMC/SD card */ 72 + #define U300_GPIO_PIN_MMC_CD 12 /* MMC Card insertion detection */ 73 + #define U300_GPIO_PIN_CAM_SUB_STANDBY 13 /* Camera SUB standby */ 74 + #define U300_GPIO_PIN_GPIO14 14 /* Test point TP2436 */ 75 + #define U300_GPIO_PIN_GPIO15 15 /* Unrouted */ 76 + 77 + #define U300_GPIO_PIN_GPIO16 16 /* Test point TP2438 */ 78 + #define U300_GPIO_PIN_PHFSENSE 17 /* Headphone jack sensing */ 79 + #define U300_GPIO_PIN_GPIO18 18 /* Test point TP2439 */ 80 + #define U300_GPIO_PIN_GPIO19 19 /* Routed somewhere */ 81 + #define U300_GPIO_PIN_GPIO20 20 /* Unrouted */ 82 + #define U300_GPIO_PIN_GPIO21 21 /* Unrouted */ 83 + #define U300_GPIO_PIN_GPIO22 22 /* Unrouted */ 84 + #define U300_GPIO_PIN_GPIO23 23 /* Unrouted */ 85 + 86 + #define U300_GPIO_PIN_GPIO24 24 /* Unrouted */ 87 + #define U300_GPIO_PIN_GPIO25 25 /* Unrouted */ 88 + #define U300_GPIO_PIN_GPIO26 26 /* Unrouted */ 89 + #define U300_GPIO_PIN_GPIO27 27 /* Unrouted */ 90 + #define U300_GPIO_PIN_GPIO28 28 /* Unrouted */ 91 + #define U300_GPIO_PIN_GPIO29 29 /* Unrouted */ 92 + #define U300_GPIO_PIN_GPIO30 30 /* Unrouted */ 93 + #define U300_GPIO_PIN_GPIO31 31 /* Unrouted */ 94 + 95 + #define U300_GPIO_PIN_GPIO32 32 /* Unrouted */ 96 + #define U300_GPIO_PIN_GPIO33 33 /* Unrouted */ 97 + #define U300_GPIO_PIN_GPIO34 34 /* Unrouted */ 98 + #define U300_GPIO_PIN_GPIO35 35 /* Unrouted */ 99 + #define U300_GPIO_PIN_GPIO36 36 /* Unrouted */ 100 + #define U300_GPIO_PIN_GPIO37 37 /* Unrouted */ 101 + #define U300_GPIO_PIN_GPIO38 38 /* Unrouted */ 102 + #define U300_GPIO_PIN_GPIO39 39 /* Unrouted */ 103 + 104 + #ifdef CONFIG_MACH_U300_BS335 105 + 106 + #define U300_GPIO_PIN_GPIO40 40 /* Unrouted */ 107 + #define U300_GPIO_PIN_GPIO41 41 /* Unrouted */ 108 + #define U300_GPIO_PIN_GPIO42 42 /* Unrouted */ 109 + #define U300_GPIO_PIN_GPIO43 43 /* Unrouted */ 110 + #define U300_GPIO_PIN_GPIO44 44 /* Unrouted */ 111 + #define U300_GPIO_PIN_GPIO45 45 /* Unrouted */ 112 + #define U300_GPIO_PIN_GPIO46 46 /* Unrouted */ 113 + #define U300_GPIO_PIN_GPIO47 47 /* Unrouted */ 114 + 115 + #define U300_GPIO_PIN_GPIO48 48 /* Unrouted */ 116 + #define U300_GPIO_PIN_GPIO49 49 /* Unrouted */ 117 + #define U300_GPIO_PIN_GPIO50 50 /* Unrouted */ 118 + #define U300_GPIO_PIN_GPIO51 51 /* Unrouted */ 119 + #define U300_GPIO_PIN_GPIO52 52 /* Unrouted */ 120 + #define U300_GPIO_PIN_GPIO53 53 /* Unrouted */ 121 + #define U300_GPIO_PIN_GPIO54 54 /* Unrouted */ 122 + #define U300_GPIO_PIN_GPIO55 55 /* Unrouted */ 123 + #endif 124 + 125 + #endif 126 + 127 + /** 128 + * enum u300_gpio_variant - the type of U300 GPIO employed 129 + */ 130 + enum u300_gpio_variant { 131 + U300_GPIO_COH901335, 132 + U300_GPIO_COH901571_3_BS335, 133 + U300_GPIO_COH901571_3_BS365, 134 + }; 135 + 136 + /** 137 + * struct u300_gpio_platform - U300 GPIO platform data 138 + * @variant: IP block variant 139 + * @ports: number of GPIO block ports 140 + * @gpio_base: first GPIO number for this block (use a free range) 141 + * @gpio_irq_base: first GPIO IRQ number for this block (use a free range) 142 + */ 143 + struct u300_gpio_platform { 144 + enum u300_gpio_variant variant; 145 + u8 ports; 146 + int gpio_base; 147 + int gpio_irq_base; 148 + }; 149 + 150 + #endif /* __MACH_U300_GPIO_U300_H */
-294
arch/arm/mach-u300/include/mach/gpio.h
··· 1 - /* 2 - * 3 - * arch/arm/mach-u300/include/mach/gpio.h 4 - * 5 - * 6 - * Copyright (C) 2007-2009 ST-Ericsson AB 7 - * License terms: GNU General Public License (GPL) version 2 8 - * GPIO block resgister definitions and inline macros for 9 - * U300 GPIO COH 901 335 or COH 901 571/3 10 - * Author: Linus Walleij <linus.walleij@stericsson.com> 11 - */ 12 - 13 - #ifndef __MACH_U300_GPIO_H 14 - #define __MACH_U300_GPIO_H 15 - 16 - #include <linux/kernel.h> 17 - #include <linux/io.h> 18 - #include <mach/hardware.h> 19 - #include <asm/irq.h> 20 - 21 - /* Switch type depending on platform/chip variant */ 22 - #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) 23 - #define U300_COH901335 24 - #endif 25 - #if defined(CONFIG_MACH_U300_BS365) || defined(CONFIG_MACH_U300_BS335) 26 - #define U300_COH901571_3 27 - #endif 28 - 29 - /* Get base address for regs here */ 30 - #include "u300-regs.h" 31 - /* IRQ numbers */ 32 - #include "irqs.h" 33 - 34 - /* 35 - * This is the GPIO block definitions. GPIO (General Purpose I/O) can be 36 - * used for anything, and often is. The event/enable etc figures are for 37 - * the lowermost pin (pin 0 on each port), shift this left to match your 38 - * pin if you're gonna use these values. 39 - */ 40 - #ifdef U300_COH901335 41 - #define U300_GPIO_PORTX_SPACING (0x1C) 42 - /* Port X Pin Data Register 32bit, this is both input and output (R/W) */ 43 - #define U300_GPIO_PXPDIR (0x00) 44 - #define U300_GPIO_PXPDOR (0x00) 45 - /* Port X Pin Config Register 32bit (R/W) */ 46 - #define U300_GPIO_PXPCR (0x04) 47 - #define U300_GPIO_PXPCR_ALL_PINS_MODE_MASK (0x0000FFFFUL) 48 - #define U300_GPIO_PXPCR_PIN_MODE_MASK (0x00000003UL) 49 - #define U300_GPIO_PXPCR_PIN_MODE_SHIFT (0x00000002UL) 50 - #define U300_GPIO_PXPCR_PIN_MODE_INPUT (0x00000000UL) 51 - #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL (0x00000001UL) 52 - #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN (0x00000002UL) 53 - #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE (0x00000003UL) 54 - /* Port X Interrupt Event Register 32bit (R/W) */ 55 - #define U300_GPIO_PXIEV (0x08) 56 - #define U300_GPIO_PXIEV_ALL_IRQ_EVENT_MASK (0x000000FFUL) 57 - #define U300_GPIO_PXIEV_IRQ_EVENT (0x00000001UL) 58 - /* Port X Interrupt Enable Register 32bit (R/W) */ 59 - #define U300_GPIO_PXIEN (0x0C) 60 - #define U300_GPIO_PXIEN_ALL_IRQ_ENABLE_MASK (0x000000FFUL) 61 - #define U300_GPIO_PXIEN_IRQ_ENABLE (0x00000001UL) 62 - /* Port X Interrupt Force Register 32bit (R/W) */ 63 - #define U300_GPIO_PXIFR (0x10) 64 - #define U300_GPIO_PXIFR_ALL_IRQ_FORCE_MASK (0x000000FFUL) 65 - #define U300_GPIO_PXIFR_IRQ_FORCE (0x00000001UL) 66 - /* Port X Interrupt Config Register 32bit (R/W) */ 67 - #define U300_GPIO_PXICR (0x14) 68 - #define U300_GPIO_PXICR_ALL_IRQ_CONFIG_MASK (0x000000FFUL) 69 - #define U300_GPIO_PXICR_IRQ_CONFIG_MASK (0x00000001UL) 70 - #define U300_GPIO_PXICR_IRQ_CONFIG_FALLING_EDGE (0x00000000UL) 71 - #define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE (0x00000001UL) 72 - /* Port X Pull-up Enable Register 32bit (R/W) */ 73 - #define U300_GPIO_PXPER (0x18) 74 - #define U300_GPIO_PXPER_ALL_PULL_UP_DISABLE_MASK (0x000000FFUL) 75 - #define U300_GPIO_PXPER_PULL_UP_DISABLE (0x00000001UL) 76 - /* Control Register 32bit (R/W) */ 77 - #define U300_GPIO_CR (0x54) 78 - #define U300_GPIO_CR_BLOCK_CLOCK_ENABLE (0x00000001UL) 79 - /* three ports of 8 bits each = GPIO pins 0..23 */ 80 - #define U300_GPIO_NUM_PORTS 3 81 - #define U300_GPIO_PINS_PER_PORT 8 82 - #define U300_GPIO_MAX (U300_GPIO_PINS_PER_PORT * U300_GPIO_NUM_PORTS - 1) 83 - #endif 84 - 85 - #ifdef U300_COH901571_3 86 - /* 87 - * Control Register 32bit (R/W) 88 - * bit 15-9 (mask 0x0000FE00) contains the number of cores. 8*cores 89 - * gives the number of GPIO pins. 90 - * bit 8-2 (mask 0x000001FC) contains the core version ID. 91 - */ 92 - #define U300_GPIO_CR (0x00) 93 - #define U300_GPIO_CR_SYNC_SEL_ENABLE (0x00000002UL) 94 - #define U300_GPIO_CR_BLOCK_CLKRQ_ENABLE (0x00000001UL) 95 - #define U300_GPIO_PORTX_SPACING (0x30) 96 - /* Port X Pin Data INPUT Register 32bit (R/W) */ 97 - #define U300_GPIO_PXPDIR (0x04) 98 - /* Port X Pin Data OUTPUT Register 32bit (R/W) */ 99 - #define U300_GPIO_PXPDOR (0x08) 100 - /* Port X Pin Config Register 32bit (R/W) */ 101 - #define U300_GPIO_PXPCR (0x0C) 102 - #define U300_GPIO_PXPCR_ALL_PINS_MODE_MASK (0x0000FFFFUL) 103 - #define U300_GPIO_PXPCR_PIN_MODE_MASK (0x00000003UL) 104 - #define U300_GPIO_PXPCR_PIN_MODE_SHIFT (0x00000002UL) 105 - #define U300_GPIO_PXPCR_PIN_MODE_INPUT (0x00000000UL) 106 - #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL (0x00000001UL) 107 - #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN (0x00000002UL) 108 - #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE (0x00000003UL) 109 - /* Port X Pull-up Enable Register 32bit (R/W) */ 110 - #define U300_GPIO_PXPER (0x10) 111 - #define U300_GPIO_PXPER_ALL_PULL_UP_DISABLE_MASK (0x000000FFUL) 112 - #define U300_GPIO_PXPER_PULL_UP_DISABLE (0x00000001UL) 113 - /* Port X Interrupt Event Register 32bit (R/W) */ 114 - #define U300_GPIO_PXIEV (0x14) 115 - #define U300_GPIO_PXIEV_ALL_IRQ_EVENT_MASK (0x000000FFUL) 116 - #define U300_GPIO_PXIEV_IRQ_EVENT (0x00000001UL) 117 - /* Port X Interrupt Enable Register 32bit (R/W) */ 118 - #define U300_GPIO_PXIEN (0x18) 119 - #define U300_GPIO_PXIEN_ALL_IRQ_ENABLE_MASK (0x000000FFUL) 120 - #define U300_GPIO_PXIEN_IRQ_ENABLE (0x00000001UL) 121 - /* Port X Interrupt Force Register 32bit (R/W) */ 122 - #define U300_GPIO_PXIFR (0x1C) 123 - #define U300_GPIO_PXIFR_ALL_IRQ_FORCE_MASK (0x000000FFUL) 124 - #define U300_GPIO_PXIFR_IRQ_FORCE (0x00000001UL) 125 - /* Port X Interrupt Config Register 32bit (R/W) */ 126 - #define U300_GPIO_PXICR (0x20) 127 - #define U300_GPIO_PXICR_ALL_IRQ_CONFIG_MASK (0x000000FFUL) 128 - #define U300_GPIO_PXICR_IRQ_CONFIG_MASK (0x00000001UL) 129 - #define U300_GPIO_PXICR_IRQ_CONFIG_FALLING_EDGE (0x00000000UL) 130 - #define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE (0x00000001UL) 131 - #ifdef CONFIG_MACH_U300_BS335 132 - /* seven ports of 8 bits each = GPIO pins 0..55 */ 133 - #define U300_GPIO_NUM_PORTS 7 134 - #else 135 - /* five ports of 8 bits each = GPIO pins 0..39 */ 136 - #define U300_GPIO_NUM_PORTS 5 137 - #endif 138 - #define U300_GPIO_PINS_PER_PORT 8 139 - #define U300_GPIO_MAX (U300_GPIO_PINS_PER_PORT * U300_GPIO_NUM_PORTS - 1) 140 - #endif 141 - 142 - /* 143 - * Individual pin assignments for the B26/S26. Notice that the 144 - * actual usage of these pins depends on the PAD MUX settings, that 145 - * is why the same number can potentially appear several times. 146 - * In the reference design each pin is only used for one purpose. 147 - * These were determined by inspecting the B26/S26 schematic: 148 - * 2/1911-ROA 128 1603 149 - */ 150 - #ifdef CONFIG_MACH_U300_BS2X 151 - #define U300_GPIO_PIN_UART_RX 0 152 - #define U300_GPIO_PIN_UART_TX 1 153 - #define U300_GPIO_PIN_GPIO02 2 /* Unrouted */ 154 - #define U300_GPIO_PIN_GPIO03 3 /* Unrouted */ 155 - #define U300_GPIO_PIN_CAM_SLEEP 4 156 - #define U300_GPIO_PIN_CAM_REG_EN 5 157 - #define U300_GPIO_PIN_GPIO06 6 /* Unrouted */ 158 - #define U300_GPIO_PIN_GPIO07 7 /* Unrouted */ 159 - 160 - #define U300_GPIO_PIN_GPIO08 8 /* Service point SP2321 */ 161 - #define U300_GPIO_PIN_GPIO09 9 /* Service point SP2322 */ 162 - #define U300_GPIO_PIN_PHFSENSE 10 /* Headphone jack sensing */ 163 - #define U300_GPIO_PIN_MMC_CLKRET 11 /* Clock return from MMC/SD card */ 164 - #define U300_GPIO_PIN_MMC_CD 12 /* MMC Card insertion detection */ 165 - #define U300_GPIO_PIN_FLIPSENSE 13 /* Mechanical flip sensing */ 166 - #define U300_GPIO_PIN_GPIO14 14 /* DSP JTAG Port RTCK */ 167 - #define U300_GPIO_PIN_GPIO15 15 /* Unrouted */ 168 - 169 - #define U300_GPIO_PIN_GPIO16 16 /* Unrouted */ 170 - #define U300_GPIO_PIN_GPIO17 17 /* Unrouted */ 171 - #define U300_GPIO_PIN_GPIO18 18 /* Unrouted */ 172 - #define U300_GPIO_PIN_GPIO19 19 /* Unrouted */ 173 - #define U300_GPIO_PIN_GPIO20 20 /* Unrouted */ 174 - #define U300_GPIO_PIN_GPIO21 21 /* Unrouted */ 175 - #define U300_GPIO_PIN_GPIO22 22 /* Unrouted */ 176 - #define U300_GPIO_PIN_GPIO23 23 /* Unrouted */ 177 - #endif 178 - 179 - /* 180 - * Individual pin assignments for the B330/S330 and B365/S365. 181 - * Notice that the actual usage of these pins depends on the 182 - * PAD MUX settings, that is why the same number can potentially 183 - * appear several times. In the reference design each pin is only 184 - * used for one purpose. These were determined by inspecting the 185 - * S365 schematic. 186 - */ 187 - #if defined(CONFIG_MACH_U300_BS330) || defined(CONFIG_MACH_U300_BS365) || \ 188 - defined(CONFIG_MACH_U300_BS335) 189 - #define U300_GPIO_PIN_UART_RX 0 190 - #define U300_GPIO_PIN_UART_TX 1 191 - #define U300_GPIO_PIN_UART_CTS 2 192 - #define U300_GPIO_PIN_UART_RTS 3 193 - #define U300_GPIO_PIN_CAM_MAIN_STANDBY 4 /* Camera MAIN standby */ 194 - #define U300_GPIO_PIN_GPIO05 5 /* Unrouted */ 195 - #define U300_GPIO_PIN_MS_CD 6 /* Memory Stick Card insertion */ 196 - #define U300_GPIO_PIN_GPIO07 7 /* Test point TP2430 */ 197 - 198 - #define U300_GPIO_PIN_GPIO08 8 /* Test point TP2437 */ 199 - #define U300_GPIO_PIN_GPIO09 9 /* Test point TP2431 */ 200 - #define U300_GPIO_PIN_GPIO10 10 /* Test point TP2432 */ 201 - #define U300_GPIO_PIN_MMC_CLKRET 11 /* Clock return from MMC/SD card */ 202 - #define U300_GPIO_PIN_MMC_CD 12 /* MMC Card insertion detection */ 203 - #define U300_GPIO_PIN_CAM_SUB_STANDBY 13 /* Camera SUB standby */ 204 - #define U300_GPIO_PIN_GPIO14 14 /* Test point TP2436 */ 205 - #define U300_GPIO_PIN_GPIO15 15 /* Unrouted */ 206 - 207 - #define U300_GPIO_PIN_GPIO16 16 /* Test point TP2438 */ 208 - #define U300_GPIO_PIN_PHFSENSE 17 /* Headphone jack sensing */ 209 - #define U300_GPIO_PIN_GPIO18 18 /* Test point TP2439 */ 210 - #define U300_GPIO_PIN_GPIO19 19 /* Routed somewhere */ 211 - #define U300_GPIO_PIN_GPIO20 20 /* Unrouted */ 212 - #define U300_GPIO_PIN_GPIO21 21 /* Unrouted */ 213 - #define U300_GPIO_PIN_GPIO22 22 /* Unrouted */ 214 - #define U300_GPIO_PIN_GPIO23 23 /* Unrouted */ 215 - 216 - #define U300_GPIO_PIN_GPIO24 24 /* Unrouted */ 217 - #define U300_GPIO_PIN_GPIO25 25 /* Unrouted */ 218 - #define U300_GPIO_PIN_GPIO26 26 /* Unrouted */ 219 - #define U300_GPIO_PIN_GPIO27 27 /* Unrouted */ 220 - #define U300_GPIO_PIN_GPIO28 28 /* Unrouted */ 221 - #define U300_GPIO_PIN_GPIO29 29 /* Unrouted */ 222 - #define U300_GPIO_PIN_GPIO30 30 /* Unrouted */ 223 - #define U300_GPIO_PIN_GPIO31 31 /* Unrouted */ 224 - 225 - #define U300_GPIO_PIN_GPIO32 32 /* Unrouted */ 226 - #define U300_GPIO_PIN_GPIO33 33 /* Unrouted */ 227 - #define U300_GPIO_PIN_GPIO34 34 /* Unrouted */ 228 - #define U300_GPIO_PIN_GPIO35 35 /* Unrouted */ 229 - #define U300_GPIO_PIN_GPIO36 36 /* Unrouted */ 230 - #define U300_GPIO_PIN_GPIO37 37 /* Unrouted */ 231 - #define U300_GPIO_PIN_GPIO38 38 /* Unrouted */ 232 - #define U300_GPIO_PIN_GPIO39 39 /* Unrouted */ 233 - 234 - #ifdef CONFIG_MACH_U300_BS335 235 - 236 - #define U300_GPIO_PIN_GPIO40 40 /* Unrouted */ 237 - #define U300_GPIO_PIN_GPIO41 41 /* Unrouted */ 238 - #define U300_GPIO_PIN_GPIO42 42 /* Unrouted */ 239 - #define U300_GPIO_PIN_GPIO43 43 /* Unrouted */ 240 - #define U300_GPIO_PIN_GPIO44 44 /* Unrouted */ 241 - #define U300_GPIO_PIN_GPIO45 45 /* Unrouted */ 242 - #define U300_GPIO_PIN_GPIO46 46 /* Unrouted */ 243 - #define U300_GPIO_PIN_GPIO47 47 /* Unrouted */ 244 - 245 - #define U300_GPIO_PIN_GPIO48 48 /* Unrouted */ 246 - #define U300_GPIO_PIN_GPIO49 49 /* Unrouted */ 247 - #define U300_GPIO_PIN_GPIO50 50 /* Unrouted */ 248 - #define U300_GPIO_PIN_GPIO51 51 /* Unrouted */ 249 - #define U300_GPIO_PIN_GPIO52 52 /* Unrouted */ 250 - #define U300_GPIO_PIN_GPIO53 53 /* Unrouted */ 251 - #define U300_GPIO_PIN_GPIO54 54 /* Unrouted */ 252 - #define U300_GPIO_PIN_GPIO55 55 /* Unrouted */ 253 - #endif 254 - 255 - #endif 256 - 257 - /* translates a pin number to a port number */ 258 - #define PIN_TO_PORT(val) (val >> 3) 259 - 260 - /* These can be found in arch/arm/mach-u300/gpio.c */ 261 - extern int gpio_is_valid(int number); 262 - extern int gpio_request(unsigned gpio, const char *label); 263 - extern void gpio_free(unsigned gpio); 264 - extern int gpio_direction_input(unsigned gpio); 265 - extern int gpio_direction_output(unsigned gpio, int value); 266 - extern int gpio_register_callback(unsigned gpio, 267 - int (*func)(void *arg), 268 - void *); 269 - extern int gpio_unregister_callback(unsigned gpio); 270 - extern void enable_irq_on_gpio_pin(unsigned gpio, int edge); 271 - extern void disable_irq_on_gpio_pin(unsigned gpio); 272 - extern void gpio_pullup(unsigned gpio, int value); 273 - extern int gpio_get_value(unsigned gpio); 274 - extern void gpio_set_value(unsigned gpio, int value); 275 - 276 - #define gpio_get_value_cansleep gpio_get_value 277 - #define gpio_set_value_cansleep gpio_set_value 278 - 279 - /* wrappers to sleep-enable the previous two functions */ 280 - static inline unsigned gpio_to_irq(unsigned gpio) 281 - { 282 - return PIN_TO_PORT(gpio) + IRQ_U300_GPIO_PORT0; 283 - } 284 - 285 - static inline unsigned irq_to_gpio(unsigned irq) 286 - { 287 - /* 288 - * FIXME: This is no 1-1 mapping at all, it points to the 289 - * whole block of 8 pins. 290 - */ 291 - return (irq - IRQ_U300_GPIO_PORT0) << 3; 292 - } 293 - 294 - #endif
+18 -9
arch/arm/mach-u300/include/mach/irqs.h
··· 72 72 73 73 /* DB3150 and DB3200 have only 45 IRQs */ 74 74 #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) 75 - #define U300_NR_IRQS 45 75 + #define U300_VIC_IRQS_END 45 76 76 #endif 77 77 78 78 /* The DB3350-specific interrupt lines */ ··· 88 88 #define IRQ_U300_GPIO_PORT4 53 89 89 #define IRQ_U300_GPIO_PORT5 54 90 90 #define IRQ_U300_GPIO_PORT6 55 91 - #define U300_NR_IRQS 56 91 + #define U300_VIC_IRQS_END 56 92 92 #endif 93 93 94 94 /* The DB3210-specific interrupt lines */ ··· 106 106 #define IRQ_U300_NFIF 45 107 107 #define IRQ_U300_NFIF2 46 108 108 #define IRQ_U300_SYSCON_PLL_LOCK 47 109 - #define U300_NR_IRQS 48 109 + #define U300_VIC_IRQS_END 48 110 110 #endif 111 111 112 - #ifdef CONFIG_AB3550_CORE 113 - #define IRQ_AB3550_BASE (U300_NR_IRQS) 114 - #define IRQ_AB3550_END (IRQ_AB3550_BASE + 37) 115 - 116 - #define NR_IRQS (IRQ_AB3550_END + 1) 112 + /* Maximum 8*7 GPIO lines */ 113 + #ifdef CONFIG_GPIO_U300 114 + #define IRQ_U300_GPIO_BASE (U300_VIC_IRQS_END) 115 + #define IRQ_U300_GPIO_END (IRQ_U300_GPIO_BASE + 56) 117 116 #else 118 - #define NR_IRQS U300_NR_IRQS 117 + #define IRQ_U300_GPIO_END (U300_VIC_IRQS_END) 119 118 #endif 119 + 120 + /* Optional AB3550 mixsig chip */ 121 + #ifdef CONFIG_AB3550_CORE 122 + #define IRQ_AB3550_BASE (IRQ_U300_GPIO_END) 123 + #define IRQ_AB3550_END (IRQ_AB3550_BASE + 38) 124 + #else 125 + #define IRQ_AB3550_END (IRQ_U300_GPIO_END) 126 + #endif 127 + 128 + #define NR_IRQS (IRQ_AB3550_END) 120 129 121 130 #endif
+1 -1
arch/arm/mach-u300/mmc.c
··· 13 13 #include <linux/device.h> 14 14 #include <linux/amba/bus.h> 15 15 #include <linux/mmc/host.h> 16 - #include <linux/gpio.h> 17 16 #include <linux/dmaengine.h> 18 17 #include <linux/amba/mmci.h> 19 18 #include <linux/slab.h> 20 19 #include <mach/coh901318.h> 21 20 #include <mach/dma_channels.h> 21 + #include <mach/gpio-u300.h> 22 22 23 23 #include "mmc.h" 24 24 #include "padmux.h"
+1 -1
arch/arm/mach-ux500/board-mop500-pins.c
··· 6 6 7 7 #include <linux/kernel.h> 8 8 #include <linux/init.h> 9 - #include <linux/gpio.h> 10 9 11 10 #include <asm/mach-types.h> 12 11 #include <plat/pincfg.h> 12 + #include <plat/gpio-nomadik.h> 13 13 #include <mach/hardware.h> 14 14 15 15 #include "pins-db8500.h"
+1 -2
arch/arm/mach-ux500/board-mop500-u8500uib.c
··· 4 4 * Board data for the U8500 UIB, also known as the New UIB 5 5 * License terms: GNU General Public License (GPL), version 2 6 6 */ 7 - 7 + #include <linux/gpio.h> 8 8 #include <linux/kernel.h> 9 9 #include <linux/init.h> 10 10 #include <linux/i2c.h> ··· 13 13 #include <linux/mfd/tc3589x.h> 14 14 #include <linux/input/matrix_keypad.h> 15 15 16 - #include <mach/gpio.h> 17 16 #include <mach/irqs.h> 18 17 19 18 #include "board-mop500.h"
+1
arch/arm/mach-ux500/board-mop500.c
··· 37 37 #include <plat/i2c.h> 38 38 #include <plat/ste_dma40.h> 39 39 #include <plat/pincfg.h> 40 + #include <plat/gpio-nomadik.h> 40 41 41 42 #include <mach/hardware.h> 42 43 #include <mach/setup.h>
+1 -1
arch/arm/mach-ux500/board-u5500-sdi.c
··· 7 7 8 8 #include <linux/amba/mmci.h> 9 9 #include <linux/mmc/host.h> 10 - #include <linux/gpio.h> 11 10 12 11 #include <plat/pincfg.h> 12 + #include <plat/gpio-nomadik.h> 13 13 #include <mach/db5500-regs.h> 14 14 #include <plat/ste_dma40.h> 15 15
+1 -1
arch/arm/mach-ux500/board-u5500.c
··· 8 8 #include <linux/init.h> 9 9 #include <linux/platform_device.h> 10 10 #include <linux/amba/bus.h> 11 - #include <linux/gpio.h> 12 11 #include <linux/irq.h> 13 12 #include <linux/i2c.h> 14 13 ··· 16 17 17 18 #include <plat/pincfg.h> 18 19 #include <plat/i2c.h> 20 + #include <plat/gpio-nomadik.h> 19 21 20 22 #include <mach/hardware.h> 21 23 #include <mach/devices.h>
+1 -1
arch/arm/mach-ux500/cpu-db5500.c
··· 13 13 #include <asm/mach/map.h> 14 14 #include <asm/pmu.h> 15 15 16 - #include <plat/gpio.h> 16 + #include <plat/gpio-nomadik.h> 17 17 18 18 #include <mach/hardware.h> 19 19 #include <mach/devices.h>
+1 -1
arch/arm/mach-ux500/cpu-db8500.c
··· 14 14 #include <linux/amba/bus.h> 15 15 #include <linux/interrupt.h> 16 16 #include <linux/irq.h> 17 - #include <linux/gpio.h> 18 17 #include <linux/platform_device.h> 19 18 #include <linux/io.h> 20 19 21 20 #include <asm/mach/map.h> 22 21 #include <asm/pmu.h> 22 + #include <plat/gpio-nomadik.h> 23 23 #include <mach/hardware.h> 24 24 #include <mach/setup.h> 25 25 #include <mach/devices.h>
+1 -1
arch/arm/mach-ux500/devices-common.c
··· 13 13 #include <linux/platform_device.h> 14 14 #include <linux/amba/bus.h> 15 15 16 - #include <plat/gpio.h> 16 + #include <plat/gpio-nomadik.h> 17 17 18 18 #include <mach/hardware.h> 19 19
-2
arch/arm/mach-ux500/include/mach/gpio.h
··· 7 7 */ 8 8 #define ARCH_NR_GPIOS 350 9 9 10 - #include <plat/gpio.h> 11 - 12 10 #endif /* __ASM_ARCH_GPIO_H */
+1 -6
arch/arm/mach-versatile/include/mach/gpio.h
··· 1 - #include <asm-generic/gpio.h> 2 - 3 - #define gpio_get_value __gpio_get_value 4 - #define gpio_set_value __gpio_set_value 5 - #define gpio_cansleep __gpio_cansleep 6 - #define gpio_to_irq __gpio_to_irq 1 + /* empty */
+1 -6
arch/arm/mach-vt8500/include/mach/gpio.h
··· 1 - #include <asm-generic/gpio.h> 2 - 3 - #define gpio_get_value __gpio_get_value 4 - #define gpio_set_value __gpio_set_value 5 - #define gpio_cansleep __gpio_cansleep 6 - #define gpio_to_irq __gpio_to_irq 1 + /* empty */
+1 -5
arch/arm/mach-w90x900/include/mach/gpio.h
··· 15 15 16 16 #include <mach/hardware.h> 17 17 #include <asm/irq.h> 18 - #include <asm-generic/gpio.h> 19 - 20 - #define gpio_get_value __gpio_get_value 21 - #define gpio_set_value __gpio_set_value 22 - #define gpio_cansleep __gpio_cansleep 23 18 24 19 static inline int gpio_to_irq(unsigned gpio) 25 20 { 26 21 return gpio; 27 22 } 23 + #define gpio_to_irq gpio_to_irq 28 24 29 25 static inline int irq_to_gpio(unsigned irq) 30 26 {
+1 -32
arch/arm/plat-mxc/include/mach/gpio.h
··· 1 - /* 2 - * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. 3 - * Copyright 2008 Juergen Beisert, kernel@pengutronix.de 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * This program is distributed in the hope that it will be useful, 10 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 - * GNU General Public License for more details. 13 - * 14 - * You should have received a copy of the GNU General Public License 15 - * along with this program; if not, write to the Free Software 16 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 - */ 18 - 19 - #ifndef __ASM_ARCH_MXC_GPIO_H__ 20 - #define __ASM_ARCH_MXC_GPIO_H__ 21 - 22 - #include <linux/spinlock.h> 23 - #include <mach/hardware.h> 24 - #include <asm-generic/gpio.h> 25 - 26 - /* use gpiolib dispatchers */ 27 - #define gpio_get_value __gpio_get_value 28 - #define gpio_set_value __gpio_set_value 29 - #define gpio_cansleep __gpio_cansleep 30 - #define gpio_to_irq __gpio_to_irq 31 - 32 - #endif 1 + /* empty */
+3 -14
arch/arm/plat-nomadik/include/plat/gpio.h arch/arm/plat-nomadik/include/plat/gpio-nomadik.h
··· 9 9 * it under the terms of the GNU General Public License version 2 as 10 10 * published by the Free Software Foundation. 11 11 */ 12 - #ifndef __ASM_PLAT_GPIO_H 13 - #define __ASM_PLAT_GPIO_H 14 12 15 - #include <asm-generic/gpio.h> 16 - 17 - /* 18 - * These currently cause a function call to happen, they may be optimized 19 - * if needed by adding cpu-specific defines to identify blocks 20 - * (see mach-pxa/include/mach/gpio.h as an example using GPLR etc) 21 - */ 22 - #define gpio_get_value __gpio_get_value 23 - #define gpio_set_value __gpio_set_value 24 - #define gpio_cansleep __gpio_cansleep 25 - #define gpio_to_irq __gpio_to_irq 13 + #ifndef __PLAT_NOMADIK_GPIO 14 + #define __PLAT_NOMADIK_GPIO 26 15 27 16 /* 28 17 * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving ··· 82 93 bool supports_sleepmode; 83 94 }; 84 95 85 - #endif /* __ASM_PLAT_GPIO_H */ 96 + #endif /* __PLAT_NOMADIK_GPIO */
+1 -2
arch/arm/plat-omap/debug-devices.c
··· 8 8 * it under the terms of the GNU General Public License version 2 as 9 9 * published by the Free Software Foundation. 10 10 */ 11 - 11 + #include <linux/gpio.h> 12 12 #include <linux/kernel.h> 13 13 #include <linux/init.h> 14 14 #include <linux/platform_device.h> ··· 18 18 #include <mach/hardware.h> 19 19 20 20 #include <plat/board.h> 21 - #include <mach/gpio.h> 22 21 23 22 24 23 /* Many OMAP development platforms reuse the same "debug board"; these
+1 -2
arch/arm/plat-omap/debug-leds.c
··· 7 7 * it under the terms of the GNU General Public License version 2 as 8 8 * published by the Free Software Foundation. 9 9 */ 10 - 10 + #include <linux/gpio.h> 11 11 #include <linux/init.h> 12 12 #include <linux/platform_device.h> 13 13 #include <linux/leds.h> ··· 19 19 #include <asm/mach-types.h> 20 20 21 21 #include <plat/fpga.h> 22 - #include <mach/gpio.h> 23 22 24 23 25 24 /* Many OMAP development platforms reuse the same "debug board"; these
+1 -2
arch/arm/plat-omap/devices.c
··· 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 10 */ 11 - 11 + #include <linux/gpio.h> 12 12 #include <linux/module.h> 13 13 #include <linux/kernel.h> 14 14 #include <linux/init.h> ··· 24 24 #include <plat/tc.h> 25 25 #include <plat/board.h> 26 26 #include <plat/mmc.h> 27 - #include <mach/gpio.h> 28 27 #include <plat/menelaus.h> 29 28 #include <plat/mcbsp.h> 30 29 #include <plat/omap44xx.h>
-20
arch/arm/plat-omap/include/plat/gpio.h
··· 222 222 #include <linux/errno.h> 223 223 #include <asm-generic/gpio.h> 224 224 225 - static inline int gpio_get_value(unsigned gpio) 226 - { 227 - return __gpio_get_value(gpio); 228 - } 229 - 230 - static inline void gpio_set_value(unsigned gpio, int value) 231 - { 232 - __gpio_set_value(gpio, value); 233 - } 234 - 235 - static inline int gpio_cansleep(unsigned gpio) 236 - { 237 - return __gpio_cansleep(gpio); 238 - } 239 - 240 - static inline int gpio_to_irq(unsigned gpio) 241 - { 242 - return __gpio_to_irq(gpio); 243 - } 244 - 245 225 static inline int irq_to_gpio(unsigned irq) 246 226 { 247 227 int tmp;
+1 -9
arch/arm/plat-orion/include/plat/gpio.h
··· 12 12 #define __PLAT_GPIO_H 13 13 14 14 #include <linux/init.h> 15 - #include <asm-generic/gpio.h> 16 - 17 - /* 18 - * GENERIC_GPIO primitives. 19 - */ 20 - #define gpio_get_value __gpio_get_value 21 - #define gpio_set_value __gpio_set_value 22 - #define gpio_cansleep __gpio_cansleep 23 - #define gpio_to_irq __gpio_to_irq 15 + #include <linux/types.h> 24 16 25 17 /* 26 18 * Orion-specific GPIO API extensions.
-1
arch/arm/plat-pxa/Makefile
··· 4 4 5 5 obj-y := dma.o 6 6 7 - obj-$(CONFIG_GENERIC_GPIO) += gpio.o 8 7 obj-$(CONFIG_PXA3xx) += mfp.o 9 8 obj-$(CONFIG_PXA95x) += mfp.o 10 9 obj-$(CONFIG_ARCH_MMP) += mfp.o
+2 -2
arch/arm/plat-pxa/gpio.c drivers/gpio/gpio-pxa.c
··· 11 11 * it under the terms of the GNU General Public License version 2 as 12 12 * published by the Free Software Foundation. 13 13 */ 14 - 14 + #include <linux/gpio.h> 15 15 #include <linux/init.h> 16 16 #include <linux/irq.h> 17 17 #include <linux/io.h> 18 18 #include <linux/syscore_ops.h> 19 19 #include <linux/slab.h> 20 20 21 - #include <mach/gpio.h> 21 + #include <mach/gpio-pxa.h> 22 22 23 23 int pxa_last_gpio; 24 24
+44
arch/arm/plat-pxa/include/plat/gpio-pxa.h
··· 1 + #ifndef __PLAT_PXA_GPIO_H 2 + #define __PLAT_PXA_GPIO_H 3 + 4 + struct irq_data; 5 + 6 + /* 7 + * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with 8 + * one set of registers. The register offsets are organized below: 9 + * 10 + * GPLR GPDR GPSR GPCR GRER GFER GEDR 11 + * BANK 0 - 0x0000 0x000C 0x0018 0x0024 0x0030 0x003C 0x0048 12 + * BANK 1 - 0x0004 0x0010 0x001C 0x0028 0x0034 0x0040 0x004C 13 + * BANK 2 - 0x0008 0x0014 0x0020 0x002C 0x0038 0x0044 0x0050 14 + * 15 + * BANK 3 - 0x0100 0x010C 0x0118 0x0124 0x0130 0x013C 0x0148 16 + * BANK 4 - 0x0104 0x0110 0x011C 0x0128 0x0134 0x0140 0x014C 17 + * BANK 5 - 0x0108 0x0114 0x0120 0x012C 0x0138 0x0144 0x0150 18 + * 19 + * NOTE: 20 + * BANK 3 is only available on PXA27x and later processors. 21 + * BANK 4 and 5 are only available on PXA935 22 + */ 23 + 24 + #define GPIO_BANK(n) (GPIO_REGS_VIRT + BANK_OFF(n)) 25 + 26 + #define GPLR_OFFSET 0x00 27 + #define GPDR_OFFSET 0x0C 28 + #define GPSR_OFFSET 0x18 29 + #define GPCR_OFFSET 0x24 30 + #define GRER_OFFSET 0x30 31 + #define GFER_OFFSET 0x3C 32 + #define GEDR_OFFSET 0x48 33 + 34 + /* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85). 35 + * Those cases currently cause holes in the GPIO number space, the 36 + * actual number of the last GPIO is recorded by 'pxa_last_gpio'. 37 + */ 38 + extern int pxa_last_gpio; 39 + 40 + typedef int (*set_wake_t)(struct irq_data *d, unsigned int on); 41 + 42 + extern void pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn); 43 + 44 + #endif /* __PLAT_PXA_GPIO_H */
+3 -37
arch/arm/plat-pxa/include/plat/gpio.h
··· 1 1 #ifndef __PLAT_GPIO_H 2 2 #define __PLAT_GPIO_H 3 3 4 - struct irq_data; 4 + #define __ARM_GPIOLIB_COMPLEX 5 5 6 - /* 7 - * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with 8 - * one set of registers. The register offsets are organized below: 9 - * 10 - * GPLR GPDR GPSR GPCR GRER GFER GEDR 11 - * BANK 0 - 0x0000 0x000C 0x0018 0x0024 0x0030 0x003C 0x0048 12 - * BANK 1 - 0x0004 0x0010 0x001C 0x0028 0x0034 0x0040 0x004C 13 - * BANK 2 - 0x0008 0x0014 0x0020 0x002C 0x0038 0x0044 0x0050 14 - * 15 - * BANK 3 - 0x0100 0x010C 0x0118 0x0124 0x0130 0x013C 0x0148 16 - * BANK 4 - 0x0104 0x0110 0x011C 0x0128 0x0134 0x0140 0x014C 17 - * BANK 5 - 0x0108 0x0114 0x0120 0x012C 0x0138 0x0144 0x0150 18 - * 19 - * NOTE: 20 - * BANK 3 is only available on PXA27x and later processors. 21 - * BANK 4 and 5 are only available on PXA935 22 - */ 23 - 24 - #define GPIO_BANK(n) (GPIO_REGS_VIRT + BANK_OFF(n)) 25 - 26 - #define GPLR_OFFSET 0x00 27 - #define GPDR_OFFSET 0x0C 28 - #define GPSR_OFFSET 0x18 29 - #define GPCR_OFFSET 0x24 30 - #define GRER_OFFSET 0x30 31 - #define GFER_OFFSET 0x3C 32 - #define GEDR_OFFSET 0x48 6 + /* The individual machine provides register offsets and NR_BUILTIN_GPIO */ 7 + #include <mach/gpio-pxa.h> 33 8 34 9 static inline int gpio_get_value(unsigned gpio) 35 10 { ··· 27 52 28 53 #define gpio_cansleep __gpio_cansleep 29 54 30 - /* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85). 31 - * Those cases currently cause holes in the GPIO number space, the 32 - * actual number of the last GPIO is recorded by 'pxa_last_gpio'. 33 - */ 34 - extern int pxa_last_gpio; 35 - 36 - typedef int (*set_wake_t)(struct irq_data *d, unsigned int on); 37 - 38 - extern void pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn); 39 55 #endif /* __PLAT_GPIO_H */
+1 -24
arch/arm/plat-spear/include/plat/gpio.h
··· 1 - /* 2 - * arch/arm/plat-spear/include/plat/gpio.h 3 - * 4 - * GPIO macros for SPEAr platform 5 - * 6 - * Copyright (C) 2009 ST Microelectronics 7 - * Viresh Kumar<viresh.kumar@st.com> 8 - * 9 - * This file is licensed under the terms of the GNU General Public 10 - * License version 2. This program is licensed "as is" without any 11 - * warranty of any kind, whether express or implied. 12 - */ 13 - 14 - #ifndef __PLAT_GPIO_H 15 - #define __PLAT_GPIO_H 16 - 17 - #include <asm-generic/gpio.h> 18 - 19 - #define gpio_get_value __gpio_get_value 20 - #define gpio_set_value __gpio_set_value 21 - #define gpio_cansleep __gpio_cansleep 22 - #define gpio_to_irq __gpio_to_irq 23 - 24 - #endif /* __PLAT_GPIO_H */ 1 + /* empty */
+1 -1
drivers/ata/pata_at91.c
··· 30 30 31 31 #include <mach/at91sam9_smc.h> 32 32 #include <mach/board.h> 33 - #include <mach/gpio.h> 33 + #include <asm/gpio.h> 34 34 35 35 #define DRV_NAME "pata_at91" 36 36 #define DRV_VERSION "0.3"
+9
drivers/gpio/Kconfig
··· 178 178 The Intel Tunnel Creek processor has 5 GPIOs powered by the 179 179 core power rail and 9 from suspend power supply. 180 180 181 + config GPIO_U300 182 + bool "ST-Ericsson U300 COH 901 335/571 GPIO" 183 + depends on GPIOLIB && ARCH_U300 184 + help 185 + Say yes here to support GPIO interface on ST-Ericsson U300. 186 + The names of the two IP block variants supported are 187 + COH 901 335 and COH 901 571/3. They contain 3, 5 or 7 188 + ports of 8 GPIO pins each. 189 + 181 190 config GPIO_VX855 182 191 tristate "VIA VX855/VX875 GPIO" 183 192 depends on MFD_SUPPORT && PCI
+6 -1
drivers/gpio/Makefile
··· 14 14 obj-$(CONFIG_GPIO_BT8XX) += gpio-bt8xx.o 15 15 obj-$(CONFIG_GPIO_CS5535) += gpio-cs5535.o 16 16 obj-$(CONFIG_GPIO_DA9052) += gpio-da9052.o 17 + obj-$(CONFIG_ARCH_DAVINCI) += gpio-davinci.o 17 18 obj-$(CONFIG_GPIO_EP93XX) += gpio-ep93xx.o 18 19 obj-$(CONFIG_GPIO_EXYNOS4) += gpio-exynos4.o 19 20 obj-$(CONFIG_GPIO_IT8761E) += gpio-it8761e.o 20 21 obj-$(CONFIG_GPIO_JANZ_TTL) += gpio-janz-ttl.o 22 + obj-$(CONFIG_MACH_KS8695) += gpio-ks8695.o 21 23 obj-$(CONFIG_GPIO_LANGWELL) += gpio-langwell.o 24 + obj-$(CONFIG_ARCH_LPC32XX) += gpio-lpc32xx.o 22 25 obj-$(CONFIG_GPIO_MAX730X) += gpio-max730x.o 23 26 obj-$(CONFIG_GPIO_MAX7300) += gpio-max7300.o 24 27 obj-$(CONFIG_GPIO_MAX7301) += gpio-max7301.o ··· 40 37 obj-$(CONFIG_GPIO_PCF857X) += gpio-pcf857x.o 41 38 obj-$(CONFIG_GPIO_PCH) += gpio-pch.o 42 39 obj-$(CONFIG_GPIO_PL061) += gpio-pl061.o 40 + obj-$(CONFIG_PLAT_PXA) += gpio-pxa.o 43 41 obj-$(CONFIG_GPIO_RDC321X) += gpio-rdc321x.o 44 42 45 43 obj-$(CONFIG_GPIO_PLAT_SAMSUNG) += gpio-plat-samsung.o 46 44 obj-$(CONFIG_GPIO_S5PC100) += gpio-s5pc100.o 47 45 obj-$(CONFIG_GPIO_S5PV210) += gpio-s5pv210.o 48 - 46 + obj-$(CONFIG_ARCH_SA1100) += gpio-sa1100.o 49 47 obj-$(CONFIG_GPIO_SCH) += gpio-sch.o 50 48 obj-$(CONFIG_GPIO_STMPE) += gpio-stmpe.o 51 49 obj-$(CONFIG_GPIO_SX150X) += gpio-sx150x.o 52 50 obj-$(CONFIG_GPIO_TC3589X) += gpio-tc3589x.o 53 51 obj-$(CONFIG_ARCH_TEGRA) += gpio-tegra.o 54 52 obj-$(CONFIG_GPIO_TIMBERDALE) += gpio-timberdale.o 53 + obj-$(CONFIG_ARCH_DAVINCI_TNETV107X) += gpio-tnetv107x.o 55 54 obj-$(CONFIG_GPIO_TPS65910) += gpio-tps65910.o 56 55 obj-$(CONFIG_GPIO_TPS65912) += gpio-tps65912.o 57 56 obj-$(CONFIG_GPIO_TWL4030) += gpio-twl4030.o
+21 -1
drivers/gpio/gpio-ep93xx.c
··· 23 23 #include <linux/basic_mmio_gpio.h> 24 24 25 25 #include <mach/hardware.h> 26 + #include <mach/gpio-ep93xx.h> 27 + 28 + #define irq_to_gpio(irq) ((irq) - gpio_to_irq(0)) 26 29 27 30 struct ep93xx_gpio { 28 31 void __iomem *mmio_base; ··· 310 307 return 0; 311 308 } 312 309 310 + /* 311 + * Map GPIO A0..A7 (0..7) to irq 64..71, 312 + * B0..B7 (7..15) to irq 72..79, and 313 + * F0..F7 (16..24) to irq 80..87. 314 + */ 315 + static int ep93xx_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 316 + { 317 + int gpio = chip->base + offset; 318 + 319 + if (gpio > EP93XX_GPIO_LINE_MAX_IRQ) 320 + return -EINVAL; 321 + 322 + return 64 + gpio; 323 + } 324 + 313 325 static int ep93xx_gpio_add_bank(struct bgpio_chip *bgc, struct device *dev, 314 326 void __iomem *mmio_base, struct ep93xx_gpio_bank *bank) 315 327 { ··· 339 321 bgc->gc.label = bank->label; 340 322 bgc->gc.base = bank->base; 341 323 342 - if (bank->has_debounce) 324 + if (bank->has_debounce) { 343 325 bgc->gc.set_debounce = ep93xx_gpio_set_debounce; 326 + bgc->gc.to_irq = ep93xx_gpio_to_irq; 327 + } 344 328 345 329 return gpiochip_add(&bgc->gc); 346 330 }
+2 -1
drivers/gpio/gpio-nomadik.c
··· 27 27 #include <asm/mach/irq.h> 28 28 29 29 #include <plat/pincfg.h> 30 + #include <plat/gpio-nomadik.h> 30 31 #include <mach/hardware.h> 31 - #include <mach/gpio.h> 32 + #include <asm/gpio.h> 32 33 33 34 /* 34 35 * The GPIO module in the Nomadik family of Systems-on-Chip is an
+1 -1
drivers/gpio/gpio-omap.c
··· 25 25 #include <mach/hardware.h> 26 26 #include <asm/irq.h> 27 27 #include <mach/irqs.h> 28 - #include <mach/gpio.h> 28 + #include <asm/gpio.h> 29 29 #include <asm/mach/irq.h> 30 30 31 31 struct gpio_bank {
+16 -7
drivers/gpio/gpio-tegra.c
··· 28 28 29 29 #include <asm/mach/irq.h> 30 30 31 + #include <mach/gpio-tegra.h> 31 32 #include <mach/iomap.h> 32 33 #include <mach/suspend.h> 33 34 ··· 137 136 return 0; 138 137 } 139 138 140 - 139 + static int tegra_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 140 + { 141 + return TEGRA_GPIO_TO_IRQ(offset); 142 + } 141 143 142 144 static struct gpio_chip tegra_gpio_chip = { 143 145 .label = "tegra-gpio", ··· 148 144 .get = tegra_gpio_get, 149 145 .direction_output = tegra_gpio_direction_output, 150 146 .set = tegra_gpio_set, 147 + .to_irq = tegra_gpio_to_irq, 151 148 .base = 0, 152 149 .ngpio = TEGRA_NR_GPIOS, 153 150 }; ··· 339 334 { 340 335 struct resource *res; 341 336 struct tegra_gpio_bank *bank; 337 + int gpio; 342 338 int i; 343 339 int j; 344 340 ··· 387 381 388 382 gpiochip_add(&tegra_gpio_chip); 389 383 390 - for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) { 391 - bank = &tegra_gpio_banks[GPIO_BANK(irq_to_gpio(i))]; 384 + for (gpio = 0; gpio < TEGRA_NR_GPIOS; gpio++) { 385 + int irq = TEGRA_GPIO_TO_IRQ(gpio); 386 + /* No validity check; all Tegra GPIOs are valid IRQs */ 392 387 393 - irq_set_lockdep_class(i, &gpio_lock_class); 394 - irq_set_chip_data(i, bank); 395 - irq_set_chip_and_handler(i, &tegra_gpio_irq_chip, 388 + bank = &tegra_gpio_banks[GPIO_BANK(gpio)]; 389 + 390 + irq_set_lockdep_class(irq, &gpio_lock_class); 391 + irq_set_chip_data(irq, bank); 392 + irq_set_chip_and_handler(irq, &tegra_gpio_irq_chip, 396 393 handle_simple_irq); 397 - set_irq_flags(i, IRQF_VALID); 394 + set_irq_flags(irq, IRQF_VALID); 398 395 } 399 396 400 397 for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) {
+732 -512
drivers/gpio/gpio-u300.c
··· 1 1 /* 2 2 * U300 GPIO module. 3 3 * 4 - * Copyright (C) 2007-2009 ST-Ericsson AB 4 + * Copyright (C) 2007-2011 ST-Ericsson AB 5 5 * License terms: GNU General Public License (GPL) version 2 6 6 * This can driver either of the two basic GPIO cores 7 7 * available in the U300 platforms: 8 8 * COH 901 335 - Used in DB3150 (U300 1.0) and DB3200 (U330 1.0) 9 9 * COH 901 571/3 - Used in DB3210 (U365 2.0) and DB3350 (U335 1.0) 10 - * Notice that you also have inline macros in <asm-arch/gpio.h> 11 - * Author: Linus Walleij <linus.walleij@stericsson.com> 10 + * Author: Linus Walleij <linus.walleij@linaro.org> 12 11 * Author: Jonas Aaberg <jonas.aberg@stericsson.com> 13 - * 14 12 */ 15 13 #include <linux/module.h> 14 + #include <linux/irq.h> 16 15 #include <linux/interrupt.h> 17 16 #include <linux/delay.h> 18 17 #include <linux/errno.h> ··· 20 21 #include <linux/err.h> 21 22 #include <linux/platform_device.h> 22 23 #include <linux/gpio.h> 24 + #include <linux/list.h> 25 + #include <linux/slab.h> 26 + #include <mach/gpio-u300.h> 23 27 24 - /* Reference to GPIO block clock */ 25 - static struct clk *clk; 28 + /* 29 + * Bias modes for U300 GPIOs 30 + * 31 + * GPIO_U300_CONFIG_BIAS_UNKNOWN: this bias mode is not known to us 32 + * GPIO_U300_CONFIG_BIAS_FLOAT: no specific bias, the GPIO will float or state 33 + * is not controlled by software 34 + * GPIO_U300_CONFIG_BIAS_PULL_UP: the GPIO will be pulled up (usually with high 35 + * impedance to VDD) 36 + */ 37 + #define GPIO_U300_CONFIG_BIAS_UNKNOWN 0x1000 38 + #define GPIO_U300_CONFIG_BIAS_FLOAT 0x1001 39 + #define GPIO_U300_CONFIG_BIAS_PULL_UP 0x1002 26 40 27 - /* Memory resource */ 28 - static struct resource *memres; 29 - static void __iomem *virtbase; 30 - static struct device *gpiodev; 41 + /* 42 + * Drive modes for U300 GPIOs (output) 43 + * 44 + * GPIO_U300_CONFIG_DRIVE_PUSH_PULL: the GPIO will be driven actively high and 45 + * low, this is the most typical case and is typically achieved with two 46 + * active transistors on the output 47 + * GPIO_U300_CONFIG_DRIVE_OPEN_DRAIN: the GPIO will be driven with open drain 48 + * (open collector) which means it is usually wired with other output 49 + * ports which are then pulled up with an external resistor 50 + * GPIO_U300_CONFIG_DRIVE_OPEN_SOURCE: the GPIO will be driven with open drain 51 + * (open emitter) which is the same as open drain mutatis mutandis but 52 + * pulled to ground 53 + */ 54 + #define GPIO_U300_CONFIG_DRIVE_PUSH_PULL 0x2000 55 + #define GPIO_U300_CONFIG_DRIVE_OPEN_DRAIN 0x2001 56 + #define GPIO_U300_CONFIG_DRIVE_OPEN_SOURCE 0x2002 57 + 58 + /* 59 + * Register definitions for COH 901 335 variant 60 + */ 61 + #define U300_335_PORT_STRIDE (0x1C) 62 + /* Port X Pin Data Register 32bit, this is both input and output (R/W) */ 63 + #define U300_335_PXPDIR (0x00) 64 + #define U300_335_PXPDOR (0x00) 65 + /* Port X Pin Config Register 32bit (R/W) */ 66 + #define U300_335_PXPCR (0x04) 67 + /* This register layout is the same in both blocks */ 68 + #define U300_GPIO_PXPCR_ALL_PINS_MODE_MASK (0x0000FFFFUL) 69 + #define U300_GPIO_PXPCR_PIN_MODE_MASK (0x00000003UL) 70 + #define U300_GPIO_PXPCR_PIN_MODE_SHIFT (0x00000002UL) 71 + #define U300_GPIO_PXPCR_PIN_MODE_INPUT (0x00000000UL) 72 + #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL (0x00000001UL) 73 + #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN (0x00000002UL) 74 + #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE (0x00000003UL) 75 + /* Port X Interrupt Event Register 32bit (R/W) */ 76 + #define U300_335_PXIEV (0x08) 77 + /* Port X Interrupt Enable Register 32bit (R/W) */ 78 + #define U300_335_PXIEN (0x0C) 79 + /* Port X Interrupt Force Register 32bit (R/W) */ 80 + #define U300_335_PXIFR (0x10) 81 + /* Port X Interrupt Config Register 32bit (R/W) */ 82 + #define U300_335_PXICR (0x14) 83 + /* This register layout is the same in both blocks */ 84 + #define U300_GPIO_PXICR_ALL_IRQ_CONFIG_MASK (0x000000FFUL) 85 + #define U300_GPIO_PXICR_IRQ_CONFIG_MASK (0x00000001UL) 86 + #define U300_GPIO_PXICR_IRQ_CONFIG_FALLING_EDGE (0x00000000UL) 87 + #define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE (0x00000001UL) 88 + /* Port X Pull-up Enable Register 32bit (R/W) */ 89 + #define U300_335_PXPER (0x18) 90 + /* This register layout is the same in both blocks */ 91 + #define U300_GPIO_PXPER_ALL_PULL_UP_DISABLE_MASK (0x000000FFUL) 92 + #define U300_GPIO_PXPER_PULL_UP_DISABLE (0x00000001UL) 93 + /* Control Register 32bit (R/W) */ 94 + #define U300_335_CR (0x54) 95 + #define U300_335_CR_BLOCK_CLOCK_ENABLE (0x00000001UL) 96 + 97 + /* 98 + * Register definitions for COH 901 571 / 3 variant 99 + */ 100 + #define U300_571_PORT_STRIDE (0x30) 101 + /* 102 + * Control Register 32bit (R/W) 103 + * bit 15-9 (mask 0x0000FE00) contains the number of cores. 8*cores 104 + * gives the number of GPIO pins. 105 + * bit 8-2 (mask 0x000001FC) contains the core version ID. 106 + */ 107 + #define U300_571_CR (0x00) 108 + #define U300_571_CR_SYNC_SEL_ENABLE (0x00000002UL) 109 + #define U300_571_CR_BLOCK_CLKRQ_ENABLE (0x00000001UL) 110 + /* 111 + * These registers have the same layout and function as the corresponding 112 + * COH 901 335 registers, just at different offset. 113 + */ 114 + #define U300_571_PXPDIR (0x04) 115 + #define U300_571_PXPDOR (0x08) 116 + #define U300_571_PXPCR (0x0C) 117 + #define U300_571_PXPER (0x10) 118 + #define U300_571_PXIEV (0x14) 119 + #define U300_571_PXIEN (0x18) 120 + #define U300_571_PXIFR (0x1C) 121 + #define U300_571_PXICR (0x20) 122 + 123 + /* 8 bits per port, no version has more than 7 ports */ 124 + #define U300_GPIO_PINS_PER_PORT 8 125 + #define U300_GPIO_MAX (U300_GPIO_PINS_PER_PORT * 7) 126 + 127 + struct u300_gpio { 128 + struct gpio_chip chip; 129 + struct list_head port_list; 130 + struct clk *clk; 131 + struct resource *memres; 132 + void __iomem *base; 133 + struct device *dev; 134 + int irq_base; 135 + u32 stride; 136 + /* Register offsets */ 137 + u32 pcr; 138 + u32 dor; 139 + u32 dir; 140 + u32 per; 141 + u32 icr; 142 + u32 ien; 143 + u32 iev; 144 + }; 31 145 32 146 struct u300_gpio_port { 33 - const char *name; 147 + struct list_head node; 148 + struct u300_gpio *gpio; 149 + char name[8]; 34 150 int irq; 35 151 int number; 152 + u8 toggle_edge_mode; 36 153 }; 37 154 155 + /* 156 + * Macro to expand to read a specific register found in the "gpio" 157 + * struct. It requires the struct u300_gpio *gpio variable to exist in 158 + * its context. It calculates the port offset from the given pin 159 + * offset, muliplies by the port stride and adds the register offset 160 + * so it provides a pointer to the desired register. 161 + */ 162 + #define U300_PIN_REG(pin, reg) \ 163 + (gpio->base + (pin >> 3) * gpio->stride + gpio->reg) 38 164 39 - static struct u300_gpio_port gpio_ports[] = { 40 - { 41 - .name = "gpio0", 42 - .number = 0, 43 - }, 44 - { 45 - .name = "gpio1", 46 - .number = 1, 47 - }, 48 - { 49 - .name = "gpio2", 50 - .number = 2, 51 - }, 52 - #ifdef U300_COH901571_3 53 - { 54 - .name = "gpio3", 55 - .number = 3, 56 - }, 57 - { 58 - .name = "gpio4", 59 - .number = 4, 60 - }, 61 - #ifdef CONFIG_MACH_U300_BS335 62 - { 63 - .name = "gpio5", 64 - .number = 5, 65 - }, 66 - { 67 - .name = "gpio6", 68 - .number = 6, 69 - }, 70 - #endif 71 - #endif 165 + /* 166 + * Provides a bitmask for a specific gpio pin inside an 8-bit GPIO 167 + * register. 168 + */ 169 + #define U300_PIN_BIT(pin) \ 170 + (1 << (pin & 0x07)) 72 171 172 + struct u300_gpio_confdata { 173 + u16 bias_mode; 174 + bool output; 175 + int outval; 73 176 }; 74 177 178 + /* BS335 has seven ports of 8 bits each = GPIO pins 0..55 */ 179 + #define BS335_GPIO_NUM_PORTS 7 180 + /* BS365 has five ports of 8 bits each = GPIO pins 0..39 */ 181 + #define BS365_GPIO_NUM_PORTS 5 75 182 76 - #ifdef U300_COH901571_3 183 + #define U300_FLOATING_INPUT { \ 184 + .bias_mode = GPIO_U300_CONFIG_BIAS_FLOAT, \ 185 + .output = false, \ 186 + } 77 187 78 - /* Default input value */ 79 - #define DEFAULT_OUTPUT_LOW 0 80 - #define DEFAULT_OUTPUT_HIGH 1 188 + #define U300_PULL_UP_INPUT { \ 189 + .bias_mode = GPIO_U300_CONFIG_BIAS_PULL_UP, \ 190 + .output = false, \ 191 + } 81 192 82 - /* GPIO Pull-Up status */ 83 - #define DISABLE_PULL_UP 0 84 - #define ENABLE_PULL_UP 1 193 + #define U300_OUTPUT_LOW { \ 194 + .output = true, \ 195 + .outval = 0, \ 196 + } 85 197 86 - #define GPIO_NOT_USED 0 87 - #define GPIO_IN 1 88 - #define GPIO_OUT 2 198 + #define U300_OUTPUT_HIGH { \ 199 + .output = true, \ 200 + .outval = 1, \ 201 + } 89 202 90 - struct u300_gpio_configuration_data { 91 - unsigned char pin_usage; 92 - unsigned char default_output_value; 93 - unsigned char pull_up; 94 - }; 95 203 96 204 /* Initial configuration */ 97 - const struct u300_gpio_configuration_data 98 - u300_gpio_config[U300_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = { 99 - #ifdef CONFIG_MACH_U300_BS335 205 + static const struct __initdata u300_gpio_confdata 206 + bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = { 100 207 /* Port 0, pins 0-7 */ 101 208 { 102 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 103 - {GPIO_OUT, DEFAULT_OUTPUT_HIGH, DISABLE_PULL_UP}, 104 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 105 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 106 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 107 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 108 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 109 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP} 209 + U300_FLOATING_INPUT, 210 + U300_OUTPUT_HIGH, 211 + U300_FLOATING_INPUT, 212 + U300_OUTPUT_LOW, 213 + U300_OUTPUT_LOW, 214 + U300_OUTPUT_LOW, 215 + U300_OUTPUT_LOW, 216 + U300_OUTPUT_LOW, 110 217 }, 111 218 /* Port 1, pins 0-7 */ 112 219 { 113 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 114 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 115 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 116 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 117 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 118 - {GPIO_OUT, DEFAULT_OUTPUT_HIGH, DISABLE_PULL_UP}, 119 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 120 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP} 220 + U300_OUTPUT_LOW, 221 + U300_OUTPUT_LOW, 222 + U300_OUTPUT_LOW, 223 + U300_PULL_UP_INPUT, 224 + U300_FLOATING_INPUT, 225 + U300_OUTPUT_HIGH, 226 + U300_OUTPUT_LOW, 227 + U300_OUTPUT_LOW, 121 228 }, 122 229 /* Port 2, pins 0-7 */ 123 230 { 124 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 125 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 126 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 127 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 128 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 129 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 130 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 131 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP} 231 + U300_FLOATING_INPUT, 232 + U300_FLOATING_INPUT, 233 + U300_FLOATING_INPUT, 234 + U300_FLOATING_INPUT, 235 + U300_OUTPUT_LOW, 236 + U300_PULL_UP_INPUT, 237 + U300_OUTPUT_LOW, 238 + U300_PULL_UP_INPUT, 132 239 }, 133 240 /* Port 3, pins 0-7 */ 134 241 { 135 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 136 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 137 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 138 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 139 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 140 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 141 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 142 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP} 242 + U300_PULL_UP_INPUT, 243 + U300_OUTPUT_LOW, 244 + U300_FLOATING_INPUT, 245 + U300_FLOATING_INPUT, 246 + U300_FLOATING_INPUT, 247 + U300_FLOATING_INPUT, 248 + U300_FLOATING_INPUT, 249 + U300_FLOATING_INPUT, 143 250 }, 144 251 /* Port 4, pins 0-7 */ 145 252 { 146 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 147 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 148 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 149 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 150 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 151 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 152 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 153 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP} 253 + U300_FLOATING_INPUT, 254 + U300_FLOATING_INPUT, 255 + U300_FLOATING_INPUT, 256 + U300_FLOATING_INPUT, 257 + U300_FLOATING_INPUT, 258 + U300_FLOATING_INPUT, 259 + U300_FLOATING_INPUT, 260 + U300_FLOATING_INPUT, 154 261 }, 155 262 /* Port 5, pins 0-7 */ 156 263 { 157 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 158 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 159 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 160 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 161 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 162 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 163 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 164 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP} 264 + U300_FLOATING_INPUT, 265 + U300_FLOATING_INPUT, 266 + U300_FLOATING_INPUT, 267 + U300_FLOATING_INPUT, 268 + U300_FLOATING_INPUT, 269 + U300_FLOATING_INPUT, 270 + U300_FLOATING_INPUT, 271 + U300_FLOATING_INPUT, 165 272 }, 166 273 /* Port 6, pind 0-7 */ 167 274 { 168 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 169 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 170 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 171 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 172 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 173 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 174 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 175 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP} 275 + U300_FLOATING_INPUT, 276 + U300_FLOATING_INPUT, 277 + U300_FLOATING_INPUT, 278 + U300_FLOATING_INPUT, 279 + U300_FLOATING_INPUT, 280 + U300_FLOATING_INPUT, 281 + U300_FLOATING_INPUT, 282 + U300_FLOATING_INPUT, 176 283 } 177 - #endif 284 + }; 178 285 179 - #ifdef CONFIG_MACH_U300_BS365 286 + static const struct __initdata u300_gpio_confdata 287 + bs365_gpio_config[BS365_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = { 180 288 /* Port 0, pins 0-7 */ 181 289 { 182 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 183 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 184 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 185 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 186 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 187 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 188 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 189 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP} 290 + U300_FLOATING_INPUT, 291 + U300_OUTPUT_LOW, 292 + U300_FLOATING_INPUT, 293 + U300_OUTPUT_LOW, 294 + U300_OUTPUT_LOW, 295 + U300_OUTPUT_LOW, 296 + U300_PULL_UP_INPUT, 297 + U300_FLOATING_INPUT, 190 298 }, 191 299 /* Port 1, pins 0-7 */ 192 300 { 193 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 194 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 195 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 196 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 197 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 198 - {GPIO_OUT, DEFAULT_OUTPUT_HIGH, DISABLE_PULL_UP}, 199 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 200 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP} 301 + U300_OUTPUT_LOW, 302 + U300_FLOATING_INPUT, 303 + U300_OUTPUT_LOW, 304 + U300_FLOATING_INPUT, 305 + U300_FLOATING_INPUT, 306 + U300_OUTPUT_HIGH, 307 + U300_OUTPUT_LOW, 308 + U300_OUTPUT_LOW, 201 309 }, 202 310 /* Port 2, pins 0-7 */ 203 311 { 204 - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 205 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 206 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 207 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}, 208 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 209 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 210 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 211 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP} 312 + U300_FLOATING_INPUT, 313 + U300_PULL_UP_INPUT, 314 + U300_OUTPUT_LOW, 315 + U300_OUTPUT_LOW, 316 + U300_PULL_UP_INPUT, 317 + U300_PULL_UP_INPUT, 318 + U300_PULL_UP_INPUT, 319 + U300_PULL_UP_INPUT, 212 320 }, 213 321 /* Port 3, pins 0-7 */ 214 322 { 215 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 216 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 217 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 218 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 219 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 220 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 221 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 222 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP} 323 + U300_PULL_UP_INPUT, 324 + U300_PULL_UP_INPUT, 325 + U300_PULL_UP_INPUT, 326 + U300_PULL_UP_INPUT, 327 + U300_PULL_UP_INPUT, 328 + U300_PULL_UP_INPUT, 329 + U300_PULL_UP_INPUT, 330 + U300_PULL_UP_INPUT, 223 331 }, 224 332 /* Port 4, pins 0-7 */ 225 333 { 226 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 227 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 228 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 229 - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 334 + U300_PULL_UP_INPUT, 335 + U300_PULL_UP_INPUT, 336 + U300_PULL_UP_INPUT, 337 + U300_PULL_UP_INPUT, 230 338 /* These 4 pins doesn't exist on DB3210 */ 231 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 232 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 233 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}, 234 - {GPIO_OUT, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP} 339 + U300_OUTPUT_LOW, 340 + U300_OUTPUT_LOW, 341 + U300_OUTPUT_LOW, 342 + U300_OUTPUT_LOW, 235 343 } 236 - #endif 237 - }; 238 - #endif 239 - 240 - 241 - /* No users == we can power down GPIO */ 242 - static int gpio_users; 243 - 244 - struct gpio_struct { 245 - int (*callback)(void *); 246 - void *data; 247 - int users; 248 344 }; 249 345 250 - static struct gpio_struct gpio_pin[U300_GPIO_MAX]; 251 - 252 - /* 253 - * Let drivers register callback in order to get notified when there is 254 - * an interrupt on the gpio pin 346 + /** 347 + * to_u300_gpio() - get the pointer to u300_gpio 348 + * @chip: the gpio chip member of the structure u300_gpio 255 349 */ 256 - int gpio_register_callback(unsigned gpio, int (*func)(void *arg), void *data) 350 + static inline struct u300_gpio *to_u300_gpio(struct gpio_chip *chip) 257 351 { 258 - if (gpio_pin[gpio].callback) 259 - dev_warn(gpiodev, "%s: WARNING: callback already " 260 - "registered for gpio pin#%d\n", __func__, gpio); 261 - gpio_pin[gpio].callback = func; 262 - gpio_pin[gpio].data = data; 263 - 264 - return 0; 352 + return container_of(chip, struct u300_gpio, chip); 265 353 } 266 - EXPORT_SYMBOL(gpio_register_callback); 267 354 268 - int gpio_unregister_callback(unsigned gpio) 355 + static int u300_gpio_get(struct gpio_chip *chip, unsigned offset) 269 356 { 270 - if (!gpio_pin[gpio].callback) 271 - dev_warn(gpiodev, "%s: WARNING: callback already " 272 - "unregistered for gpio pin#%d\n", __func__, gpio); 273 - gpio_pin[gpio].callback = NULL; 274 - gpio_pin[gpio].data = NULL; 357 + struct u300_gpio *gpio = to_u300_gpio(chip); 275 358 276 - return 0; 359 + return readl(U300_PIN_REG(offset, dir)) & U300_PIN_BIT(offset); 277 360 } 278 - EXPORT_SYMBOL(gpio_unregister_callback); 279 361 280 - /* Non-zero means valid */ 281 - int gpio_is_valid(int number) 362 + static void u300_gpio_set(struct gpio_chip *chip, unsigned offset, int value) 282 363 { 283 - if (number >= 0 && 284 - number < (U300_GPIO_NUM_PORTS * U300_GPIO_PINS_PER_PORT)) 285 - return 1; 286 - return 0; 287 - } 288 - EXPORT_SYMBOL(gpio_is_valid); 364 + struct u300_gpio *gpio = to_u300_gpio(chip); 365 + unsigned long flags; 366 + u32 val; 289 367 290 - int gpio_request(unsigned gpio, const char *label) 291 - { 292 - if (gpio_pin[gpio].users) 293 - return -EINVAL; 368 + local_irq_save(flags); 369 + 370 + val = readl(U300_PIN_REG(offset, dor)); 371 + if (value) 372 + writel(val | U300_PIN_BIT(offset), U300_PIN_REG(offset, dor)); 294 373 else 295 - gpio_pin[gpio].users++; 374 + writel(val & ~U300_PIN_BIT(offset), U300_PIN_REG(offset, dor)); 296 375 297 - gpio_users++; 298 - 299 - return 0; 300 - } 301 - EXPORT_SYMBOL(gpio_request); 302 - 303 - void gpio_free(unsigned gpio) 304 - { 305 - gpio_users--; 306 - gpio_pin[gpio].users--; 307 - if (unlikely(gpio_pin[gpio].users < 0)) { 308 - dev_warn(gpiodev, "warning: gpio#%d release mismatch\n", 309 - gpio); 310 - gpio_pin[gpio].users = 0; 311 - } 312 - 313 - return; 314 - } 315 - EXPORT_SYMBOL(gpio_free); 316 - 317 - /* This returns zero or nonzero */ 318 - int gpio_get_value(unsigned gpio) 319 - { 320 - return readl(virtbase + U300_GPIO_PXPDIR + 321 - PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING) & (1 << (gpio & 0x07)); 322 - } 323 - EXPORT_SYMBOL(gpio_get_value); 324 - 325 - /* 326 - * We hope that the compiler will optimize away the unused branch 327 - * in case "value" is a constant 328 - */ 329 - void gpio_set_value(unsigned gpio, int value) 330 - { 331 - u32 val; 332 - unsigned long flags; 333 - 334 - local_irq_save(flags); 335 - if (value) { 336 - /* set */ 337 - val = readl(virtbase + U300_GPIO_PXPDOR + 338 - PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING) 339 - & (1 << (gpio & 0x07)); 340 - writel(val | (1 << (gpio & 0x07)), virtbase + 341 - U300_GPIO_PXPDOR + 342 - PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING); 343 - } else { 344 - /* clear */ 345 - val = readl(virtbase + U300_GPIO_PXPDOR + 346 - PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING) 347 - & (1 << (gpio & 0x07)); 348 - writel(val & ~(1 << (gpio & 0x07)), virtbase + 349 - U300_GPIO_PXPDOR + 350 - PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING); 351 - } 352 376 local_irq_restore(flags); 353 377 } 354 - EXPORT_SYMBOL(gpio_set_value); 355 378 356 - int gpio_direction_input(unsigned gpio) 379 + static int u300_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 357 380 { 381 + struct u300_gpio *gpio = to_u300_gpio(chip); 358 382 unsigned long flags; 359 383 u32 val; 360 384 361 - if (gpio > U300_GPIO_MAX) 362 - return -EINVAL; 363 - 364 385 local_irq_save(flags); 365 - val = readl(virtbase + U300_GPIO_PXPCR + PIN_TO_PORT(gpio) * 366 - U300_GPIO_PORTX_SPACING); 367 - /* Mask out this pin*/ 368 - val &= ~(U300_GPIO_PXPCR_PIN_MODE_MASK << ((gpio & 0x07) << 1)); 369 - /* This is not needed since it sets the bits to zero.*/ 370 - /* val |= (U300_GPIO_PXPCR_PIN_MODE_INPUT << (gpio*2)); */ 371 - writel(val, virtbase + U300_GPIO_PXPCR + PIN_TO_PORT(gpio) * 372 - U300_GPIO_PORTX_SPACING); 386 + val = readl(U300_PIN_REG(offset, pcr)); 387 + /* Mask out this pin, note 2 bits per setting */ 388 + val &= ~(U300_GPIO_PXPCR_PIN_MODE_MASK << ((offset & 0x07) << 1)); 389 + writel(val, U300_PIN_REG(offset, pcr)); 373 390 local_irq_restore(flags); 374 391 return 0; 375 392 } 376 - EXPORT_SYMBOL(gpio_direction_input); 377 393 378 - int gpio_direction_output(unsigned gpio, int value) 394 + static int u300_gpio_direction_output(struct gpio_chip *chip, unsigned offset, 395 + int value) 379 396 { 397 + struct u300_gpio *gpio = to_u300_gpio(chip); 380 398 unsigned long flags; 399 + u32 oldmode; 381 400 u32 val; 382 401 383 - if (gpio > U300_GPIO_MAX) 384 - return -EINVAL; 385 - 386 402 local_irq_save(flags); 387 - val = readl(virtbase + U300_GPIO_PXPCR + PIN_TO_PORT(gpio) * 388 - U300_GPIO_PORTX_SPACING); 389 - /* Mask out this pin */ 390 - val &= ~(U300_GPIO_PXPCR_PIN_MODE_MASK << ((gpio & 0x07) << 1)); 403 + val = readl(U300_PIN_REG(offset, pcr)); 391 404 /* 392 - * FIXME: configure for push/pull, open drain or open source per pin 393 - * in setup. The current driver will only support push/pull. 405 + * Drive mode must be set by the special mode set function, set 406 + * push/pull mode by default if no mode has been selected. 394 407 */ 395 - val |= (U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL 396 - << ((gpio & 0x07) << 1)); 397 - writel(val, virtbase + U300_GPIO_PXPCR + PIN_TO_PORT(gpio) * 398 - U300_GPIO_PORTX_SPACING); 399 - gpio_set_value(gpio, value); 408 + oldmode = val & (U300_GPIO_PXPCR_PIN_MODE_MASK << 409 + ((offset & 0x07) << 1)); 410 + /* mode = 0 means input, else some mode is already set */ 411 + if (oldmode == 0) { 412 + val &= ~(U300_GPIO_PXPCR_PIN_MODE_MASK << 413 + ((offset & 0x07) << 1)); 414 + val |= (U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL 415 + << ((offset & 0x07) << 1)); 416 + writel(val, U300_PIN_REG(offset, pcr)); 417 + } 418 + u300_gpio_set(chip, offset, value); 400 419 local_irq_restore(flags); 401 420 return 0; 402 421 } 403 - EXPORT_SYMBOL(gpio_direction_output); 404 422 405 - /* 406 - * Enable an IRQ, edge is rising edge (!= 0) or falling edge (==0). 407 - */ 408 - void enable_irq_on_gpio_pin(unsigned gpio, int edge) 423 + static int u300_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 409 424 { 410 - u32 val; 411 - unsigned long flags; 412 - local_irq_save(flags); 425 + struct u300_gpio *gpio = to_u300_gpio(chip); 426 + int retirq = gpio->irq_base + offset; 413 427 414 - val = readl(virtbase + U300_GPIO_PXIEN + PIN_TO_PORT(gpio) * 415 - U300_GPIO_PORTX_SPACING); 416 - val |= (1 << (gpio & 0x07)); 417 - writel(val, virtbase + U300_GPIO_PXIEN + PIN_TO_PORT(gpio) * 418 - U300_GPIO_PORTX_SPACING); 419 - val = readl(virtbase + U300_GPIO_PXICR + PIN_TO_PORT(gpio) * 420 - U300_GPIO_PORTX_SPACING); 421 - if (edge) 422 - val |= (1 << (gpio & 0x07)); 423 - else 424 - val &= ~(1 << (gpio & 0x07)); 425 - writel(val, virtbase + U300_GPIO_PXICR + PIN_TO_PORT(gpio) * 426 - U300_GPIO_PORTX_SPACING); 427 - local_irq_restore(flags); 428 + dev_dbg(gpio->dev, "request IRQ for GPIO %d, return %d\n", offset, 429 + retirq); 430 + return retirq; 428 431 } 429 - EXPORT_SYMBOL(enable_irq_on_gpio_pin); 430 432 431 - void disable_irq_on_gpio_pin(unsigned gpio) 433 + static int u300_gpio_config(struct gpio_chip *chip, unsigned offset, 434 + u16 param, unsigned long *data) 432 435 { 433 - u32 val; 436 + struct u300_gpio *gpio = to_u300_gpio(chip); 434 437 unsigned long flags; 438 + u32 val; 435 439 436 440 local_irq_save(flags); 437 - val = readl(virtbase + U300_GPIO_PXIEN + PIN_TO_PORT(gpio) * 438 - U300_GPIO_PORTX_SPACING); 439 - val &= ~(1 << (gpio & 0x07)); 440 - writel(val, virtbase + U300_GPIO_PXIEN + PIN_TO_PORT(gpio) * 441 - U300_GPIO_PORTX_SPACING); 442 - local_irq_restore(flags); 443 - } 444 - EXPORT_SYMBOL(disable_irq_on_gpio_pin); 445 - 446 - /* Enable (value == 0) or disable (value == 1) internal pullup */ 447 - void gpio_pullup(unsigned gpio, int value) 448 - { 449 - u32 val; 450 - unsigned long flags; 451 - 452 - local_irq_save(flags); 453 - if (value) { 454 - val = readl(virtbase + U300_GPIO_PXPER + PIN_TO_PORT(gpio) * 455 - U300_GPIO_PORTX_SPACING); 456 - writel(val | (1 << (gpio & 0x07)), virtbase + U300_GPIO_PXPER + 457 - PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING); 458 - } else { 459 - val = readl(virtbase + U300_GPIO_PXPER + PIN_TO_PORT(gpio) * 460 - U300_GPIO_PORTX_SPACING); 461 - writel(val & ~(1 << (gpio & 0x07)), virtbase + U300_GPIO_PXPER + 462 - PIN_TO_PORT(gpio) * U300_GPIO_PORTX_SPACING); 463 - } 464 - local_irq_restore(flags); 465 - } 466 - EXPORT_SYMBOL(gpio_pullup); 467 - 468 - static irqreturn_t gpio_irq_handler(int irq, void *dev_id) 469 - { 470 - struct u300_gpio_port *port = dev_id; 471 - u32 val; 472 - int pin; 473 - 474 - /* Read event register */ 475 - val = readl(virtbase + U300_GPIO_PXIEV + port->number * 476 - U300_GPIO_PORTX_SPACING); 477 - /* Mask with enable register */ 478 - val &= readl(virtbase + U300_GPIO_PXIEV + port->number * 479 - U300_GPIO_PORTX_SPACING); 480 - /* Mask relevant bits */ 481 - val &= U300_GPIO_PXIEV_ALL_IRQ_EVENT_MASK; 482 - /* ACK IRQ (clear event) */ 483 - writel(val, virtbase + U300_GPIO_PXIEV + port->number * 484 - U300_GPIO_PORTX_SPACING); 485 - /* Print message */ 486 - while (val != 0) { 487 - unsigned gpio; 488 - 489 - pin = __ffs(val); 490 - /* mask off this pin */ 491 - val &= ~(1 << pin); 492 - gpio = (port->number << 3) + pin; 493 - 494 - if (gpio_pin[gpio].callback) 495 - (void)gpio_pin[gpio].callback(gpio_pin[gpio].data); 496 - else 497 - dev_dbg(gpiodev, "stray GPIO IRQ on line %d\n", 498 - gpio); 499 - } 500 - return IRQ_HANDLED; 501 - } 502 - 503 - static void gpio_set_initial_values(void) 504 - { 505 - #ifdef U300_COH901571_3 506 - int i, j; 507 - unsigned long flags; 508 - u32 val; 509 - 510 - /* Write default values to all pins */ 511 - for (i = 0; i < U300_GPIO_NUM_PORTS; i++) { 512 - val = 0; 513 - for (j = 0; j < 8; j++) 514 - val |= (u32) (u300_gpio_config[i][j].default_output_value != DEFAULT_OUTPUT_LOW) << j; 515 - local_irq_save(flags); 516 - writel(val, virtbase + U300_GPIO_PXPDOR + i * U300_GPIO_PORTX_SPACING); 441 + switch (param) { 442 + case GPIO_U300_CONFIG_BIAS_UNKNOWN: 443 + case GPIO_U300_CONFIG_BIAS_FLOAT: 444 + val = readl(U300_PIN_REG(offset, per)); 445 + writel(val | U300_PIN_BIT(offset), U300_PIN_REG(offset, per)); 446 + break; 447 + case GPIO_U300_CONFIG_BIAS_PULL_UP: 448 + val = readl(U300_PIN_REG(offset, per)); 449 + writel(val & ~U300_PIN_BIT(offset), U300_PIN_REG(offset, per)); 450 + break; 451 + case GPIO_U300_CONFIG_DRIVE_PUSH_PULL: 452 + val = readl(U300_PIN_REG(offset, pcr)); 453 + val &= ~(U300_GPIO_PXPCR_PIN_MODE_MASK 454 + << ((offset & 0x07) << 1)); 455 + val |= (U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL 456 + << ((offset & 0x07) << 1)); 457 + writel(val, U300_PIN_REG(offset, pcr)); 458 + break; 459 + case GPIO_U300_CONFIG_DRIVE_OPEN_DRAIN: 460 + val = readl(U300_PIN_REG(offset, pcr)); 461 + val &= ~(U300_GPIO_PXPCR_PIN_MODE_MASK 462 + << ((offset & 0x07) << 1)); 463 + val |= (U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN 464 + << ((offset & 0x07) << 1)); 465 + writel(val, U300_PIN_REG(offset, pcr)); 466 + break; 467 + case GPIO_U300_CONFIG_DRIVE_OPEN_SOURCE: 468 + val = readl(U300_PIN_REG(offset, pcr)); 469 + val &= ~(U300_GPIO_PXPCR_PIN_MODE_MASK 470 + << ((offset & 0x07) << 1)); 471 + val |= (U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE 472 + << ((offset & 0x07) << 1)); 473 + writel(val, U300_PIN_REG(offset, pcr)); 474 + break; 475 + default: 517 476 local_irq_restore(flags); 477 + dev_err(gpio->dev, "illegal configuration requested\n"); 478 + return -EINVAL; 479 + } 480 + local_irq_restore(flags); 481 + return 0; 482 + } 483 + 484 + static struct gpio_chip u300_gpio_chip = { 485 + .label = "u300-gpio-chip", 486 + .owner = THIS_MODULE, 487 + .get = u300_gpio_get, 488 + .set = u300_gpio_set, 489 + .direction_input = u300_gpio_direction_input, 490 + .direction_output = u300_gpio_direction_output, 491 + .to_irq = u300_gpio_to_irq, 492 + }; 493 + 494 + static void u300_toggle_trigger(struct u300_gpio *gpio, unsigned offset) 495 + { 496 + u32 val; 497 + 498 + val = readl(U300_PIN_REG(offset, icr)); 499 + /* Set mode depending on state */ 500 + if (u300_gpio_get(&gpio->chip, offset)) { 501 + /* High now, let's trigger on falling edge next then */ 502 + writel(val & ~U300_PIN_BIT(offset), U300_PIN_REG(offset, icr)); 503 + dev_dbg(gpio->dev, "next IRQ on falling edge on pin %d\n", 504 + offset); 505 + } else { 506 + /* Low now, let's trigger on rising edge next then */ 507 + writel(val | U300_PIN_BIT(offset), U300_PIN_REG(offset, icr)); 508 + dev_dbg(gpio->dev, "next IRQ on rising edge on pin %d\n", 509 + offset); 510 + } 511 + } 512 + 513 + static int u300_gpio_irq_type(struct irq_data *d, unsigned trigger) 514 + { 515 + struct u300_gpio_port *port = irq_data_get_irq_chip_data(d); 516 + struct u300_gpio *gpio = port->gpio; 517 + int offset = d->irq - gpio->irq_base; 518 + u32 val; 519 + 520 + if ((trigger & IRQF_TRIGGER_RISING) && 521 + (trigger & IRQF_TRIGGER_FALLING)) { 522 + /* 523 + * The GPIO block can only trigger on falling OR rising edges, 524 + * not both. So we need to toggle the mode whenever the pin 525 + * goes from one state to the other with a special state flag 526 + */ 527 + dev_dbg(gpio->dev, 528 + "trigger on both rising and falling edge on pin %d\n", 529 + offset); 530 + port->toggle_edge_mode |= U300_PIN_BIT(offset); 531 + u300_toggle_trigger(gpio, offset); 532 + } else if (trigger & IRQF_TRIGGER_RISING) { 533 + dev_dbg(gpio->dev, "trigger on rising edge on pin %d\n", 534 + offset); 535 + val = readl(U300_PIN_REG(offset, icr)); 536 + writel(val | U300_PIN_BIT(offset), U300_PIN_REG(offset, icr)); 537 + port->toggle_edge_mode &= ~U300_PIN_BIT(offset); 538 + } else if (trigger & IRQF_TRIGGER_FALLING) { 539 + dev_dbg(gpio->dev, "trigger on falling edge on pin %d\n", 540 + offset); 541 + val = readl(U300_PIN_REG(offset, icr)); 542 + writel(val & ~U300_PIN_BIT(offset), U300_PIN_REG(offset, icr)); 543 + port->toggle_edge_mode &= ~U300_PIN_BIT(offset); 518 544 } 519 545 520 - /* 521 - * Put all pins that are set to either 'GPIO_OUT' or 'GPIO_NOT_USED' 522 - * to output and 'GPIO_IN' to input for each port. And initialize 523 - * default value on outputs. 524 - */ 525 - for (i = 0; i < U300_GPIO_NUM_PORTS; i++) { 526 - for (j = 0; j < U300_GPIO_PINS_PER_PORT; j++) { 527 - local_irq_save(flags); 528 - val = readl(virtbase + U300_GPIO_PXPCR + 529 - i * U300_GPIO_PORTX_SPACING); 530 - /* Mask out this pin */ 531 - val &= ~(U300_GPIO_PXPCR_PIN_MODE_MASK << (j << 1)); 546 + return 0; 547 + } 532 548 533 - if (u300_gpio_config[i][j].pin_usage != GPIO_IN) 534 - val |= (U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL << (j << 1)); 535 - writel(val, virtbase + U300_GPIO_PXPCR + 536 - i * U300_GPIO_PORTX_SPACING); 537 - local_irq_restore(flags); 549 + static void u300_gpio_irq_enable(struct irq_data *d) 550 + { 551 + struct u300_gpio_port *port = irq_data_get_irq_chip_data(d); 552 + struct u300_gpio *gpio = port->gpio; 553 + int offset = d->irq - gpio->irq_base; 554 + u32 val; 555 + unsigned long flags; 556 + 557 + local_irq_save(flags); 558 + val = readl(U300_PIN_REG(offset, ien)); 559 + writel(val | U300_PIN_BIT(offset), U300_PIN_REG(offset, ien)); 560 + local_irq_restore(flags); 561 + } 562 + 563 + static void u300_gpio_irq_disable(struct irq_data *d) 564 + { 565 + struct u300_gpio_port *port = irq_data_get_irq_chip_data(d); 566 + struct u300_gpio *gpio = port->gpio; 567 + int offset = d->irq - gpio->irq_base; 568 + u32 val; 569 + unsigned long flags; 570 + 571 + local_irq_save(flags); 572 + val = readl(U300_PIN_REG(offset, ien)); 573 + writel(val & ~U300_PIN_BIT(offset), U300_PIN_REG(offset, ien)); 574 + local_irq_restore(flags); 575 + } 576 + 577 + static struct irq_chip u300_gpio_irqchip = { 578 + .name = "u300-gpio-irqchip", 579 + .irq_enable = u300_gpio_irq_enable, 580 + .irq_disable = u300_gpio_irq_disable, 581 + .irq_set_type = u300_gpio_irq_type, 582 + 583 + }; 584 + 585 + static void u300_gpio_irq_handler(unsigned irq, struct irq_desc *desc) 586 + { 587 + struct u300_gpio_port *port = irq_get_handler_data(irq); 588 + struct u300_gpio *gpio = port->gpio; 589 + int pinoffset = port->number << 3; /* get the right stride */ 590 + unsigned long val; 591 + 592 + desc->irq_data.chip->irq_ack(&desc->irq_data); 593 + /* Read event register */ 594 + val = readl(U300_PIN_REG(pinoffset, iev)); 595 + /* Mask relevant bits */ 596 + val &= 0xFFU; /* 8 bits per port */ 597 + /* ACK IRQ (clear event) */ 598 + writel(val, U300_PIN_REG(pinoffset, iev)); 599 + 600 + /* Call IRQ handler */ 601 + if (val != 0) { 602 + int irqoffset; 603 + 604 + for_each_set_bit(irqoffset, &val, U300_GPIO_PINS_PER_PORT) { 605 + int pin_irq = gpio->irq_base + (port->number << 3) 606 + + irqoffset; 607 + int offset = pinoffset + irqoffset; 608 + 609 + dev_dbg(gpio->dev, "GPIO IRQ %d on pin %d\n", 610 + pin_irq, offset); 611 + generic_handle_irq(pin_irq); 612 + /* 613 + * Triggering IRQ on both rising and falling edge 614 + * needs mockery 615 + */ 616 + if (port->toggle_edge_mode & U300_PIN_BIT(offset)) 617 + u300_toggle_trigger(gpio, offset); 538 618 } 539 619 } 540 620 541 - /* Enable or disable the internal pull-ups in the GPIO ASIC block */ 542 - for (i = 0; i < U300_GPIO_MAX; i++) { 543 - val = 0; 544 - for (j = 0; j < 8; j++) 545 - val |= (u32)((u300_gpio_config[i][j].pull_up == DISABLE_PULL_UP) << j); 546 - local_irq_save(flags); 547 - writel(val, virtbase + U300_GPIO_PXPER + i * U300_GPIO_PORTX_SPACING); 548 - local_irq_restore(flags); 549 - } 550 - #endif 621 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 551 622 } 552 623 553 - static int __init gpio_probe(struct platform_device *pdev) 624 + static void __init u300_gpio_init_pin(struct u300_gpio *gpio, 625 + int offset, 626 + const struct u300_gpio_confdata *conf) 554 627 { 555 - u32 val; 556 - int err = 0; 557 - int i; 558 - int num_irqs; 628 + /* Set mode: input or output */ 629 + if (conf->output) { 630 + u300_gpio_direction_output(&gpio->chip, offset, conf->outval); 559 631 560 - gpiodev = &pdev->dev; 561 - memset(gpio_pin, 0, sizeof(gpio_pin)); 632 + /* Deactivate bias mode for output */ 633 + u300_gpio_config(&gpio->chip, offset, 634 + GPIO_U300_CONFIG_BIAS_FLOAT, 635 + NULL); 636 + 637 + /* Set drive mode for output */ 638 + u300_gpio_config(&gpio->chip, offset, 639 + GPIO_U300_CONFIG_DRIVE_PUSH_PULL, NULL); 640 + 641 + dev_dbg(gpio->dev, "set up pin %d as output, value: %d\n", 642 + offset, conf->outval); 643 + } else { 644 + u300_gpio_direction_input(&gpio->chip, offset); 645 + 646 + /* Always set output low on input pins */ 647 + u300_gpio_set(&gpio->chip, offset, 0); 648 + 649 + /* Set bias mode for input */ 650 + u300_gpio_config(&gpio->chip, offset, conf->bias_mode, NULL); 651 + 652 + dev_dbg(gpio->dev, "set up pin %d as input, bias: %04x\n", 653 + offset, conf->bias_mode); 654 + } 655 + } 656 + 657 + static void __init u300_gpio_init_coh901571(struct u300_gpio *gpio, 658 + struct u300_gpio_platform *plat) 659 + { 660 + int i, j; 661 + 662 + /* Write default config and values to all pins */ 663 + for (i = 0; i < plat->ports; i++) { 664 + for (j = 0; j < 8; j++) { 665 + const struct u300_gpio_confdata *conf; 666 + int offset = (i*8) + j; 667 + 668 + if (plat->variant == U300_GPIO_COH901571_3_BS335) 669 + conf = &bs335_gpio_config[i][j]; 670 + else if (plat->variant == U300_GPIO_COH901571_3_BS365) 671 + conf = &bs365_gpio_config[i][j]; 672 + else 673 + break; 674 + 675 + u300_gpio_init_pin(gpio, offset, conf); 676 + } 677 + } 678 + } 679 + 680 + static inline void u300_gpio_free_ports(struct u300_gpio *gpio) 681 + { 682 + struct u300_gpio_port *port; 683 + struct list_head *p, *n; 684 + 685 + list_for_each_safe(p, n, &gpio->port_list) { 686 + port = list_entry(p, struct u300_gpio_port, node); 687 + list_del(&port->node); 688 + free_irq(port->irq, port); 689 + kfree(port); 690 + } 691 + } 692 + 693 + static int __init u300_gpio_probe(struct platform_device *pdev) 694 + { 695 + struct u300_gpio_platform *plat = dev_get_platdata(&pdev->dev); 696 + struct u300_gpio *gpio; 697 + int err = 0; 698 + int portno; 699 + u32 val; 700 + u32 ifr; 701 + int i; 702 + 703 + gpio = kzalloc(sizeof(struct u300_gpio), GFP_KERNEL); 704 + if (gpio == NULL) { 705 + dev_err(&pdev->dev, "failed to allocate memory\n"); 706 + return -ENOMEM; 707 + } 708 + 709 + gpio->chip = u300_gpio_chip; 710 + gpio->chip.ngpio = plat->ports * U300_GPIO_PINS_PER_PORT; 711 + gpio->irq_base = plat->gpio_irq_base; 712 + gpio->chip.dev = &pdev->dev; 713 + gpio->chip.base = plat->gpio_base; 714 + gpio->dev = &pdev->dev; 562 715 563 716 /* Get GPIO clock */ 564 - clk = clk_get(&pdev->dev, NULL); 565 - if (IS_ERR(clk)) { 566 - err = PTR_ERR(clk); 567 - dev_err(gpiodev, "could not get GPIO clock\n"); 717 + gpio->clk = clk_get(gpio->dev, NULL); 718 + if (IS_ERR(gpio->clk)) { 719 + err = PTR_ERR(gpio->clk); 720 + dev_err(gpio->dev, "could not get GPIO clock\n"); 568 721 goto err_no_clk; 569 722 } 570 - err = clk_enable(clk); 723 + err = clk_enable(gpio->clk); 571 724 if (err) { 572 - dev_err(gpiodev, "could not enable GPIO clock\n"); 725 + dev_err(gpio->dev, "could not enable GPIO clock\n"); 573 726 goto err_no_clk_enable; 574 727 } 575 728 576 - memres = platform_get_resource(pdev, IORESOURCE_MEM, 0); 577 - if (!memres) 729 + gpio->memres = platform_get_resource(pdev, IORESOURCE_MEM, 0); 730 + if (!gpio->memres) { 731 + dev_err(gpio->dev, "could not get GPIO memory resource\n"); 732 + err = -ENODEV; 578 733 goto err_no_resource; 734 + } 579 735 580 - if (!request_mem_region(memres->start, resource_size(memres), 736 + if (!request_mem_region(gpio->memres->start, 737 + resource_size(gpio->memres), 581 738 "GPIO Controller")) { 582 739 err = -ENODEV; 583 740 goto err_no_ioregion; 584 741 } 585 742 586 - virtbase = ioremap(memres->start, resource_size(memres)); 587 - if (!virtbase) { 743 + gpio->base = ioremap(gpio->memres->start, resource_size(gpio->memres)); 744 + if (!gpio->base) { 588 745 err = -ENOMEM; 589 746 goto err_no_ioremap; 590 747 } 591 - dev_info(gpiodev, "remapped 0x%08x to %p\n", 592 - memres->start, virtbase); 593 748 594 - #ifdef U300_COH901335 595 - dev_info(gpiodev, "initializing GPIO Controller COH 901 335\n"); 596 - /* Turn on the GPIO block */ 597 - writel(U300_GPIO_CR_BLOCK_CLOCK_ENABLE, virtbase + U300_GPIO_CR); 598 - #endif 749 + if (plat->variant == U300_GPIO_COH901335) { 750 + dev_info(gpio->dev, 751 + "initializing GPIO Controller COH 901 335\n"); 752 + gpio->stride = U300_335_PORT_STRIDE; 753 + gpio->pcr = U300_335_PXPCR; 754 + gpio->dor = U300_335_PXPDOR; 755 + gpio->dir = U300_335_PXPDIR; 756 + gpio->per = U300_335_PXPER; 757 + gpio->icr = U300_335_PXICR; 758 + gpio->ien = U300_335_PXIEN; 759 + gpio->iev = U300_335_PXIEV; 760 + ifr = U300_335_PXIFR; 599 761 600 - #ifdef U300_COH901571_3 601 - dev_info(gpiodev, "initializing GPIO Controller COH 901 571/3\n"); 602 - val = readl(virtbase + U300_GPIO_CR); 603 - dev_info(gpiodev, "COH901571/3 block version: %d, " \ 604 - "number of cores: %d\n", 605 - ((val & 0x0000FE00) >> 9), 606 - ((val & 0x000001FC) >> 2)); 607 - writel(U300_GPIO_CR_BLOCK_CLKRQ_ENABLE, virtbase + U300_GPIO_CR); 608 - #endif 762 + /* Turn on the GPIO block */ 763 + writel(U300_335_CR_BLOCK_CLOCK_ENABLE, 764 + gpio->base + U300_335_CR); 765 + } else if (plat->variant == U300_GPIO_COH901571_3_BS335 || 766 + plat->variant == U300_GPIO_COH901571_3_BS365) { 767 + dev_info(gpio->dev, 768 + "initializing GPIO Controller COH 901 571/3\n"); 769 + gpio->stride = U300_571_PORT_STRIDE; 770 + gpio->pcr = U300_571_PXPCR; 771 + gpio->dor = U300_571_PXPDOR; 772 + gpio->dir = U300_571_PXPDIR; 773 + gpio->per = U300_571_PXPER; 774 + gpio->icr = U300_571_PXICR; 775 + gpio->ien = U300_571_PXIEN; 776 + gpio->iev = U300_571_PXIEV; 777 + ifr = U300_571_PXIFR; 609 778 610 - gpio_set_initial_values(); 611 - 612 - for (num_irqs = 0 ; num_irqs < U300_GPIO_NUM_PORTS; num_irqs++) { 613 - 614 - gpio_ports[num_irqs].irq = 615 - platform_get_irq_byname(pdev, 616 - gpio_ports[num_irqs].name); 617 - 618 - err = request_irq(gpio_ports[num_irqs].irq, 619 - gpio_irq_handler, IRQF_DISABLED, 620 - gpio_ports[num_irqs].name, 621 - &gpio_ports[num_irqs]); 622 - if (err) { 623 - dev_err(gpiodev, "cannot allocate IRQ for %s!\n", 624 - gpio_ports[num_irqs].name); 625 - goto err_no_irq; 626 - } 627 - /* Turns off PortX_irq_force */ 628 - writel(0x0, virtbase + U300_GPIO_PXIFR + 629 - num_irqs * U300_GPIO_PORTX_SPACING); 779 + val = readl(gpio->base + U300_571_CR); 780 + dev_info(gpio->dev, "COH901571/3 block version: %d, " \ 781 + "number of cores: %d totalling %d pins\n", 782 + ((val & 0x000001FC) >> 2), 783 + ((val & 0x0000FE00) >> 9), 784 + ((val & 0x0000FE00) >> 9) * 8); 785 + writel(U300_571_CR_BLOCK_CLKRQ_ENABLE, 786 + gpio->base + U300_571_CR); 787 + u300_gpio_init_coh901571(gpio, plat); 788 + } else { 789 + dev_err(gpio->dev, "unknown block variant\n"); 790 + err = -ENODEV; 791 + goto err_unknown_variant; 630 792 } 793 + 794 + /* Add each port with its IRQ separately */ 795 + INIT_LIST_HEAD(&gpio->port_list); 796 + for (portno = 0 ; portno < plat->ports; portno++) { 797 + struct u300_gpio_port *port = 798 + kmalloc(sizeof(struct u300_gpio_port), GFP_KERNEL); 799 + 800 + if (!port) { 801 + dev_err(gpio->dev, "out of memory\n"); 802 + err = -ENOMEM; 803 + goto err_no_port; 804 + } 805 + 806 + snprintf(port->name, 8, "gpio%d", portno); 807 + port->number = portno; 808 + port->gpio = gpio; 809 + 810 + port->irq = platform_get_irq_byname(pdev, 811 + port->name); 812 + 813 + dev_dbg(gpio->dev, "register IRQ %d for %s\n", port->irq, 814 + port->name); 815 + 816 + irq_set_chained_handler(port->irq, u300_gpio_irq_handler); 817 + irq_set_handler_data(port->irq, port); 818 + 819 + /* For each GPIO pin set the unique IRQ handler */ 820 + for (i = 0; i < U300_GPIO_PINS_PER_PORT; i++) { 821 + int irqno = gpio->irq_base + (portno << 3) + i; 822 + 823 + dev_dbg(gpio->dev, "handler for IRQ %d on %s\n", 824 + irqno, port->name); 825 + irq_set_chip_and_handler(irqno, &u300_gpio_irqchip, 826 + handle_simple_irq); 827 + set_irq_flags(irqno, IRQF_VALID); 828 + irq_set_chip_data(irqno, port); 829 + } 830 + 831 + /* Turns off irq force (test register) for this port */ 832 + writel(0x0, gpio->base + portno * gpio->stride + ifr); 833 + 834 + list_add_tail(&port->node, &gpio->port_list); 835 + } 836 + dev_dbg(gpio->dev, "initialized %d GPIO ports\n", portno); 837 + 838 + err = gpiochip_add(&gpio->chip); 839 + if (err) { 840 + dev_err(gpio->dev, "unable to add gpiochip: %d\n", err); 841 + goto err_no_chip; 842 + } 843 + 844 + platform_set_drvdata(pdev, gpio); 631 845 632 846 return 0; 633 847 634 - err_no_irq: 635 - for (i = 0; i < num_irqs; i++) 636 - free_irq(gpio_ports[i].irq, &gpio_ports[i]); 637 - iounmap(virtbase); 638 - err_no_ioremap: 639 - release_mem_region(memres->start, resource_size(memres)); 640 - err_no_ioregion: 641 - err_no_resource: 642 - clk_disable(clk); 643 - err_no_clk_enable: 644 - clk_put(clk); 645 - err_no_clk: 646 - dev_info(gpiodev, "module ERROR:%d\n", err); 848 + err_no_chip: 849 + err_no_port: 850 + u300_gpio_free_ports(gpio); 851 + err_unknown_variant: 852 + iounmap(gpio->base); 853 + err_no_ioremap: 854 + release_mem_region(gpio->memres->start, resource_size(gpio->memres)); 855 + err_no_ioregion: 856 + err_no_resource: 857 + clk_disable(gpio->clk); 858 + err_no_clk_enable: 859 + clk_put(gpio->clk); 860 + err_no_clk: 861 + kfree(gpio); 862 + dev_info(&pdev->dev, "module ERROR:%d\n", err); 647 863 return err; 648 864 } 649 865 650 - static int __exit gpio_remove(struct platform_device *pdev) 866 + static int __exit u300_gpio_remove(struct platform_device *pdev) 651 867 { 652 - int i; 868 + struct u300_gpio_platform *plat = dev_get_platdata(&pdev->dev); 869 + struct u300_gpio *gpio = platform_get_drvdata(pdev); 870 + int err; 653 871 654 872 /* Turn off the GPIO block */ 655 - writel(0x00000000U, virtbase + U300_GPIO_CR); 656 - for (i = 0 ; i < U300_GPIO_NUM_PORTS; i++) 657 - free_irq(gpio_ports[i].irq, &gpio_ports[i]); 658 - iounmap(virtbase); 659 - release_mem_region(memres->start, resource_size(memres)); 660 - clk_disable(clk); 661 - clk_put(clk); 873 + if (plat->variant == U300_GPIO_COH901335) 874 + writel(0x00000000U, gpio->base + U300_335_CR); 875 + if (plat->variant == U300_GPIO_COH901571_3_BS335 || 876 + plat->variant == U300_GPIO_COH901571_3_BS365) 877 + writel(0x00000000U, gpio->base + U300_571_CR); 878 + 879 + err = gpiochip_remove(&gpio->chip); 880 + if (err < 0) { 881 + dev_err(gpio->dev, "unable to remove gpiochip: %d\n", err); 882 + return err; 883 + } 884 + u300_gpio_free_ports(gpio); 885 + iounmap(gpio->base); 886 + release_mem_region(gpio->memres->start, 887 + resource_size(gpio->memres)); 888 + clk_disable(gpio->clk); 889 + clk_put(gpio->clk); 890 + platform_set_drvdata(pdev, NULL); 891 + kfree(gpio); 662 892 return 0; 663 893 } 664 894 665 - static struct platform_driver gpio_driver = { 895 + static struct platform_driver u300_gpio_driver = { 666 896 .driver = { 667 897 .name = "u300-gpio", 668 898 }, 669 - .remove = __exit_p(gpio_remove), 899 + .remove = __exit_p(u300_gpio_remove), 670 900 }; 671 901 672 902 673 903 static int __init u300_gpio_init(void) 674 904 { 675 - return platform_driver_probe(&gpio_driver, gpio_probe); 905 + return platform_driver_probe(&u300_gpio_driver, u300_gpio_probe); 676 906 } 677 907 678 908 static void __exit u300_gpio_exit(void) 679 909 { 680 - platform_driver_unregister(&gpio_driver); 910 + platform_driver_unregister(&u300_gpio_driver); 681 911 } 682 912 683 913 arch_initcall(u300_gpio_init); 684 914 module_exit(u300_gpio_exit); 685 915 686 916 MODULE_AUTHOR("Linus Walleij <linus.walleij@stericsson.com>"); 687 - 688 - #ifdef U300_COH901571_3 689 - MODULE_DESCRIPTION("ST-Ericsson AB COH 901 571/3 GPIO driver"); 690 - #endif 691 - 692 - #ifdef U300_COH901335 693 - MODULE_DESCRIPTION("ST-Ericsson AB COH 901 335 GPIO driver"); 694 - #endif 695 - 917 + MODULE_DESCRIPTION("ST-Ericsson AB COH 901 335/COH 901 571/3 GPIO driver"); 696 918 MODULE_LICENSE("GPL");
+1 -1
drivers/i2c/busses/i2c-ixp2000.c
··· 35 35 #include <linux/slab.h> 36 36 37 37 #include <mach/hardware.h> /* Pick up IXP2000-specific bits */ 38 - #include <mach/gpio.h> 38 + #include <mach/gpio-ixp2000.h> 39 39 40 40 static inline int ixp2000_scl_pin(void *data) 41 41 {
+1 -1
drivers/ide/at91_ide.c
··· 28 28 #include <linux/platform_device.h> 29 29 30 30 #include <mach/board.h> 31 - #include <mach/gpio.h> 31 + #include <asm/gpio.h> 32 32 #include <mach/at91sam9_smc.h> 33 33 34 34 #define DRV_NAME "at91_ide"
+1 -1
drivers/input/keyboard/omap-keypad.c
··· 35 35 #include <linux/mutex.h> 36 36 #include <linux/errno.h> 37 37 #include <linux/slab.h> 38 - #include <mach/gpio.h> 38 + #include <asm/gpio.h> 39 39 #include <plat/keypad.h> 40 40 #include <plat/menelaus.h> 41 41 #include <asm/irq.h>
+1 -1
drivers/mfd/menelaus.c
··· 44 44 45 45 #include <asm/mach/irq.h> 46 46 47 - #include <mach/gpio.h> 47 + #include <asm/gpio.h> 48 48 #include <plat/menelaus.h> 49 49 50 50 #define DRIVER_NAME "menelaus"
+1 -1
drivers/mmc/host/omap.c
··· 33 33 34 34 #include <plat/board.h> 35 35 #include <plat/mmc.h> 36 - #include <mach/gpio.h> 36 + #include <asm/gpio.h> 37 37 #include <plat/dma.h> 38 38 #include <plat/mux.h> 39 39 #include <plat/fpga.h>
+3 -1
drivers/mmc/host/sdhci-tegra.c
··· 21 21 #include <linux/mmc/card.h> 22 22 #include <linux/mmc/host.h> 23 23 24 - #include <mach/gpio.h> 24 + #include <asm/gpio.h> 25 + 26 + #include <mach/gpio-tegra.h> 25 27 #include <mach/sdhci.h> 26 28 27 29 #include "sdhci-pltfm.h"
+1 -1
drivers/mtd/nand/ams-delta.c
··· 26 26 #include <asm/io.h> 27 27 #include <mach/hardware.h> 28 28 #include <asm/sizes.h> 29 - #include <mach/gpio.h> 29 + #include <asm/gpio.h> 30 30 #include <plat/board-ams-delta.h> 31 31 32 32 /*
+1 -1
drivers/mtd/onenand/omap2.c
··· 40 40 #include <asm/mach/flash.h> 41 41 #include <plat/gpmc.h> 42 42 #include <plat/onenand.h> 43 - #include <mach/gpio.h> 43 + #include <asm/gpio.h> 44 44 45 45 #include <plat/dma.h> 46 46
+1 -1
drivers/net/arm/at91_ether.c
··· 35 35 #include <asm/mach-types.h> 36 36 37 37 #include <mach/at91rm9200_emac.h> 38 - #include <mach/gpio.h> 38 + #include <asm/gpio.h> 39 39 #include <mach/board.h> 40 40 41 41 #include "at91_ether.h"
+1 -1
drivers/pcmcia/pxa2xx_vpac270.c
··· 17 17 18 18 #include <asm/mach-types.h> 19 19 20 - #include <mach/gpio.h> 20 + #include <asm/gpio.h> 21 21 #include <mach/vpac270.h> 22 22 23 23 #include "soc_common.h"
+1 -1
drivers/spi/spi-atmel.c
··· 22 22 23 23 #include <asm/io.h> 24 24 #include <mach/board.h> 25 - #include <mach/gpio.h> 25 + #include <asm/gpio.h> 26 26 #include <mach/cpu.h> 27 27 28 28 /* SPI register offsets */
+1 -1
drivers/tty/serial/atmel_serial.c
··· 46 46 47 47 #ifdef CONFIG_ARM 48 48 #include <mach/cpu.h> 49 - #include <mach/gpio.h> 49 + #include <asm/gpio.h> 50 50 #endif 51 51 52 52 #define PDC_BUFFER_SIZE 512
+1 -1
drivers/usb/host/ohci-pnx4008.c
··· 26 26 27 27 #include <mach/platform.h> 28 28 #include <mach/irqs.h> 29 - #include <mach/gpio.h> 29 + #include <asm/gpio.h> 30 30 31 31 #define USB_CTRL IO_ADDRESS(PNX4008_PWRMAN_BASE + 0x64) 32 32
+1 -1
drivers/usb/musb/davinci.c
··· 35 35 36 36 #include <mach/hardware.h> 37 37 #include <mach/memory.h> 38 - #include <mach/gpio.h> 38 + #include <asm/gpio.h> 39 39 #include <mach/cputype.h> 40 40 41 41 #include <asm/mach-types.h>
+1 -1
drivers/video/atmel_lcdfb.c
··· 21 21 22 22 #include <mach/board.h> 23 23 #include <mach/cpu.h> 24 - #include <mach/gpio.h> 24 + #include <asm/gpio.h> 25 25 26 26 #include <video/atmel_lcdc.h> 27 27
+1 -1
drivers/video/omap/lcd_apollon.c
··· 24 24 #include <linux/module.h> 25 25 #include <linux/platform_device.h> 26 26 27 - #include <mach/gpio.h> 27 + #include <asm/gpio.h> 28 28 29 29 #include "omapfb.h" 30 30
+1 -1
drivers/video/omap/lcd_h3.c
··· 23 23 #include <linux/platform_device.h> 24 24 #include <linux/i2c/tps65010.h> 25 25 26 - #include <mach/gpio.h> 26 + #include <asm/gpio.h> 27 27 #include "omapfb.h" 28 28 29 29 #define MODULE_NAME "omapfb-lcd_h3"
+1 -1
drivers/video/omap/lcd_inn1610.c
··· 22 22 #include <linux/module.h> 23 23 #include <linux/platform_device.h> 24 24 25 - #include <mach/gpio.h> 25 + #include <asm/gpio.h> 26 26 #include "omapfb.h" 27 27 28 28 #define MODULE_NAME "omapfb-lcd_h3"
+1 -1
drivers/video/omap/lcd_ldp.c
··· 26 26 #include <linux/delay.h> 27 27 #include <linux/i2c/twl.h> 28 28 29 - #include <mach/gpio.h> 29 + #include <asm/gpio.h> 30 30 #include <plat/mux.h> 31 31 #include <asm/mach-types.h> 32 32
+1 -1
drivers/video/omap/lcd_osk.c
··· 23 23 #include <linux/module.h> 24 24 #include <linux/platform_device.h> 25 25 26 - #include <mach/gpio.h> 26 + #include <asm/gpio.h> 27 27 #include <plat/mux.h> 28 28 #include "omapfb.h" 29 29
+1 -1
drivers/video/omap/lcd_overo.c
··· 23 23 #include <linux/platform_device.h> 24 24 #include <linux/i2c/twl.h> 25 25 26 - #include <mach/gpio.h> 26 + #include <asm/gpio.h> 27 27 #include <plat/mux.h> 28 28 #include <asm/mach-types.h> 29 29
+1 -1
drivers/video/omap/lcd_palmtt.c
··· 29 29 #include <linux/module.h> 30 30 #include <linux/io.h> 31 31 32 - #include <mach/gpio.h> 32 + #include <asm/gpio.h> 33 33 #include "omapfb.h" 34 34 35 35 static int palmtt_panel_init(struct lcd_panel *panel,
+1 -1
drivers/video/pnx4008/sdum.c
··· 30 30 #include <linux/clk.h> 31 31 #include <linux/gfp.h> 32 32 #include <asm/uaccess.h> 33 - #include <mach/gpio.h> 33 + #include <asm/gpio.h> 34 34 35 35 #include "sdum.h" 36 36 #include "fbcommon.h"