Merge tag 'gpio-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Nov 2023 03:21:54 +0000 (17:21 -1000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Nov 2023 03:21:54 +0000 (17:21 -1000)
Pull gpio updates from Bartosz Golaszewski:
 "We don't have any new drivers. The loongson driver is getting extended
  with support for new models. There's a big refactor of gpio-pca953x
  and many small improvements to others.

  The GPIO code in the kernel has acquired a lot of cruft over the years
  as well as many abusers of the API across the kernel tree. This
  release cycle we have started a major cleanup and improvement effort
  that will most likely span several releases. We have started by
  converting external users of struct gpio_chip to accessing the wrapper
  around it - struct gpio_device. This is because the latter is
  reference counted while the former is removed when the provider is
  unbound. We also removed several instances of drivers accessing
  private GPIOLIB structures and including the private header from
  drivers/gpio/.

  To that end you'll see several commits aimed at different subsystems
  (acked by relevant maintainers) as well as two merges from the
  x86/platform tree.

  We'll then rework the locking in GPIOLIB which currently uses a big
  spinlock for many different things and could use becoming more
  fine-grained, especially as it doesn't even get the locking right.
  We'll also use SRCU for protecting the gpio_chip pointer against
  in-kernel hot-unplug crashes similar to what we saw triggered from
  user-space and fixed with semaphores in gpiolib-cdev. The core GPIOLIB
  is still vulnerable to these use-cases. I'm just mentioning the plans
  here, this is not part of this PR.

  You'll see some new instances of using __free(). We've added a
  gpio_device_put cleanup helper similar to the put_device one
  introduced by Peter Zijlstra and used it according to the preferred
  pattern except where it didn't make sense.

  GPIOLIB core:
   - provide interfaces allowing users to retrieve, manage and query the
     reference counted GPIO device instead of accessing the private
     gpio_chip structure
   - replace gpiochip_find() with gpio_device_find()
   - remove unused acpi_get_and_request_gpiod()
   - improve the ignore_interrupt functionality in GPIO ACPI
   - correct notifier return codes in gpiolib-of
   - unexport gpiod_set_transitory() as it's unused outside of core GPIO
     code
   - while there are still external users accessing struct gpio_chip,
     let's make gpiochip_get_desc() public so that they at least use the
     preferred helper
   - improve locking for lookup tables
   - annotate struct linereq with __counted_by
   - improve GPIOLIB docs
   - add an OF quirk for LED trigger sources

  Driver improvements:
   - convert all GPIO drivers with .remove() callbacks to using the new
     variant returning void instead of int
   - stop accessing the GPIOLIB private structures in gpio-mockup,
     i2c-mux-gpio, hte-tegra194, gpio-sim
   - use the recommended pattern for autofree variables in gpio-sim
   - add support for more models to gpio-loongson
   - use a notifier chain to notify other blocks about interrupts in
     gpio-eic-sprd instead of looking up GPIO devices on every interrupt
   - convert gpio-pca953x and gpio-fx6408 to using the maple tree regmap
     cache
   - don't include GPIOLIB internal headers in drivers which don't need
     them
   - move the ingenic NAND quirk into gpiolib-of
   - add an ignore interrupt quirk for Peaq C1010
   - drop static GPIO base from gpio-omap, gpio-f7188x
   - use the preferred device_get_match_data() function in drivers that
     still don't
   - refactor gpio-pca953x: switch to using DEFINE_SIMPLE_DEV_PM_OPS(),
     use cleanup helpers, use dev_err_probe() where it makes sense,
     fully convert to using devres and some other minor tweaks

  DT bindings:
   - add support for a new model to gpio-vf610 and update existing
     properties
   - add support for more loongson models
   - add missing support for imx models that are used but undocumented
   - convert bindings for Intel IXP4xx to schema

  Minor stuff:
   - deprecate gpio-mockup in favor of gpio-sim
   - include missing headers here and there
   - stop using gpiochip_find() in OMAP1 board files
   - minor tweaks in gpio-vf610, gpio-hisi
   - remove unneeded 'extern' specifiers from headers"

* tag 'gpio-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (108 commits)
  hte: tegra194: add GPIOLIB dependency
  hte: tegra194: don't access struct gpio_chip
  gpiolib: provide gpio_device_get_base()
  i2c: mux: gpio: don't fiddle with GPIOLIB internals
  gpiolib: provide gpiod_to_gpio_device()
  gpiolib: provide gpio_device_to_device()
  gpio: hisi: Fix format specifier
  gpiolib: provide gpio_device_find_by_fwnode()
  gpio: acpi: remove acpi_get_and_request_gpiod()
  gpio: Use device_get_match_data()
  gpio: vf610: update comment for i.MX8ULP and i.MX93 legacy compatibles
  platform/x86: int3472: Switch to devm_get_gpiod()
  platform/x86: int3472: Stop using gpiod_toggle_active_low()
  platform/x86: int3472: Add new skl_int3472_gpiod_get_from_temp_lookup() helper
  platform/x86: int3472: Add new skl_int3472_fill_gpiod_lookup() helper
  gpio: vf610: simplify code by dropping data check
  gpio: vf610: add i.MX8ULP of_device_id entry
  dt-bindings: gpio: vf610: add i.MX95 compatible
  dt-bindings: gpio: vf610: correct i.MX8ULP and i.MX93
  dt-bindings: gpio: vf610: update gpio-ranges
  ...

1  2 
MAINTAINERS
arch/arm/mach-omap1/board-ams-delta.c
drivers/gpio/gpio-sim.c
drivers/gpio/gpio-tb10x.c
drivers/gpio/gpio-vf610.c
drivers/gpio/gpiolib-acpi.c
drivers/i2c/muxes/i2c-mux-gpio.c

diff --cc MAINTAINERS
index d2cde0de8ac29394f45b7333d3b37a31362faf65,4e216887eb7642b6915ef5cf0002806a2635f15d..9277814f30d0b03eb6ff76c9ba145e467c722041
@@@ -2224,10 -2214,10 +2224,10 @@@ M:   Imre Kaloz <kaloz@openwrt.org
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml
- F:    Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.txt
+ F:    Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.yaml
  F:    Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml
  F:    Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion*
 +F:    Documentation/devicetree/bindings/rng/intel,ixp46x-rng.yaml
  F:    Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml
  F:    arch/arm/boot/dts/intel/ixp/
  F:    arch/arm/mach-ixp4xx/
Simple merge
Simple merge
index f96d260a4a19d8b788dbf92aef7da5c4e0bfcb63,a11d03d772c44612c8d975bcd6c66bb58980ee92..e8c1485b9c735600a37ad74007d023fd76c976a5
@@@ -209,13 -209,9 +209,13 @@@ static int tb10x_gpio_probe(struct plat
        }
  
        return 0;
 +
 +err_remove_domain:
 +      irq_domain_remove(tb10x_gpio->domain);
 +      return ret;
  }
  
- static int tb10x_gpio_remove(struct platform_device *pdev)
+ static void tb10x_gpio_remove(struct platform_device *pdev)
  {
        struct tb10x_gpio *tb10x_gpio = platform_get_drvdata(pdev);
  
index 656d6b1dddb5db90725224891b2a164b52a8d6c1,a89ae84a1fa0a47a8a6773ef29ff544438240780..444501c56a3bc10e71e6e46e2078c1c7e8d28c93
@@@ -126,9 -140,7 +140,9 @@@ static int vf610_gpio_direction_output(
        unsigned long mask = BIT(gpio);
        u32 val;
  
-       if (port->sdata && port->sdata->have_paddr) {
 +      vf610_gpio_set(chip, gpio, value);
 +
+       if (port->sdata->have_paddr) {
                val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR);
                val |= mask;
                vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR);
Simple merge
Simple merge