]> Git Repo - linux.git/commitdiff
Merge tag 'gpio-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
authorLinus Torvalds <[email protected]>
Thu, 16 Aug 2018 04:35:38 +0000 (21:35 -0700)
committerLinus Torvalds <[email protected]>
Thu, 16 Aug 2018 04:35:38 +0000 (21:35 -0700)
Pull GPIO updates from Linus Walleij:
 "This is the bulk of GPIO changes for the v4.19 kernel cycle.

  I don't know if anything in particular stands out. Maybe the Aspeed
  coprocessor thing from Benji: Aspeed is doing baseboard management
  chips (BMC's) for servers etc.

  These Aspeed's are ARM processors that exist inside (I guess) Intel
  servers, and they are moving forward to using mainline Linux in those.
  This is one of the pieces of the puzzle to achive that. They are doing
  OpenBMC, it's pretty cool: https://lwn.net/Articles/683320/

  Summary:

  Core changes:

   - Add a new API for explicitly naming GPIO consumers, when needed.

   - Don't let userspace set values on input lines. While we do not
     think anyone would do this crazy thing we better plug the hole
     before someone uses it and think it's a nifty feature.

   - Avoid calling chip->request() for unused GPIOs.

  New drivers/subdrivers:

   - The Mediatek MT7621 is supported which is a big win for OpenWRT and
     similar router distributions using this chip, as it seems every
     major router manufacturer on the planet has made products using
     this chip: https://wikidevi.com/wiki/MediaTek_MT7621

   - The Tegra 194 is now supported.

   - The IT87 driver now supports IT8786E and IT8718F super-IO chips.

   - Add support for Rockchip RK3328 in the syscon GPIO driver.

  Driver changes:

   - Handle the get/set_multiple() properly on MMIO chips with inverted
     direction registers. We didn't have this problem until a new chip
     appear that has get/set registers AND inverted direction bits, OK
     now we handle it.

   - A patch series making more error codes percolate upward properly
     for different errors on gpiochip_lock_as_irq().

   - Get/set multiple for the OMAP driver, accelerating these multiple
     line operations if possible.

   - A coprocessor interface for the Aspeed driver. Sometimes a few GPIO
     lines need to be grabbed by a co-processor for doing automated
     tasks, sometimes they are available as GPIO lines. By adding an
     explicit API in this driver we make it possible for the two line
     consumers to coexist. (This work was made available on the
     ib-aspeed branch, which may be appearing in other pull requests.)

   - Implemented .get_direction() and open drain in the SCH311x driver.

   - Continuing cleanup of included headers in GPIO drivers"

* tag 'gpio-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (80 commits)
  gpio: it87: Add support for IT8613
  gpio: it87: add support for IT8718F Super I/O.
  gpiolib: Avoid calling chip->request() for unused gpios
  gpio: tegra: Include the right header
  gpio: mmio: Fix up inverted direction registers
  gpio: xilinx: Use the right include
  gpio: timberdale: Include the right header
  gpio: tb10x: Use the right include
  gpiolib: Fix of_node inconsistency
  gpio: vr41xx: Bail out on gpiochip_lock_as_irq() error
  gpio: uniphier: Bail out on gpiochip_lock_as_irq() error
  gpio: xgene-sb: Don't shadow error code of gpiochip_lock_as_irq()
  gpio: em: Don't shadow error code of gpiochip_lock_as_irq()
  gpio: dwapb: Don't shadow error code of gpiochip_lock_as_irq()
  gpio: bcm-kona: Don't shadow error code of gpiochip_lock_as_irq()
  gpiolib: Don't shadow error code of gpiochip_lock_as_irq()
  gpio: syscon: rockchip: add GRF GPIO support for rk3328
  gpio: omap: Add get/set_multiple() callbacks
  gpio: pxa: remove set but not used variable 'gpio_offset'
  gpio-it87: add support for IT8786E Super I/O
  ...

1  2 
Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
drivers/gpio/gpio-tegra.c
drivers/gpio/gpio-uniphier.c
drivers/gpio/gpiolib-of.c

index fe1bf24104d30138d91aefacc07407afa194ce16,cd5ccdc5e66ffe31d7cfcb60ecb86a451a2c26f9..4018ee57a6af5a662a37640262a6dd972daf02de
@@@ -17,6 -17,7 +17,7 @@@ Required Properties
      - "renesas,gpio-r8a7796": for R8A7796 (R-Car M3-W) compatible GPIO controller.
      - "renesas,gpio-r8a77965": for R8A77965 (R-Car M3-N) compatible GPIO controller.
      - "renesas,gpio-r8a77970": for R8A77970 (R-Car V3M) compatible GPIO controller.
+     - "renesas,gpio-r8a77980": for R8A77980 (R-Car V3H) compatible GPIO controller.
      - "renesas,gpio-r8a77990": for R8A77990 (R-Car E3) compatible GPIO controller.
      - "renesas,gpio-r8a77995": for R8A77995 (R-Car D3) compatible GPIO controller.
      - "renesas,rcar-gen1-gpio": for a generic R-Car Gen1 GPIO controller.
@@@ -31,6 -32,7 +32,6 @@@
    - reg: Base address and length of each memory resource used by the GPIO
      controller hardware module.
  
 -  - interrupt-parent: phandle of the parent interrupt controller.
    - interrupts: Interrupt specifier for the controllers interrupt.
  
    - gpio-controller: Marks the device node as a gpio controller.
index d5d79727c55dd0df9066c4a7202f2c66072631dc,8e5f3150c6aff0e750c8472a034c8cd818e8da67..47dbd19751d0d4ffc0d51c4f48c33f287759b34b
@@@ -22,7 -22,7 +22,7 @@@
  #include <linux/irq.h>
  #include <linux/interrupt.h>
  #include <linux/io.h>
- #include <linux/gpio.h>
+ #include <linux/gpio/driver.h>
  #include <linux/of_device.h>
  #include <linux/platform_device.h>
  #include <linux/module.h>
@@@ -207,7 -207,7 +207,7 @@@ static int tegra_gpio_get_direction(str
  
        oe = tegra_gpio_readl(tgi, GPIO_OE(tgi, offset));
  
-       return (oe & pin_mask) ? GPIOF_DIR_OUT : GPIOF_DIR_IN;
+       return !(oe & pin_mask);
  }
  
  static int tegra_gpio_set_debounce(struct gpio_chip *chip, unsigned int offset,
@@@ -323,13 -323,6 +323,6 @@@ static int tegra_gpio_irq_set_type(stru
                return -EINVAL;
        }
  
-       ret = gpiochip_lock_as_irq(&tgi->gc, gpio);
-       if (ret) {
-               dev_err(tgi->dev,
-                       "unable to lock Tegra GPIO %u as IRQ\n", gpio);
-               return ret;
-       }
        spin_lock_irqsave(&bank->lvl_lock[port], flags);
  
        val = tegra_gpio_readl(tgi, GPIO_INT_LVL(tgi, gpio));
        tegra_gpio_mask_write(tgi, GPIO_MSK_OE(tgi, gpio), gpio, 0);
        tegra_gpio_enable(tgi, gpio);
  
+       ret = gpiochip_lock_as_irq(&tgi->gc, gpio);
+       if (ret) {
+               dev_err(tgi->dev,
+                       "unable to lock Tegra GPIO %u as IRQ\n", gpio);
+               tegra_gpio_disable(tgi, gpio);
+               return ret;
+       }
        if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
                irq_set_handler_locked(d, handle_level_irq);
        else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
@@@ -550,13 -551,6 +551,6 @@@ static const struct dev_pm_ops tegra_gp
        SET_SYSTEM_SLEEP_PM_OPS(tegra_gpio_suspend, tegra_gpio_resume)
  };
  
- /*
-  * This lock class tells lockdep that GPIO irqs are in a different category
-  * than their parents, so it won't report false recursion.
-  */
- static struct lock_class_key gpio_lock_class;
- static struct lock_class_key gpio_request_class;
  static int tegra_gpio_probe(struct platform_device *pdev)
  {
        struct tegra_gpio_info *tgi;
  
                bank = &tgi->bank_info[GPIO_BANK(gpio)];
  
-               irq_set_lockdep_class(irq, &gpio_lock_class,
-                                     &gpio_request_class);
                irq_set_chip_data(irq, bank);
                irq_set_chip_and_handler(irq, &tgi->ic, handle_simple_irq);
        }
@@@ -720,4 -712,4 +712,4 @@@ static int __init tegra_gpio_init(void
  {
        return platform_driver_register(&tegra_gpio_driver);
  }
 -postcore_initcall(tegra_gpio_init);
 +subsys_initcall(tegra_gpio_init);
index 58faeb1cef63abaf8cadd77e9c3960f3ee7e17ee,ed2badecc0508c9d2db28cf68638d19dd4a11ff5..7fdac906097980f37e05cb23060369f4e3377a02
@@@ -181,11 -181,7 +181,11 @@@ static int uniphier_gpio_to_irq(struct 
        fwspec.fwnode = of_node_to_fwnode(chip->parent->of_node);
        fwspec.param_count = 2;
        fwspec.param[0] = offset - UNIPHIER_GPIO_IRQ_OFFSET;
 -      fwspec.param[1] = IRQ_TYPE_NONE;
 +      /*
 +       * IRQ_TYPE_NONE is rejected by the parent irq domain. Set LEVEL_HIGH
 +       * temporarily. Anyway, ->irq_set_type() will override it later.
 +       */
 +      fwspec.param[1] = IRQ_TYPE_LEVEL_HIGH;
  
        return irq_create_fwspec_mapping(&fwspec);
  }
@@@ -310,8 -306,7 +310,7 @@@ static int uniphier_gpio_irq_domain_act
        struct uniphier_gpio_priv *priv = domain->host_data;
        struct gpio_chip *chip = &priv->chip;
  
-       gpiochip_lock_as_irq(chip, data->hwirq + UNIPHIER_GPIO_IRQ_OFFSET);
-       return 0;
+       return gpiochip_lock_as_irq(chip, data->hwirq + UNIPHIER_GPIO_IRQ_OFFSET);
  }
  
  static void uniphier_gpio_irq_domain_deactivate(struct irq_domain *domain,
index 53a14ee8ad6d364788a891d4f2aa083956df5f04,91174bf15cf38af850e15a5622c89cbeb36b2bcb..a4f1157d6aa0893707d3880c9f0be4639c909b03
@@@ -64,8 -64,7 +64,8 @@@ static void of_gpio_flags_quirks(struc
         * Note that active low is the default.
         */
        if (IS_ENABLED(CONFIG_REGULATOR) &&
 -          (of_device_is_compatible(np, "reg-fixed-voltage") ||
 +          (of_device_is_compatible(np, "regulator-fixed") ||
 +           of_device_is_compatible(np, "reg-fixed-voltage") ||
             of_device_is_compatible(np, "regulator-gpio"))) {
                /*
                 * The regulator GPIO handles are specified such that the
@@@ -621,9 -620,6 +621,6 @@@ int of_gpiochip_add(struct gpio_chip *c
  {
        int status;
  
-       if ((!chip->of_node) && (chip->parent))
-               chip->of_node = chip->parent->of_node;
        if (!chip->of_node)
                return 0;
  
This page took 0.068665 seconds and 4 git commands to generate.