2014-09-27 19:10:51 +00:00
|
|
|
From ff068b36af8d2ee9634b0b50922656c350211ec5 Mon Sep 17 00:00:00 2001
|
2014-02-28 20:30:08 +00:00
|
|
|
From: Joerg Faschingbauer <jf@faschingbauer.co.at>
|
|
|
|
Date: Sat, 18 Jan 2014 22:58:00 +0100
|
2014-09-27 19:10:51 +00:00
|
|
|
Subject: [PATCH 161/196] Revert "bcm2708: fix gpio_to_irq() name clash"
|
2014-02-28 20:30:08 +00:00
|
|
|
|
|
|
|
This reverts commit dee3db1c55e9a1c2efce858f44d9810cc2392b18.
|
|
|
|
|
|
|
|
Conflicts:
|
|
|
|
arch/arm/mach-bcm2708/bcm2708_gpio.c
|
|
|
|
---
|
|
|
|
arch/arm/mach-bcm2708/bcm2708_gpio.c | 28 ++++++++++++++--------------
|
|
|
|
arch/arm/mach-bcm2708/include/mach/gpio.h | 4 ++--
|
|
|
|
2 files changed, 16 insertions(+), 16 deletions(-)
|
|
|
|
|
2014-09-27 19:10:51 +00:00
|
|
|
diff --git a/arch/arm/mach-bcm2708/bcm2708_gpio.c b/arch/arm/mach-bcm2708/bcm2708_gpio.c
|
|
|
|
index 1d93ad8..bab8a49 100644
|
2014-02-28 20:30:08 +00:00
|
|
|
--- a/arch/arm/mach-bcm2708/bcm2708_gpio.c
|
|
|
|
+++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c
|
2014-09-27 19:10:51 +00:00
|
|
|
@@ -137,9 +137,9 @@ static void bcm2708_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
|
2014-02-28 20:30:08 +00:00
|
|
|
|
|
|
|
#if BCM_GPIO_USE_IRQ
|
|
|
|
|
|
|
|
-static int bcm2708___bcm2708_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
|
|
|
|
+static int bcm2708_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
|
|
|
|
{
|
|
|
|
- return __bcm2708_gpio_to_irq(gpio);
|
|
|
|
+ return gpio_to_irq(gpio);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int bcm2708_gpio_irq_set_type(struct irq_data *d, unsigned type)
|
2014-09-27 19:10:51 +00:00
|
|
|
@@ -147,22 +147,22 @@ static int bcm2708_gpio_irq_set_type(struct irq_data *d, unsigned type)
|
2014-02-28 20:30:08 +00:00
|
|
|
unsigned irq = d->irq;
|
|
|
|
struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
|
|
|
|
|
|
|
|
- gpio->rising &= ~(1 << __bcm2708_irq_to_gpio(irq));
|
|
|
|
- gpio->falling &= ~(1 << __bcm2708_irq_to_gpio(irq));
|
|
|
|
- gpio->high &= ~(1 << __bcm2708_irq_to_gpio(irq));
|
|
|
|
- gpio->low &= ~(1 << __bcm2708_irq_to_gpio(irq));
|
|
|
|
+ gpio->rising &= ~(1 << irq_to_gpio(irq));
|
|
|
|
+ gpio->falling &= ~(1 << irq_to_gpio(irq));
|
|
|
|
+ gpio->high &= ~(1 << irq_to_gpio(irq));
|
|
|
|
+ gpio->low &= ~(1 << irq_to_gpio(irq));
|
|
|
|
|
|
|
|
if (type & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING | IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
if (type & IRQ_TYPE_EDGE_RISING)
|
|
|
|
- gpio->rising |= (1 << __bcm2708_irq_to_gpio(irq));
|
|
|
|
+ gpio->rising |= (1 << irq_to_gpio(irq));
|
|
|
|
if (type & IRQ_TYPE_EDGE_FALLING)
|
|
|
|
- gpio->falling |= (1 << __bcm2708_irq_to_gpio(irq));
|
|
|
|
+ gpio->falling |= (1 << irq_to_gpio(irq));
|
|
|
|
if (type & IRQ_TYPE_LEVEL_HIGH)
|
|
|
|
- gpio->high |= (1 << __bcm2708_irq_to_gpio(irq));
|
|
|
|
+ gpio->high |= (1 << irq_to_gpio(irq));
|
|
|
|
if (type & IRQ_TYPE_LEVEL_LOW)
|
|
|
|
- gpio->low |= (1 << __bcm2708_irq_to_gpio(irq));
|
|
|
|
+ gpio->low |= (1 << irq_to_gpio(irq));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-09-27 19:10:51 +00:00
|
|
|
@@ -170,7 +170,7 @@ static void bcm2708_gpio_irq_mask(struct irq_data *d)
|
2014-02-28 20:30:08 +00:00
|
|
|
{
|
|
|
|
unsigned irq = d->irq;
|
|
|
|
struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
|
|
|
|
- unsigned gn = __bcm2708_irq_to_gpio(irq);
|
|
|
|
+ unsigned gn = irq_to_gpio(irq);
|
|
|
|
unsigned gb = gn / 32;
|
|
|
|
unsigned long rising = readl(gpio->base + GPIOREN(gb));
|
|
|
|
unsigned long falling = readl(gpio->base + GPIOFEN(gb));
|
2014-09-27 19:10:51 +00:00
|
|
|
@@ -189,7 +189,7 @@ static void bcm2708_gpio_irq_unmask(struct irq_data *d)
|
2014-02-28 20:30:08 +00:00
|
|
|
{
|
|
|
|
unsigned irq = d->irq;
|
|
|
|
struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
|
|
|
|
- unsigned gn = __bcm2708_irq_to_gpio(irq);
|
|
|
|
+ unsigned gn = irq_to_gpio(irq);
|
|
|
|
unsigned gb = gn / 32;
|
|
|
|
unsigned long rising = readl(gpio->base + GPIOREN(gb));
|
|
|
|
unsigned long falling = readl(gpio->base + GPIOFEN(gb));
|
2014-09-27 19:10:51 +00:00
|
|
|
@@ -244,7 +244,7 @@ static irqreturn_t bcm2708_gpio_interrupt(int irq, void *dev_id)
|
2014-02-28 20:30:08 +00:00
|
|
|
edsr = readl(__io_address(GPIO_BASE) + GPIOEDS(bank));
|
|
|
|
for_each_set_bit(i, &edsr, 32) {
|
|
|
|
gpio = i + bank * 32;
|
|
|
|
- generic_handle_irq(__bcm2708_gpio_to_irq(gpio));
|
|
|
|
+ generic_handle_irq(gpio_to_irq(gpio));
|
|
|
|
}
|
|
|
|
writel(0xffffffff, __io_address(GPIO_BASE) + GPIOEDS(bank));
|
|
|
|
}
|
2014-09-27 19:10:51 +00:00
|
|
|
@@ -261,7 +261,7 @@ static void bcm2708_gpio_irq_init(struct bcm2708_gpio *ucb)
|
2014-02-28 20:30:08 +00:00
|
|
|
{
|
|
|
|
unsigned irq;
|
|
|
|
|
|
|
|
- ucb->gc.to_irq = bcm2708___bcm2708_gpio_to_irq;
|
|
|
|
+ ucb->gc.to_irq = bcm2708_gpio_to_irq;
|
|
|
|
|
|
|
|
for (irq = GPIO_IRQ_START; irq < (GPIO_IRQ_START + GPIO_IRQS); irq++) {
|
|
|
|
irq_set_chip_data(irq, ucb);
|
2014-09-27 19:10:51 +00:00
|
|
|
diff --git a/arch/arm/mach-bcm2708/include/mach/gpio.h b/arch/arm/mach-bcm2708/include/mach/gpio.h
|
|
|
|
index f09639a..f600bc7 100644
|
2014-02-28 20:30:08 +00:00
|
|
|
--- a/arch/arm/mach-bcm2708/include/mach/gpio.h
|
|
|
|
+++ b/arch/arm/mach-bcm2708/include/mach/gpio.h
|
|
|
|
@@ -11,8 +11,8 @@
|
|
|
|
|
|
|
|
#define ARCH_NR_GPIOS 54 // number of gpio lines
|
|
|
|
|
|
|
|
-#define __bcm2708_gpio_to_irq(x) ((x) + GPIO_IRQ_START)
|
|
|
|
-#define __bcm2708_irq_to_gpio(x) ((x) - GPIO_IRQ_START)
|
|
|
|
+#define gpio_to_irq(x) ((x) + GPIO_IRQ_START)
|
|
|
|
+#define irq_to_gpio(x) ((x) - GPIO_IRQ_START)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2014-09-27 19:10:51 +00:00
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|