Merge tag 'gpio-v5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 4 Apr 2020 17:27:00 +0000 (10:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 4 Apr 2020 17:27:00 +0000 (10:27 -0700)
Pull GPIO updates from Linus Walleij:
 "This is the bulk of GPIO development for the v5.7 kernel cycle.

  Core and userspace API:

   - The userspace API KFIFOs have been imoproved with locks that do not
     block interrupts. This makes us better at getting events to
     userspace without blocking or disturbing new events arriving in the
     same time. This was reviewed by the KFIFO maintainer Stefani. This
     is a generic improvement which paves the road for similar
     improvements in other subsystems.

   - We provide a new ioctl() for monitoring changes in the line
     information, such as when multiple clients are taking lines and
     giving them back, possibly reconfiguring them in the process: we
     can now monitor that and not get stuck with stale static
     information.

   - An example tool 'gpio-watch' is provided to showcase this
     functionality.

   - Timestamps for events are switched to ktime_get_ns() which is
     monotonic. We previously had a 'realtime' stamp which could move
     forward and *backward* in time, which probably would just cause
     silent bugs and weird behaviour. In the long run we see two
     relevant timestamps: ktime_get_ns() or the timestamp sometimes
     provided by the GPIO hardware itself, if that exists.

   - Device Tree overlay support for GPIO hogs. On systems that load
     overlays, these overlays can now contain hogs, and will then be
     respected.

   - Handle pin control interaction with nonexisting pin ranges in the
     GPIO library core instead of in the individual drivers.

  New drivers:

   - New driver for the Mellanox BlueField 2 GPIO controller.

  Driver improvements:

   - Introduce the BGPIOF_NO_SET_ON_INPUT flag to the generic MMIO GPIO
     library and use this flag in the MT7621 driver.

   - Texas Instruments OMAP CPU power management improvements, such as
     blocking of idle on pending GPIO interrupts"

* tag 'gpio-v5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (59 commits)
  Revert "gpio: eic-sprd: Use devm_platform_ioremap_resource()"
  pinctrl: Unconditionally assign .request()/.free()
  gpio: Unconditionally assign .request()/.free()
  gpio: export of_pinctrl_get to modules
  pinctrl: Define of_pinctrl_get() dummy for !PINCTRL
  gpio: Rename variable in core APIs
  gpio: Avoid using pin ranges with !PINCTRL
  gpiolib: Remove unused gpio_chip parameter from gpio_set_bias()
  gpiolib: Pass gpio_desc to gpio_set_config()
  gpiolib: Introduce gpiod_set_config()
  tools: gpio: Fix out-of-tree build regression
  gpio: gpiolib: fix a doc warning
  gpio: tegra186: Add Tegra194 pin ranges for GG.0 and GG.1
  gpio: tegra186: Add support for pin ranges
  gpio: Support GPIO controllers without pin-ranges
  ARM: integrator: impd1: Use GPIO_LOOKUP() helper macro
  gpio: brcmstb: support gpio-line-names property
  tools: gpio: Fix typo in gpio-utils
  tools: gpio-hammer: Apply scripts/Lindent and retain good changes
  gpiolib: gpio_name_to_desc: factor out !name check
  ...

1  2 
drivers/gpio/gpiolib.c
drivers/pinctrl/devicetree.c
drivers/pinctrl/pinctrl-ingenic.c
tools/gpio/.gitignore

index 86bde1e30a6091cb43b8c32d209ad16bd6d4e0ac,c2cc437ce8317f2965a195687b60117aa58eb1f0..40f2d7f69be26f228f00bdcf88b5c36ace3e855d
@@@ -2305,25 -2443,18 +2444,25 @@@ static void gpiochip_irq_enable(struct 
  
  static void gpiochip_irq_disable(struct irq_data *d)
  {
-       struct gpio_chip *chip = irq_data_get_irq_chip_data(d);
+       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  
-       if (chip->irq.irq_disable)
-               chip->irq.irq_disable(d);
-       else if (chip->irq.chip->irq_mask)
-               chip->irq.chip->irq_mask(d);
-       gpiochip_disable_irq(chip, d->hwirq);
 +      /*
 +       * Since we override .irq_disable() we need to mimic the
 +       * behaviour of __irq_disable() in irq/chip.c.
 +       * First call .irq_disable() if it exists, else mimic the
 +       * behaviour of mask_irq() which calls .irq_mask() if
 +       * it exists.
 +       */
 -      else
+       if (gc->irq.irq_disable)
+               gc->irq.irq_disable(d);
++      else if (gc->irq.chip->irq_mask)
+               gc->irq.chip->irq_mask(d);
+       gpiochip_disable_irq(gc, d->hwirq);
  }
  
- static void gpiochip_set_irq_hooks(struct gpio_chip *gpiochip)
+ static void gpiochip_set_irq_hooks(struct gpio_chip *gc)
  {
-       struct irq_chip *irqchip = gpiochip->irq.chip;
+       struct irq_chip *irqchip = gc->irq.chip;
  
        if (!irqchip->irq_request_resources &&
            !irqchip->irq_release_resources) {
Simple merge
Simple merge
index d0a66c48865c363c8bedb461b6123b54e1c4a551,eab36c6d77518143b71d34c9c084ecaf330bf365..a00d604027a268c2edbc0834ce2bb007e1595ad0
@@@ -1,5 -1,5 +1,6 @@@
 +# SPDX-License-Identifier: GPL-2.0-only
  gpio-event-mon
  gpio-hammer
+ gpio-watch
  lsgpio
  include/linux/gpio.h