summaryrefslogtreecommitdiff
path: root/arch/arm/mach-bcm2708/bcm2708.c
diff options
context:
space:
mode:
authorpopcornmix <popcornmix@gmail.com>2014-10-08 18:50:05 +0100
committerpopcornmix <popcornmix@gmail.com>2015-05-18 14:10:16 +0100
commit520bf118a7d466048d2a927d945e3d4b3ea1afc6 (patch)
treefd1eaff2f3cc9bc932eff30b8f5b7c015521080d /arch/arm/mach-bcm2708/bcm2708.c
parent08d998bd955c232b20083ebb696291d3bfb5e961 (diff)
downloadlinux-520bf118a7d466048d2a927d945e3d4b3ea1afc6.tar.gz
Add bcm2708_gpio driver
Signed-off-by: popcornmix <popcornmix@gmail.com> bcm2708: Add extension to configure internal pulls The bcm2708 gpio controller supports internal pulls to be used as pull-up, pull-down or being entirely disabled. As it can be useful for a driver to change the pull configuration from it's default pull-down state, add an extension which allows configuring the pull per gpio. Signed-off-by: Julian Scheel <julian@jusst.de> bcm2708-gpio: Revert the use of pinctrl_request_gpio In non-DT systems, pinctrl_request_gpio always fails causing "requests probe deferral" messages. In DT systems, it isn't useful because the reference counting is independent of the normal pinctrl pin reservations. gpio: Only clear the currently occurring interrupt. Avoids losing interrupts See: linux #760 bcm2708_gpio: Avoid calling irq_unmask for all interrupts When setting up the interrupts, specify that the handle_simple_irq handler should be used. This leaves interrupt acknowledgement to the caller, and prevents irq_unmask from being called for all interrupts. Issue: linux #760
Diffstat (limited to 'arch/arm/mach-bcm2708/bcm2708.c')
-rw-r--r--arch/arm/mach-bcm2708/bcm2708.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c
index 9b4e709ceecc..750364980af6 100644
--- a/arch/arm/mach-bcm2708/bcm2708.c
+++ b/arch/arm/mach-bcm2708/bcm2708.c
@@ -331,6 +331,31 @@ static struct platform_device bcm2708_vcio_device = {
},
};
+#ifdef CONFIG_BCM2708_GPIO
+#define BCM_GPIO_DRIVER_NAME "bcm2708_gpio"
+
+static struct resource bcm2708_gpio_resources[] = {
+ [0] = { /* general purpose I/O */
+ .start = GPIO_BASE,
+ .end = GPIO_BASE + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static u64 gpio_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
+
+static struct platform_device bcm2708_gpio_device = {
+ .name = BCM_GPIO_DRIVER_NAME,
+ .id = -1, /* only one VideoCore I/O area */
+ .resource = bcm2708_gpio_resources,
+ .num_resources = ARRAY_SIZE(bcm2708_gpio_resources),
+ .dev = {
+ .dma_mask = &gpio_dmamask,
+ .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
+ },
+};
+#endif
+
static struct resource bcm2708_systemtimer_resources[] = {
[0] = { /* system timer access */
.start = ST_BASE,
@@ -473,6 +498,9 @@ void __init bcm2708_init(void)
bcm_register_device(&bcm2708_dmaman_device);
bcm_register_device(&bcm2708_vcio_device);
+#ifdef CONFIG_BCM2708_GPIO
+ bcm_register_device(&bcm2708_gpio_device);
+#endif
bcm_register_device(&bcm2708_systemtimer_device);
bcm_register_device(&bcm2708_fb_device);
bcm_register_device(&bcm2708_usb_device);