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

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

Pull gpio updates from Bartosz Golaszewski:
 "We have a lot of code refactoring using common helpers and ended up
  removing more lines then we're adding this release cycle.

  Nothing really stands out, just small updates all over the place.

  Core GPIOLIB updates:
   - wake-up poll() in user-space on device unbind
   - improve fwnode usage
   - interrupt domain handling improvements
   - correctly handle the ngpios property in gpio-mmio

  Driver cleanups:
   - remove unneeded calls to platform_set_drvdata() all around the
     place
   - remove unneeded of_match_ptr() expansions whenever a driver depends
     on CONFIG_OF
   - remove redundant calls to dev_err_probe() from gpio-omap and
     gpio-davinci

  Driver improvements:
   - use autopointers and guards from cleanup.h in gpio-sim
   - shrink code in gpio-sim using some common helpers
   - convert the idio family of drivers to using gpio-regmap
   - convert gpio-ws16c48 to using gpio-regmap
   - use devres to simplify code in gpio-pisosr and gpio-mxc
   - update gpio-sifive: support IRQ wake, improve interrupt handling,
     allow building as module
   - make gpio-ge and gpio-bcm-kona OF-independent (plus some minor
     tweaks)
   - add support for new models in gpio-pca953x and gpio-ds4520
   - add runtime PM support to gpio-mxc
   - fix a build warning in gpio-mxs
   - add support for adding pin ranges to gpio-mlxbf3
   - add counter/timer support to gpio-104-dio-48e
   - switch to dynamic GPIO base allocation in gpio-vf610
   - minor oneliners here and there

  Device-tree bindings updates:
   - enable the gpio-line-names property in snps,dw-apb and STMPE GPIO
   - document new models in fsl-imx-gpio, ds4520 and pca95xx
   - convert the bindings for brcm,kona-gpio to YAML"

* tag 'gpio-updates-for-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (94 commits)
  gpio: pca953x: add support for TCA9538
  dt-bindings: gpio: pca95xx: document new tca9538 chip
  gpio: pca953x: Use i2c_get_match_data()
  gpio: mlxbf3: use capital "OR" for multiple licenses in SPDX
  gpio: pcf857x: Extend match data support for OF tables
  gpio: vf610: switch to dynamic allocat GPIO base
  gpiolib: provide and use gpiod_line_state_notify()
  gpio: cdev: wake up lineevent poll() on device unbind
  gpio: cdev: wake up linereq poll() on device unbind
  gpio: cdev: wake up chardev poll() on device unbind
  gpiolib: add a second blocking notifier to struct gpio_device
  gpio: cdev: open-code to_gpio_chardev_data()
  gpiolib: rename the gpio_device notifier
  gpio: mlxbf3: Support add_pin_ranges()
  gpio: mxc: Use helper function devm_clk_get_optional_enabled()
  gpio: pca9570: fix kerneldoc
  gpio: sim: simplify code with cleanup helpers
  gpio: sim: replace memmove() + strstrip() with skip_spaces() + strim()
  gpio: sim: simplify gpio_sim_device_config_live_store()
  gpio: mxc: release the parent IRQ in runtime suspend
  ...
parents 41e97d7a 3d0957b0
Loading
Loading
Loading
Loading
+51 −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/adi,ds4520-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: DS4520 I2C GPIO expander

maintainers:
  - Okan Sahin <okan.sahin@analog.com>

properties:
  compatible:
    enum:
      - adi,ds4520-gpio

  reg:
    maxItems: 1

  gpio-controller: true

  "#gpio-cells":
    const: 2

  ngpios:
    minimum: 1
    maximum: 9

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

additionalProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        gpio@50 {
            compatible = "adi,ds4520-gpio";
            reg = <0x50>;
            ngpios = <9>;
            gpio-controller;
            #gpio-cells = <2>;
        };
    };
+0 −52
Original line number Diff line number Diff line
Broadcom Kona Family GPIO
=========================

This GPIO driver is used in the following Broadcom SoCs:
  BCM11130, BCM11140, BCM11351, BCM28145, BCM28155

The Broadcom GPIO Controller IP can be configured prior to synthesis to
support up to 8 banks of 32 GPIOs where each bank has its own IRQ. The
GPIO controller only supports edge, not level, triggering of interrupts.

Required properties
-------------------

- compatible: "brcm,bcm11351-gpio", "brcm,kona-gpio"
- reg: Physical base address and length of the controller's registers.
- interrupts: The interrupt outputs from the controller. There is one GPIO
  interrupt per GPIO bank. The number of interrupts listed depends on the
  number of GPIO banks on the SoC. The interrupts must be ordered by bank,
  starting with bank 0. There is always a 1:1 mapping between banks and
  IRQs.
- #gpio-cells: Should be <2>. The first cell is the pin number, the second
  cell is used to specify optional parameters:
  - bit 0 specifies polarity (0 for normal, 1 for inverted)
  See also "gpio-specifier" in .../devicetree/bindings/gpio/gpio.txt.
- #interrupt-cells: Should be <2>. The first cell is the GPIO number. The
  second cell is used to specify flags. The following subset of flags is
  supported:
  - trigger type (bits[1:0]):
      1 = low-to-high edge triggered.
      2 = high-to-low edge triggered.
      3 = low-to-high or high-to-low edge triggered
      Valid values are 1, 2, 3
  See also .../devicetree/bindings/interrupt-controller/interrupts.txt.
- gpio-controller: Marks the device node as a GPIO controller.
- interrupt-controller: Marks the device node as an interrupt controller.

Example:
	gpio: gpio@35003000 {
		compatible = "brcm,bcm11351-gpio", "brcm,kona-gpio";
		reg = <0x35003000 0x800>;
		interrupts =
		       <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH
			GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH
			GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH
			GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
			GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH
			GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
		#gpio-cells = <2>;
		#interrupt-cells = <2>;
		gpio-controller;
		interrupt-controller;
	};
+100 −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/brcm,kona-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Broadcom Kona family GPIO controller

description:
  The Broadcom GPIO Controller IP can be configured prior to synthesis to
  support up to 8 banks of 32 GPIOs where each bank has its own IRQ. The
  GPIO controller only supports edge, not level, triggering of interrupts.

maintainers:
  - Ray Jui <rjui@broadcom.com>

properties:
  compatible:
    items:
      - enum:
          - brcm,bcm11351-gpio
          - brcm,bcm21664-gpio
          - brcm,bcm23550-gpio
      - const: brcm,kona-gpio

  reg:
    maxItems: 1

  interrupts:
    minItems: 4
    maxItems: 6
    description:
      The interrupt outputs from the controller. There is one GPIO interrupt
      per GPIO bank. The number of interrupts listed depends on the number of
      GPIO banks on the SoC. The interrupts must be ordered by bank, starting
      with bank 0. There is always a 1:1 mapping between banks and IRQs.

  '#gpio-cells':
    const: 2

  '#interrupt-cells':
    const: 2

  gpio-controller: true

  interrupt-controller: true

required:
  - compatible
  - reg
  - interrupts
  - '#gpio-cells'
  - '#interrupt-cells'
  - gpio-controller
  - interrupt-controller

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: brcm,bcm11351-gpio
    then:
      properties:
        interrupts:
          minItems: 6
  - if:
      properties:
        compatible:
          contains:
            enum:
              - brcm,bcm21664-gpio
              - brcm,bcm23550-gpio
    then:
      properties:
        interrupts:
          maxItems: 4

additionalProperties: false

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

    gpio@35003000 {
        compatible = "brcm,bcm11351-gpio", "brcm,kona-gpio";
        reg = <0x35003000 0x800>;
        interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
        #gpio-cells = <2>;
        #interrupt-cells = <2>;
        gpio-controller;
        interrupt-controller;
    };
...
+2 −0
Original line number Diff line number Diff line
@@ -32,10 +32,12 @@ properties:
              - fsl,imx6sx-gpio
              - fsl,imx6ul-gpio
              - fsl,imx7d-gpio
              - fsl,imx8dxl-gpio
              - fsl,imx8mm-gpio
              - fsl,imx8mn-gpio
              - fsl,imx8mp-gpio
              - fsl,imx8mq-gpio
              - fsl,imx8qm-gpio
              - fsl,imx8qxp-gpio
              - fsl,imxrt1050-gpio
              - fsl,imxrt1170-gpio
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ properties:
              - ti,tca6408
              - ti,tca6416
              - ti,tca6424
              - ti,tca9538
              - ti,tca9539
              - ti,tca9554

Loading