Skip to content

Commit

Permalink
Add bcm2708_gpio driver
Browse files Browse the repository at this point in the history
Signed-off-by: popcornmix <[email protected]>

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 <[email protected]>

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
  • Loading branch information
popcornmix committed Oct 4, 2015
1 parent cfa9467 commit 56e781b
Show file tree
Hide file tree
Showing 8 changed files with 524 additions and 1 deletion.
8 changes: 8 additions & 0 deletions arch/arm/mach-bcm2708/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ config BCM2708_DT
help
Enable Device Tree support for BCM2708

config BCM2708_GPIO
bool "BCM2708 gpio support"
depends on MACH_BCM2708
select ARCH_REQUIRE_GPIOLIB
default y
help
Include support for the Broadcom(R) BCM2708 gpio.

config BCM2708_NOL2CACHE
bool "Videocore L2 cache disable"
depends on MACH_BCM2708
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-bcm2708/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
#

obj-$(CONFIG_MACH_BCM2708) += bcm2708.o armctrl.o
obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o
25 changes: 25 additions & 0 deletions arch/arm/mach-bcm2708/bcm2708.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,31 @@ static struct platform_device bcm2708_rpifw_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

int __init bcm_register_device(struct platform_device *pdev)
{
int ret;
Expand Down
Loading

0 comments on commit 56e781b

Please sign in to comment.