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

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

Pull gpio updates from Bartosz Golaszewski:
 "We have two new drivers, some improvements to the core code, lots of
  different updates to existing GPIO drivers and some dt-bindings on
  top.

  There's nothing controversial in here and almost everything has been
  in next for more than a week (95% a lot longer than this). The only
  thing that has spent less time in next is a new driver so no risk of
  regressions.

  The single merge pulls in changes that remove all usage of global GPIO
  numbers from arch/arm/mach-omap.

  Core GPIO library:
   - remove unused symbols
   - don't spam the kernel log with messages about hogs
   - remove old sysfs API cruft
   - improve handling of GPIO masks

  New drivers:
   - add a driver for the BlueField-3 GPIO controller
   - add GPIO support for the TPS65219 PMIC

  Driver improvements:
   - extend the gpio-aggregator driver to support ramp-up/ramp-down
     delay
   - remove unnecessary CONFIG_OF guards from gpio-aggregator
   - readability improvements in gpio-tangier
   - switch i2c drivers back to using probe() now that it's been
     converted in the i2c subsystem to not taking the id parameter
   - remove unused inclusions of of_gpio.h in several drivers
   - make pm ops static in gpio-davinci and fix a comment
   - use more devres in drivers to shrink and simplify the code
   - add missing include in gpio-sa1100
   - add HAS_IOPORT KConfig dependency where needed
   - add permissions checks before accessing pins in gpio-tegra186
   - convert the gpio-zynq driver to using immutable irqchips
   - preserve output settings set by the bootloader in gpio-mpc8xxx

  Selftests:
   - tweak the variable naming in script tests

  Device tree updates:
   - convert gpio-mmio and gpio-stmpe to YAML
   - add parsing of GPIO hogs to gpio-vf610
   - add bindings for the Cirrus EP93xx GPIO controller
   - add gpio-line-names property to the gpio-pca9570 bindings
   - extend the binding for x-powers,axp209 with another block"

* tag 'gpio-updates-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (58 commits)
  of: unittest: drop assertions for GPIO hog messages
  gpiolib: Drop unused domain_ops memeber of GPIO IRQ chip
  gpio: synq: remove unused zynq_gpio_irq_reqres/zynq_gpio_irq_relres
  dt-bindings: gpio: gpio-vf610: Add parsing of hogs
  gpio: lpc18xx: Remove unused of_gpio.h inclusion
  gpio: xra1403: Remove unused of_gpio.h inclusion
  gpio: mpc8xxx: Remove unused of_gpio.h inclusion
  dt-bindings: gpio: Add Cirrus EP93xx
  gpio: mpc8xxx: latch GPIOs state on module load when configured as output
  selftests: gpio: gpio-sim: Use same variable name for sysfs pathname
  gpio: mlxbf3: Add gpio driver support
  gpio: delay: Remove duplicative functionality
  gpio: aggregator: Set up a parser of delay line parameters
  gpio: aggregator: Support delay for setting up individual GPIOs
  gpio: aggregator: Remove CONFIG_OF and of_match_ptr() protections
  dt-bindings: gpio: pca9570: add gpio-line-names property
  gpiolib: remove unused gpio_cansleep()
  gpio: tps65219: add GPIO support for TPS65219 PMIC
  gpio: zynq: fix zynqmp_gpio not an immutable chip warning
  gpio: davinci: make davinci_gpio_dev_pm_ops static
  ...
parents ff7ddcf0 0ff9f5e5
Loading
Loading
Loading
Loading
+2 −16
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,bcm6345-gpio.yaml#
$id: http://devicetree.org/schemas/gpio/brcm,bcm63xx-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Broadcom BCM6345 GPIO controller
title: Broadcom BCM63xx GPIO controller

maintainers:
  - Álvaro Fernández Rojas <noltari@gmail.com>
@@ -18,8 +18,6 @@ description: |+

  BCM6338 have 8-bit data and dirout registers, where GPIO state can be read
  and/or written, and the direction changed from input to output.
  BCM6345 have 16-bit data and dirout registers, where GPIO state can be read
  and/or written, and the direction changed from input to output.
  BCM6318, BCM6328, BCM6358, BCM6362, BCM6368 and BCM63268 have 32-bit data
  and dirout registers, where GPIO state can be read and/or written, and the
  direction changed from input to output.
@@ -29,7 +27,6 @@ properties:
    enum:
      - brcm,bcm6318-gpio
      - brcm,bcm6328-gpio
      - brcm,bcm6345-gpio
      - brcm,bcm6358-gpio
      - brcm,bcm6362-gpio
      - brcm,bcm6368-gpio
@@ -63,17 +60,6 @@ required:
additionalProperties: false

examples:
  - |
    gpio@fffe0406 {
      compatible = "brcm,bcm6345-gpio";
      reg-names = "dirout", "dat";
      reg = <0xfffe0406 2>, <0xfffe040a 2>;
      native-endian;

      gpio-controller;
      #gpio-cells = <2>;
    };

  - |
    gpio@0 {
      compatible = "brcm,bcm63268-gpio";
+79 −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-delay.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO delay controller

maintainers:
  - Alexander Stein <linux@ew.tq-group.com>

description: |
  This binding describes an electrical setup where setting an GPIO output
  is delayed by some external setup, e.g. RC circuit.

  +----------+                    +-----------+
  |          |             VCC_B  |           |
  |          |              |     |           |
  |          | VCC_A        _     |           |
  |  GPIO    |             | | R  |  Consumer |
  |controller|        ___  |_|    |           |
  |          |       |   |  |     |           |
  |      [IOx|-------|   |--+-----|-----+     |
  |          |       |___|  |     |   input   |
  |          |              |     |           |
  +----------+             --- C  +-----------+
                           ---
                            |
                            -
                           GND

  If the input on the consumer is controlled by an open-drain signal
  attached to an RC circuit the ramp-up delay is not under control
  of the GPIO controller.

properties:
  compatible:
    const: gpio-delay

  "#gpio-cells":
    description: |
      Specifies the pin, ramp-up and ramp-down delays. The
      delays are specified in microseconds.
    const: 3

  gpios:
    description: Array of GPIOs which output signal change is delayed
    minItems: 1
    maxItems: 32

  gpio-controller: true

  gpio-line-names:
    minItems: 1
    maxItems: 32

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

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>

    enable_delay: enable-delay {
        compatible = "gpio-delay";
        #gpio-cells = <3>;
        gpio-controller;
        gpios = <&gpio0 3 GPIO_ACTIVE_LOW>,
                <&gpio3 1 GPIO_ACTIVE_HIGH>;
    };

    consumer {
        enable-gpios = <&enable_delay 0 130000 30000>;
    };
+154 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/gpio-ep9301.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: EP93xx GPIO controller

maintainers:
  - Linus Walleij <linus.walleij@linaro.org>
  - Bartosz Golaszewski <brgl@bgdev.pl>
  - Nikita Shubin <nikita.shubin@maquefel.me>

properties:
  compatible:
    oneOf:
      - const: cirrus,ep9301-gpio
      - items:
          - enum:
              - cirrus,ep9302-gpio
              - cirrus,ep9307-gpio
              - cirrus,ep9312-gpio
              - cirrus,ep9315-gpio
          - const: cirrus,ep9301-gpio

  reg:
    minItems: 2
    items:
      - description: data register
      - description: direction register
      - description: interrupt registers base

  reg-names:
    minItems: 2
    items:
      - const: data
      - const: dir
      - const: intr

  gpio-controller: true

  gpio-ranges: true

  "#gpio-cells":
    const: 2

  interrupt-controller: true

  "#interrupt-cells":
    const: 2

  interrupts:
    oneOf:
      - maxItems: 1
      - description: port F has dedicated irq line for each gpio line
        maxItems: 8

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

additionalProperties: false

examples:
  - |
    gpio@80840000 {
      compatible = "cirrus,ep9301-gpio";
      reg = <0x80840000 0x04>,
            <0x80840010 0x04>,
            <0x80840090 0x1c>;
      reg-names = "data", "dir", "intr";
      gpio-controller;
      #gpio-cells = <2>;
        interrupt-controller;
        interrupt-parent = <&vic1>;
        interrupts = <27>;
    };

    gpio@80840004 {
      compatible = "cirrus,ep9301-gpio";
      reg = <0x80840004 0x04>,
            <0x80840014 0x04>,
            <0x808400ac 0x1c>;
      reg-names = "data", "dir", "intr";
      gpio-controller;
      #gpio-cells = <2>;
      interrupt-controller;
      interrupt-parent = <&vic1>;
      interrupts = <27>;
    };

    gpio@80840008 {
      compatible = "cirrus,ep9301-gpio";
      reg = <0x80840008 0x04>,
            <0x80840018 0x04>;
      reg-names = "data", "dir";
      gpio-controller;
      #gpio-cells = <2>;
    };

    gpio@8084000c {
      compatible = "cirrus,ep9301-gpio";
      reg = <0x8084000c 0x04>,
            <0x8084001c 0x04>;
      reg-names = "data", "dir";
      gpio-controller;
      #gpio-cells = <2>;
    };

    gpio@80840020 {
      compatible = "cirrus,ep9301-gpio";
      reg = <0x80840020 0x04>,
            <0x80840024 0x04>;
      reg-names = "data", "dir";
      gpio-controller;
      #gpio-cells = <2>;
    };

    gpio@80840030 {
      compatible = "cirrus,ep9301-gpio";
      reg = <0x80840030 0x04>,
            <0x80840034 0x04>,
            <0x8084004c 0x1c>;
      reg-names = "data", "dir", "intr";
      gpio-controller;
      #gpio-cells = <2>;
      interrupt-controller;
      interrupts-extended = <&vic0 19>, <&vic0 20>,
                            <&vic0 21>, <&vic0 22>,
                            <&vic1 15>, <&vic1 16>,
                            <&vic1 17>, <&vic1 18>;
    };

    gpio@80840038 {
      compatible = "cirrus,ep9301-gpio";
      reg = <0x80840038 0x04>,
            <0x8084003c 0x04>;
      reg-names = "data", "dir";
      gpio-controller;
      #gpio-cells = <2>;
    };

    gpio@80840040 {
      compatible = "cirrus,ep9301-gpio";
      reg = <0x80840040 0x04>,
            <0x80840044 0x04>;
      reg-names = "data", "dir";
      gpio-controller;
      #gpio-cells = <2>;
    };

...
+117 −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-mmio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Generic MMIO GPIO

maintainers:
  - Linus Walleij <linus.walleij@linaro.org>
  - Bartosz Golaszewski <brgl@bgdev.pl>

description:
  Some simple GPIO controllers may consist of a single data register or a pair
  of set/clear-bit registers. Such controllers are common for glue logic in
  FPGAs or ASICs. Commonly, these controllers are accessed over memory-mapped
  NAND-style parallel busses.

properties:
  compatible:
    enum:
      - brcm,bcm6345-gpio
      - ni,169445-nand-gpio
      - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller

  big-endian: true

  '#gpio-cells':
    const: 2

  gpio-controller: true

  little-endian: true

  reg:
    minItems: 1
    description:
      A list of registers in the controller. The width of each register is
      determined by its size. All registers must have the same width. The number
      of GPIOs is set by the width, with bit 0 corresponding to GPIO 0.
    items:
      - description:
          Register to READ the value of the GPIO lines. If GPIO line is high,
          the bit will be set. If the GPIO line is low, the bit will be cleared.
          This register may also be used to drive GPIOs if the SET register is
          omitted.
      - description:
          Register to SET the value of the GPIO lines. Setting a bit in this
          register will drive the GPIO line high.
      - description:
          Register to CLEAR the value of the GPIO lines. Setting a bit in this
          register will drive the GPIO line low. If this register is omitted,
          the SET register will be used to clear the GPIO lines as well, by
          actively writing the line with 0.
      - description:
          Register to set the line as OUTPUT. Setting a bit in this register
          will turn that line into an output line. Conversely, clearing a bit
          will turn that line into an input.
      - description:
          Register to set this line as INPUT. Setting a bit in this register
          will turn that line into an input line. Conversely, clearing a bit
          will turn that line into an output.

  reg-names:
    minItems: 1
    maxItems: 5
    items:
      enum:
        - dat
        - set
        - clr
        - dirout
        - dirin

  native-endian: true

  no-output:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      If this property is present, the controller cannot drive the GPIO lines.

required:
  - compatible
  - reg
  - reg-names
  - '#gpio-cells'
  - gpio-controller

additionalProperties: false

examples:
  - |
    gpio@1f300010 {
      compatible = "ni,169445-nand-gpio";
      reg = <0x1f300010 0x4>;
      reg-names = "dat";
      gpio-controller;
      #gpio-cells = <2>;
    };

    gpio@e0100000 {
      compatible = "wd,mbl-gpio";
      reg-names = "dat";
      reg = <0xe0100000 0x1>;
      #gpio-cells = <2>;
      gpio-controller;
      no-output;
    };

    gpio@fffe0406 {
      compatible = "brcm,bcm6345-gpio";
      reg-names = "dirout", "dat";
      reg = <0xfffe0406 2>, <0xfffe040a 2>;
      native-endian;
      gpio-controller;
      #gpio-cells = <2>;
    };
+4 −0
Original line number Diff line number Diff line
@@ -24,6 +24,10 @@ properties:
  '#gpio-cells':
    const: 2

  gpio-line-names:
    minItems: 4
    maxItems: 8

required:
  - compatible
  - reg
Loading