Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / drivers / pinctrl / pinctrl-at91.c
index 654b36517f9640ba0e9e3fbb4d66963532b8079f..dfd021e8268f40e8f8900bdb5e69f79c389accd6 100644 (file)
@@ -25,9 +25,7 @@
 /* Since we request GPIOs from ourself */
 #include <linux/pinctrl/consumer.h>
 
-#include <mach/hardware.h>
-#include <mach/at91_pio.h>
-
+#include "pinctrl-at91.h"
 #include "core.h"
 
 #define MAX_GPIO_BANKS         5
@@ -1344,7 +1342,6 @@ static void at91_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
        for (i = 0; i < chip->ngpio; i++) {
                unsigned mask = pin_to_mask(i);
                const char *gpio_label;
-               u32 pdsr;
 
                gpio_label = gpiochip_is_requested(chip, i);
                if (!gpio_label)
@@ -1353,11 +1350,13 @@ static void at91_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
                seq_printf(s, "[%s] GPIO%s%d: ",
                           gpio_label, chip->label, i);
                if (mode == AT91_MUX_GPIO) {
-                       pdsr = readl_relaxed(pio + PIO_PDSR);
-
-                       seq_printf(s, "[gpio] %s\n",
-                                  pdsr & mask ?
-                                  "set" : "clear");
+                       seq_printf(s, "[gpio] ");
+                       seq_printf(s, "%s ",
+                                     readl_relaxed(pio + PIO_OSR) & mask ?
+                                     "output" : "input");
+                       seq_printf(s, "%s\n",
+                                     readl_relaxed(pio + PIO_PDSR) & mask ?
+                                     "set" : "clear");
                } else {
                        seq_printf(s, "[periph %c]\n",
                                   mode + 'A' - 1);
@@ -1472,7 +1471,7 @@ static unsigned int gpio_irq_startup(struct irq_data *d)
        unsigned        pin = d->hwirq;
        int ret;
 
-       ret = gpio_lock_as_irq(&at91_gpio->chip, pin);
+       ret = gpiochip_lock_as_irq(&at91_gpio->chip, pin);
        if (ret) {
                dev_err(at91_gpio->chip.dev, "unable to lock pind %lu IRQ\n",
                        d->hwirq);
@@ -1488,7 +1487,7 @@ static void gpio_irq_shutdown(struct irq_data *d)
        unsigned        pin = d->hwirq;
 
        gpio_irq_mask(d);
-       gpio_unlock_as_irq(&at91_gpio->chip, pin);
+       gpiochip_unlock_as_irq(&at91_gpio->chip, pin);
 }
 
 #ifdef CONFIG_PM