Commit c0f234ff authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'gpio-updates-for-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio updates from Bartosz Golaszewski:
 "We have a new GPIO multiplexer driver, bunch of driver updates and
  refactoring in the core GPIO library.

  GPIO core:
   - teach gpiolib to work with software nodes for HW description
   - remove ARCH_NR_GPIOS treewide as we no longer impose any limit on
     the number of GPIOS since the allocation became entirely dynamic
   - add support for HW quirks for Cirrus CS42L56 codec, Marvell NFC
     controller, Freescale PCIe and Ethernet controller, Himax LCDs and
     Mediatek mt2701
   - refactor OF quirk code
   - some general refactoring of the OF and ACPI code, adding new
     helpers, minor tweaks and fixes, making fwnode usage consistent
     etc.

  GPIO uAPI:
   - fix an issue where the user-space can trigger a NULL-pointer
     dereference in the kernel by opening a device file, forcing a
     driver unbind and then calling one of the syscalls on the
     associated file descriptor

  New drivers:
   - add gpio-latch: a new GPIO multiplexer based on latches connected
     to other GPIOs

  Driver updates:
   - convert i2c GPIO expanders to using .probe_new()
   - drop the gpio-sta2x11 driver
   - factor out common code for the ACCES IDIO-16 family of controllers
     and use this new library wherever applicable in drivers
   - add DT support to gpio-hisi
   - allow building gpio-davinci as a module and increase its maxItems
     property
   - add support for a new model to gpio-pca9570
   - other minor changes to various drivers"

* tag 'gpio-updates-for-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (66 commits)
  gpio: sim: set a limit on the number of GPIOs
  gpiolib: protect the GPIO device against being dropped while in use by user-space
  gpiolib: cdev: fix NULL-pointer dereferences
  gpiolib: Provide to_gpio_device() helper
  gpiolib: Unify access to the device properties
  gpio: Do not include <linux/kernel.h> when not really needed.
  gpio: pcf857x: Convert to i2c's .probe_new()
  gpio: pca953x: Convert to i2c's .probe_new()
  gpio: max732x: Convert to i2c's .probe_new()
  dt-bindings: gpio: gpio-davinci: Increase maxItems in gpio-line-names
  gpiolib: ensure that fwnode is properly set
  gpio: sl28cpld: Replace irqchip mask_invert with unmask_base
  gpiolib: of: Use correct fwnode for DT-probed chips
  gpiolib: of: Drop redundant check in of_mm_gpiochip_remove()
  gpiolib: of: Prepare of_mm_gpiochip_add_data() for fwnode
  gpiolib: add support for software nodes
  gpiolib: consolidate GPIO lookups
  gpiolib: acpi: avoid leaking ACPI details into upper gpiolib layers
  gpiolib: acpi: teach acpi_find_gpio() to handle data-only nodes
  gpiolib: acpi: change acpi_find_gpio() to accept firmware node
  ...
parents 9fa4abc9 11e47bbd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ properties:
  gpio-line-names:
    description: strings describing the names of each gpio line.
    minItems: 1
    maxItems: 100
    maxItems: 144

  "#gpio-cells":
    const: 2
+94 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/gpio-latch.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO latch controller

maintainers:
  - Sascha Hauer <s.hauer@pengutronix.de>

description: |
  This binding describes a GPIO multiplexer based on latches connected to
  other GPIOs, like this:

  CLK0 ----------------------.        ,--------.
  CLK1 -------------------.  `--------|>    #0 |
                          |           |        |
  OUT0 ----------------+--|-----------|D0    Q0|-----|<
  OUT1 --------------+-|--|-----------|D1    Q1|-----|<
  OUT2 ------------+-|-|--|-----------|D2    Q2|-----|<
  OUT3 ----------+-|-|-|--|-----------|D3    Q3|-----|<
  OUT4 --------+-|-|-|-|--|-----------|D4    Q4|-----|<
  OUT5 ------+-|-|-|-|-|--|-----------|D5    Q5|-----|<
  OUT6 ----+-|-|-|-|-|-|--|-----------|D6    Q6|-----|<
  OUT7 --+-|-|-|-|-|-|-|--|-----------|D7    Q7|-----|<
         | | | | | | | |  |           `--------'
         | | | | | | | |  |
         | | | | | | | |  |           ,--------.
         | | | | | | | |  `-----------|>    #1 |
         | | | | | | | |              |        |
         | | | | | | | `--------------|D0    Q0|-----|<
         | | | | | | `----------------|D1    Q1|-----|<
         | | | | | `------------------|D2    Q2|-----|<
         | | | | `--------------------|D3    Q3|-----|<
         | | | `----------------------|D4    Q4|-----|<
         | | `------------------------|D5    Q5|-----|<
         | `--------------------------|D6    Q6|-----|<
         `----------------------------|D7    Q7|-----|<
                                      `--------'

  The number of clk-gpios and latched-gpios is not fixed. The actual number
  of number of latches and the number of inputs per latch is derived from
  the number of GPIOs given in the corresponding device tree properties.

properties:
  compatible:
    const: gpio-latch
  "#gpio-cells":
    const: 2

  clk-gpios:
    description: Array of GPIOs to be used to clock a latch

  latched-gpios:
    description: Array of GPIOs to be used as inputs per latch

  setup-duration-ns:
    description: Delay in nanoseconds to wait after the latch inputs have been
      set up

  clock-duration-ns:
    description: Delay in nanoseconds to wait between clock output changes

  gpio-controller: true

  gpio-line-names: true

required:
  - compatible
  - "#gpio-cells"
  - gpio-controller
  - clk-gpios
  - latched-gpios

additionalProperties: false

examples:
  - |
    gpio-latch {
        #gpio-cells = <2>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_di_do_leds>;
        compatible = "gpio-latch";
        gpio-controller;
        setup-duration-ns = <100>;
        clock-duration-ns = <100>;

        clk-gpios = <&gpio3 7 0>, <&gpio3 8 0>;
        latched-gpios = <&gpio3 21 0>, <&gpio3 22 0>,
                       <&gpio3 23 0>, <&gpio3 24 0>,
                       <&gpio3 25 0>, <&gpio3 26 0>,
                       <&gpio3 27 0>, <&gpio3 28 0>;
    };
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ maintainers:
properties:
  compatible:
    enum:
      - dlg,slg7xl45106
      - nxp,pca9570
      - nxp,pca9571

+56 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/hisilicon,ascend910-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: HiSilicon common GPIO controller

maintainers:
  - Jay Fang <f.fangjian@huawei.com>

description:
  The HiSilicon common GPIO controller can be used for many different
  types of SoC such as Huawei Ascend AI series chips.

properties:
  compatible:
    const: hisilicon,ascend910-gpio

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  gpio-controller: true

  "#gpio-cells":
    const: 2

  ngpios:
    minimum: 1
    maximum: 32

required:
  - compatible
  - reg
  - interrupts
  - gpio-controller
  - "#gpio-cells"
  - ngpios

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    gpio@840d0000 {
      compatible = "hisilicon,ascend910-gpio";
      reg = <0x840d0000 0x1000>;
      ngpios = <32>;
      gpio-controller;
      #gpio-cells = <2>;
      interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
    };
+0 −5
Original line number Diff line number Diff line
@@ -558,11 +558,6 @@ Platform Support
To force-enable this framework, a platform's Kconfig will "select" GPIOLIB,
else it is up to the user to configure support for GPIO.

It may also provide a custom value for ARCH_NR_GPIOS, so that it better
reflects the number of GPIOs in actual use on that platform, without
wasting static table space.  (It should count both built-in/SoC GPIOs and
also ones on GPIO expanders.

If neither of these options are selected, the platform does not support
GPIOs through GPIO-lib and the code cannot be enabled by the user.

Loading