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

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

Pull gpio updates from Bartosz Golaszewski:
 "Relatively few updates for this release cycle. We have a single new
  driver and some minor changes in drivers, more work on limiting the
  usage of of_node in drivers and DT updates:

   - new driver: gpio-en7523

   - dt-bindings: convertion of faraday,ftgpio010 to YAML, new
     compatible string in gpio-vf610 and a bugfix in an example

   - gpiolib core: several improvements and some code shrink

   - documentation: convert all public docs into kerneldoc format

   - set IRQ bus token in gpio-crystalcove (addresses a debugfs issue)

   - add a missing return value check for kstrdup() in gpio-merrifield

   - allow gpio-tps68470 to be built as module

   - more work on limiting usage of of_node in GPIO drivers

   - several sysfs interface improvements

   - use SDPX in gpio-ts4900"

* tag 'gpio-updates-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: ts4900: Use SPDX header
  gpiolib: Use list_first_entry()/list_last_entry()
  gpiolib: sysfs: Simplify edge handling in the code
  gpiolib: sysfs: Move kstrtox() calls outside of the mutex lock
  gpiolib: sysfs: Move sysfs_emit() calls outside of the mutex lock
  gpiolib: make struct comments into real kernel docs
  dt-bindings: gpio: convert faraday,ftgpio01 to yaml
  dt-bindings: gpio: gpio-vf610: Add imx93 compatible string
  gpiolib: Simplify error path in gpiod_get_index() when requesting GPIO
  gpiolib: Use short form of ternary operator in gpiod_get_index()
  gpiolib: Introduce for_each_gpio_desc_with_flag() macro
  gpio: Add support for Airoha EN7523 GPIO controller
  dt-bindings: arm: airoha: Add binding for Airoha GPIO controller
  dt-bindings: gpio: fix gpio-hog example
  gpio: tps68470: Allow building as module
  gpio: tegra: Get rid of duplicate of_node assignment
  gpio: altera-a10sr: Switch to use fwnode instead of of_node
  gpio: merrifield: check the return value of devm_kstrdup()
  gpio: crystalcove: Set IRQ domain bus token to DOMAIN_BUS_WIRED
parents 5e206459 87ba5bad
Loading
Loading
Loading
Loading
+66 −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/airoha,en7523-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Airoha EN7523 GPIO controller

maintainers:
  - John Crispin <john@phrozen.org>

description: |
  Airoha's GPIO controller on their ARM EN7523 SoCs consists of two banks of 32
  GPIOs.

properties:
  $nodename:
    pattern: "^gpio@[0-9a-f]+$"

  compatible:
    items:
      - const: airoha,en7523-gpio

  reg:
    description: |
      The first tuple points to the input register.
      The second and third tuple point to the direction registers
      The fourth tuple points to the output register
    maxItems: 4

  "#gpio-cells":
    const: 2

  gpio-controller: true

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

additionalProperties: false

examples:
  - |
    gpio0: gpio@1fbf0200 {
        compatible = "airoha,en7523-gpio";
        reg = <0x1fbf0204 0x4>,
              <0x1fbf0200 0x4>,
              <0x1fbf0220 0x4>,
              <0x1fbf0214 0x4>;
        gpio-controller;
        #gpio-cells = <2>;
    };

    gpio1: gpio@1fbf0270 {
        compatible = "airoha,en7523-gpio";
        reg = <0x1fbf0270 0x4>,
              <0x1fbf0260 0x4>,
              <0x1fbf0264 0x4>,
              <0x1fbf0278 0x4>;
        gpio-controller;
        #gpio-cells = <2>;
    };

...
+0 −27
Original line number Diff line number Diff line
Faraday Technology FTGPIO010 GPIO Controller

Required properties:

- compatible : Should be one of
  "cortina,gemini-gpio", "faraday,ftgpio010"
  "moxa,moxart-gpio", "faraday,ftgpio010"
  "faraday,ftgpio010"
- reg : Should contain registers location and length
- interrupts : Should contain the interrupt line for the GPIO block
- gpio-controller : marks this as a GPIO controller
- #gpio-cells : Should be 2, see gpio/gpio.txt
- interrupt-controller : marks this as an interrupt controller
- #interrupt-cells : a standard two-cell interrupt flag, see
  interrupt-controller/interrupts.txt

Example:

gpio@4d000000 {
	compatible = "cortina,gemini-gpio", "faraday,ftgpio010";
	reg = <0x4d000000 0x100>;
	interrupts = <22 IRQ_TYPE_LEVEL_HIGH>;
	gpio-controller;
	#gpio-cells = <2>;
	interrupt-controller;
	#interrupt-cells = <2>;
};
+65 −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/faraday,ftgpio010.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Faraday Technology FTGPIO010 GPIO Controller

maintainers:
  - Linus Walleij <linus.walleij@linaro.org>

properties:
  compatible:
    oneOf:
      - items:
          - const: cortina,gemini-gpio
          - const: faraday,ftgpio010
      - items:
          - const: moxa,moxart-gpio
          - const: faraday,ftgpio010
      - const: faraday,ftgpio010

  reg:
    maxItems: 1

  resets:
    maxItems: 1

  clocks:
    maxItems: 1

  interrupts:
    maxItems: 1
    description: Should contain the interrupt line for the GPIO block

  gpio-controller: true
  "#gpio-cells":
    const: 2

  interrupt-controller: true
  "#interrupt-cells":
    const: 2

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

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    gpio@4d000000 {
      compatible = "cortina,gemini-gpio", "faraday,ftgpio010";
      reg = <0x4d000000 0x100>;
      interrupts = <22 IRQ_TYPE_LEVEL_HIGH>;
      gpio-controller;
      #gpio-cells = <2>;
      interrupt-controller;
      #interrupt-cells = <2>;
    };
+3 −1
Original line number Diff line number Diff line
@@ -25,7 +25,9 @@ properties:
          - const: fsl,imx7ulp-gpio
          - const: fsl,vf610-gpio
      - items:
          - const: fsl,imx8ulp-gpio
          - enum:
              - fsl,imx93-gpio
              - fsl,imx8ulp-gpio
          - const: fsl,imx7ulp-gpio

  reg:
+1 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ Example of two SOC GPIO banks defined as gpio-controller nodes:
		gpio-controller;
		#gpio-cells = <2>;

		line_b {
		line_b-hog {
			gpio-hog;
			gpios = <6 0>;
			output-low;
Loading