ixp4xx: remove linux 3.10 support
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0161-Revert-bcm2708-fix-gpio_to_irq-name-clash.patch
1 From ff068b36af8d2ee9634b0b50922656c350211ec5 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/196] 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 diff --git a/arch/arm/mach-bcm2708/bcm2708_gpio.c b/arch/arm/mach-bcm2708/bcm2708_gpio.c
16 index 1d93ad8..bab8a49 100644
17 --- a/arch/arm/mach-bcm2708/bcm2708_gpio.c
18 +++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c
19 @@ -137,9 +137,9 @@ static void bcm2708_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
20  
21  #if BCM_GPIO_USE_IRQ
22  
23 -static int bcm2708___bcm2708_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
24 +static int bcm2708_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
25  {
26 -       return __bcm2708_gpio_to_irq(gpio);
27 +       return gpio_to_irq(gpio);
28  }
29  
30  static int bcm2708_gpio_irq_set_type(struct irq_data *d, unsigned type)
31 @@ -147,22 +147,22 @@ static int bcm2708_gpio_irq_set_type(struct irq_data *d, unsigned type)
32         unsigned irq = d->irq;
33         struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
34  
35 -       gpio->rising  &= ~(1 << __bcm2708_irq_to_gpio(irq));
36 -       gpio->falling &= ~(1 << __bcm2708_irq_to_gpio(irq));
37 -       gpio->high    &= ~(1 << __bcm2708_irq_to_gpio(irq));
38 -       gpio->low     &= ~(1 << __bcm2708_irq_to_gpio(irq));
39 +       gpio->rising  &= ~(1 << irq_to_gpio(irq));
40 +       gpio->falling &= ~(1 << irq_to_gpio(irq));
41 +       gpio->high    &= ~(1 << irq_to_gpio(irq));
42 +       gpio->low     &= ~(1 << irq_to_gpio(irq));
43  
44         if (type & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING | IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
45                 return -EINVAL;
46  
47         if (type & IRQ_TYPE_EDGE_RISING)
48 -               gpio->rising |= (1 << __bcm2708_irq_to_gpio(irq));
49 +               gpio->rising |= (1 << irq_to_gpio(irq));
50         if (type & IRQ_TYPE_EDGE_FALLING)
51 -               gpio->falling |= (1 << __bcm2708_irq_to_gpio(irq));
52 +               gpio->falling |= (1 << irq_to_gpio(irq));
53         if (type & IRQ_TYPE_LEVEL_HIGH)
54 -               gpio->high |= (1 << __bcm2708_irq_to_gpio(irq));
55 +               gpio->high |= (1 << irq_to_gpio(irq));
56         if (type & IRQ_TYPE_LEVEL_LOW)
57 -               gpio->low |= (1 << __bcm2708_irq_to_gpio(irq));
58 +               gpio->low |= (1 << irq_to_gpio(irq));
59         return 0;
60  }
61  
62 @@ -170,7 +170,7 @@ static void bcm2708_gpio_irq_mask(struct irq_data *d)
63  {
64         unsigned irq = d->irq;
65         struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
66 -       unsigned gn = __bcm2708_irq_to_gpio(irq);
67 +       unsigned gn = irq_to_gpio(irq);
68         unsigned gb = gn / 32;
69         unsigned long rising  = readl(gpio->base + GPIOREN(gb));
70         unsigned long falling = readl(gpio->base + GPIOFEN(gb));
71 @@ -189,7 +189,7 @@ static void bcm2708_gpio_irq_unmask(struct irq_data *d)
72  {
73         unsigned irq = d->irq;
74         struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
75 -       unsigned gn = __bcm2708_irq_to_gpio(irq);
76 +       unsigned gn = irq_to_gpio(irq);
77         unsigned gb = gn / 32;
78         unsigned long rising  = readl(gpio->base + GPIOREN(gb));
79         unsigned long falling = readl(gpio->base + GPIOFEN(gb));
80 @@ -244,7 +244,7 @@ static irqreturn_t bcm2708_gpio_interrupt(int irq, void *dev_id)
81                 edsr = readl(__io_address(GPIO_BASE) + GPIOEDS(bank));
82                 for_each_set_bit(i, &edsr, 32) {
83                         gpio = i + bank * 32;
84 -                       generic_handle_irq(__bcm2708_gpio_to_irq(gpio));
85 +                       generic_handle_irq(gpio_to_irq(gpio));
86                 }
87                 writel(0xffffffff, __io_address(GPIO_BASE) + GPIOEDS(bank));
88         }
89 @@ -261,7 +261,7 @@ static void bcm2708_gpio_irq_init(struct bcm2708_gpio *ucb)
90  {
91         unsigned irq;
92  
93 -       ucb->gc.to_irq = bcm2708___bcm2708_gpio_to_irq;
94 +       ucb->gc.to_irq = bcm2708_gpio_to_irq;
95  
96         for (irq = GPIO_IRQ_START; irq < (GPIO_IRQ_START + GPIO_IRQS); irq++) {
97                 irq_set_chip_data(irq, ucb);
98 diff --git a/arch/arm/mach-bcm2708/include/mach/gpio.h b/arch/arm/mach-bcm2708/include/mach/gpio.h
99 index f09639a..f600bc7 100644
100 --- a/arch/arm/mach-bcm2708/include/mach/gpio.h
101 +++ b/arch/arm/mach-bcm2708/include/mach/gpio.h
102 @@ -11,8 +11,8 @@
103  
104  #define ARCH_NR_GPIOS 54 // number of gpio lines
105  
106 -#define __bcm2708_gpio_to_irq(x)   ((x) + GPIO_IRQ_START)
107 -#define __bcm2708_irq_to_gpio(x)   ((x) - GPIO_IRQ_START)
108 +#define gpio_to_irq(x) ((x) + GPIO_IRQ_START)
109 +#define irq_to_gpio(x) ((x) - GPIO_IRQ_START)
110  
111  #endif
112  
113 -- 
114 1.9.1
115