Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bcm2708: Increase ARCH_NR_GPIOS and fix bcm2708_gpio

Signed-off-by: Franz Pletz <fpletz@fnordicwalking.de>
  • Loading branch information...
commit af493530b7f1ff4af4b344649841cf42604b01f6 1 parent 655678d
@fpletz fpletz authored
View
8 arch/arm/mach-bcm2708/bcm2708_gpio.c
@@ -70,7 +70,7 @@ static int bcm2708_set_function(struct gpio_chip *gc, unsigned offset,
unsigned gpio_field_offset = (offset - 10 * gpio_bank) * 3;
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_set_function %p (%d,%d)\n", gc, offset, function);
- if (offset >= ARCH_NR_GPIOS)
+ if (offset >= BCM_NR_GPIOS)
return -EINVAL;
spin_lock_irqsave(&lock, flags);
@@ -108,7 +108,7 @@ static int bcm2708_gpio_get(struct gpio_chip *gc, unsigned offset)
unsigned gpio_field_offset = (offset - 32 * gpio_bank);
unsigned lev;
- if (offset >= ARCH_NR_GPIOS)
+ if (offset >= BCM_NR_GPIOS)
return 0;
lev = readl(gpio->base + GPIOLEV(gpio_bank));
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_get %p (%d)=%d\n", gc, offset, 0x1 & (lev>>gpio_field_offset));
@@ -121,7 +121,7 @@ static void bcm2708_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
unsigned gpio_bank = offset / 32;
unsigned gpio_field_offset = (offset - 32 * gpio_bank);
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_set %p (%d=%d)\n", gc, offset, value);
- if (offset >= ARCH_NR_GPIOS)
+ if (offset >= BCM_NR_GPIOS)
return;
if (value)
writel(1 << gpio_field_offset, gpio->base + GPIOSET(gpio_bank));
@@ -280,7 +280,7 @@ static int bcm2708_gpio_probe(struct platform_device *dev)
ucb->gc.label = "bcm2708_gpio";
ucb->gc.base = 0;
- ucb->gc.ngpio = ARCH_NR_GPIOS;
+ ucb->gc.ngpio = BCM_NR_GPIOS;
ucb->gc.owner = THIS_MODULE;
ucb->gc.direction_input = bcm2708_gpio_dir_in;
View
3  arch/arm/mach-bcm2708/include/mach/gpio.h
@@ -9,7 +9,8 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H
-#define ARCH_NR_GPIOS 54 // number of gpio lines
+#define BCM_NR_GPIOS 54 // number of gpio lines on chip
+#define ARCH_NR_GPIOS 256 // number of gpio lines
#define gpio_to_irq(x) ((x) + GPIO_IRQ_START)
#define irq_to_gpio(x) ((x) - GPIO_IRQ_START)
Please sign in to comment.
Something went wrong with that request. Please try again.