]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'gpio-lw/for-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Jul 2012 02:29:01 +0000 (12:29 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Jul 2012 02:29:01 +0000 (12:29 +1000)
Conflicts:
drivers/gpio/gpio-mxc.c

13 files changed:
1  2 
Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt
MAINTAINERS
arch/arm/boot/dts/imx51.dtsi
arch/arm/boot/dts/imx53.dtsi
arch/arm/boot/dts/imx6q.dtsi
arch/arm/mach-imx/mm-imx25.c
arch/arm/mach-imx/mm-imx3.c
arch/arm/mach-imx/mm-imx5.c
drivers/gpio/Kconfig
drivers/gpio/Makefile
drivers/gpio/gpio-mxc.c
drivers/gpio/gpio-omap.c
drivers/gpio/gpio-wm8994.c

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 04691d3abe6061feade251bf9c363fc998b1f21c,bb985e815533ca864aa522c9c74b940981117c51..436729fecd4880035961af49397c600edd100a19
@@@ -160,15 -184,19 +184,19 @@@ static int gpio_set_irq_type(struct irq
                edge = GPIO_INT_FALL_EDGE;
                break;
        case IRQ_TYPE_EDGE_BOTH:
-               val = gpio_get_value(gpio);
-               if (val) {
-                       edge = GPIO_INT_LOW_LEV;
-                       pr_debug("mxc: set GPIO %d to low trigger\n", gpio);
+               if (GPIO_EDGE_SEL >= 0) {
+                       edge = GPIO_INT_BOTH_EDGES;
                } else {
-                       edge = GPIO_INT_HIGH_LEV;
-                       pr_debug("mxc: set GPIO %d to high trigger\n", gpio);
+                       val = gpio_get_value(gpio);
+                       if (val) {
+                               edge = GPIO_INT_LOW_LEV;
+                               pr_debug("mxc: set GPIO %d to low trigger\n", gpio);
+                       } else {
+                               edge = GPIO_INT_HIGH_LEV;
+                               pr_debug("mxc: set GPIO %d to high trigger\n", gpio);
+                       }
 -                      port->both_edges |= 1 << (gpio & 31);
++                      port->both_edges |= 1 << gpio_idx;
                }
-               port->both_edges |= 1 << gpio_idx;
                break;
        case IRQ_TYPE_LEVEL_LOW:
                edge = GPIO_INT_LOW_LEV;
                return -EINVAL;
        }
  
-       reg += GPIO_ICR1 + ((gpio_idx & 0x10) >> 2); /* ICR1 or ICR2 */
-       bit = gpio_idx & 0xf;
-       val = readl(reg) & ~(0x3 << (bit << 1));
-       writel(val | (edge << (bit << 1)), reg);
+       if (GPIO_EDGE_SEL >= 0) {
+               val = readl(port->base + GPIO_EDGE_SEL);
+               if (edge == GPIO_INT_BOTH_EDGES)
 -                      writel(val | (1 << (gpio & 0x1f)),
++                      writel(val | (1 << gpio_idx),
+                               port->base + GPIO_EDGE_SEL);
+               else
 -                      writel(val & ~(1 << (gpio & 0x1f)),
++                      writel(val & ~(1 << gpio_idx),
+                               port->base + GPIO_EDGE_SEL);
+       }
+       if (edge != GPIO_INT_BOTH_EDGES) {
 -              reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */
 -              bit = gpio & 0xf;
++              reg += GPIO_ICR1 + ((gpio_idx & 0x10) >> 2); /* ICR1 or ICR2 */
++              bit = gpio_idx & 0xf;
+               val = readl(reg) & ~(0x3 << (bit << 1));
+               writel(val | (edge << (bit << 1)), reg);
+       }
 -      writel(1 << (gpio & 0x1f), port->base + GPIO_ISR);
 +      writel(1 << gpio_idx, port->base + GPIO_ISR);
  
        return 0;
  }
Simple merge
Simple merge