brcm2708: update against latest rpi-3.10.y branch
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0161-Revert-bcm2708-fix-gpio_to_irq-name-clash.patch
1 From b279f5b69e5ce5f25bfc85f0b469aa023e27920a Mon Sep 17 00:00:00 2001
2 From: Joerg Faschingbauer <jf@faschingbauer.co.at>
3 Date: Sat, 18 Jan 2014 22:58:00 +0100
4 Subject: [PATCH 161/174] Revert "bcm2708: fix gpio_to_irq() name clash"
5
6 This reverts commit dee3db1c55e9a1c2efce858f44d9810cc2392b18.
7
8 Conflicts:
9         arch/arm/mach-bcm2708/bcm2708_gpio.c
10 ---
11  arch/arm/mach-bcm2708/bcm2708_gpio.c      | 28 ++++++++++++++--------------
12  arch/arm/mach-bcm2708/include/mach/gpio.h |  4 ++--
13  2 files changed, 16 insertions(+), 16 deletions(-)
14
15 --- a/arch/arm/mach-bcm2708/bcm2708_gpio.c
16 +++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c
17 @@ -137,9 +137,9 @@ static void bcm2708_gpio_set(struct gpio
18  
19  #if BCM_GPIO_USE_IRQ
20  
21 -static int bcm2708___bcm2708_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
22 +static int bcm2708_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
23  {
24 -       return __bcm2708_gpio_to_irq(gpio);
25 +       return gpio_to_irq(gpio);
26  }
27  
28  static int bcm2708_gpio_irq_set_type(struct irq_data *d, unsigned type)
29 @@ -147,22 +147,22 @@ static int bcm2708_gpio_irq_set_type(str
30         unsigned irq = d->irq;
31         struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
32  
33 -       gpio->rising  &= ~(1 << __bcm2708_irq_to_gpio(irq));
34 -       gpio->falling &= ~(1 << __bcm2708_irq_to_gpio(irq));
35 -       gpio->high    &= ~(1 << __bcm2708_irq_to_gpio(irq));
36 -       gpio->low     &= ~(1 << __bcm2708_irq_to_gpio(irq));
37 +       gpio->rising  &= ~(1 << irq_to_gpio(irq));
38 +       gpio->falling &= ~(1 << irq_to_gpio(irq));
39 +       gpio->high    &= ~(1 << irq_to_gpio(irq));
40 +       gpio->low     &= ~(1 << irq_to_gpio(irq));
41  
42         if (type & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING | IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
43                 return -EINVAL;
44  
45         if (type & IRQ_TYPE_EDGE_RISING)
46 -               gpio->rising |= (1 << __bcm2708_irq_to_gpio(irq));
47 +               gpio->rising |= (1 << irq_to_gpio(irq));
48         if (type & IRQ_TYPE_EDGE_FALLING)
49 -               gpio->falling |= (1 << __bcm2708_irq_to_gpio(irq));
50 +               gpio->falling |= (1 << irq_to_gpio(irq));
51         if (type & IRQ_TYPE_LEVEL_HIGH)
52 -               gpio->high |= (1 << __bcm2708_irq_to_gpio(irq));
53 +               gpio->high |= (1 << irq_to_gpio(irq));
54         if (type & IRQ_TYPE_LEVEL_LOW)
55 -               gpio->low |= (1 << __bcm2708_irq_to_gpio(irq));
56 +               gpio->low |= (1 << irq_to_gpio(irq));
57         return 0;
58  }
59  
60 @@ -170,7 +170,7 @@ static void bcm2708_gpio_irq_mask(struct
61  {
62         unsigned irq = d->irq;
63         struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
64 -       unsigned gn = __bcm2708_irq_to_gpio(irq);
65 +       unsigned gn = irq_to_gpio(irq);
66         unsigned gb = gn / 32;
67         unsigned long rising  = readl(gpio->base + GPIOREN(gb));
68         unsigned long falling = readl(gpio->base + GPIOFEN(gb));
69 @@ -189,7 +189,7 @@ static void bcm2708_gpio_irq_unmask(stru
70  {
71         unsigned irq = d->irq;
72         struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
73 -       unsigned gn = __bcm2708_irq_to_gpio(irq);
74 +       unsigned gn = irq_to_gpio(irq);
75         unsigned gb = gn / 32;
76         unsigned long rising  = readl(gpio->base + GPIOREN(gb));
77         unsigned long falling = readl(gpio->base + GPIOFEN(gb));
78 @@ -244,7 +244,7 @@ static irqreturn_t bcm2708_gpio_interrup
79                 edsr = readl(__io_address(GPIO_BASE) + GPIOEDS(bank));
80                 for_each_set_bit(i, &edsr, 32) {
81                         gpio = i + bank * 32;
82 -                       generic_handle_irq(__bcm2708_gpio_to_irq(gpio));
83 +                       generic_handle_irq(gpio_to_irq(gpio));
84                 }
85                 writel(0xffffffff, __io_address(GPIO_BASE) + GPIOEDS(bank));
86         }
87 @@ -261,7 +261,7 @@ static void bcm2708_gpio_irq_init(struct
88  {
89         unsigned irq;
90  
91 -       ucb->gc.to_irq = bcm2708___bcm2708_gpio_to_irq;
92 +       ucb->gc.to_irq = bcm2708_gpio_to_irq;
93  
94         for (irq = GPIO_IRQ_START; irq < (GPIO_IRQ_START + GPIO_IRQS); irq++) {
95                 irq_set_chip_data(irq, ucb);
96 --- a/arch/arm/mach-bcm2708/include/mach/gpio.h
97 +++ b/arch/arm/mach-bcm2708/include/mach/gpio.h
98 @@ -11,8 +11,8 @@
99  
100  #define ARCH_NR_GPIOS 54 // number of gpio lines
101  
102 -#define __bcm2708_gpio_to_irq(x)   ((x) + GPIO_IRQ_START)
103 -#define __bcm2708_irq_to_gpio(x)   ((x) - GPIO_IRQ_START)
104 +#define gpio_to_irq(x) ((x) + GPIO_IRQ_START)
105 +#define irq_to_gpio(x) ((x) - GPIO_IRQ_START)
106  
107  #endif
108