Commit f03a7f20 authored by Rob Herring (Arm)'s avatar Rob Herring (Arm) Committed by Bartosz Golaszewski
Browse files

dt-bindings: gpio: Create a trivial GPIO schema



Many simple GPIO controllers without interrupt capability have the same
schema other than their compatible value. Combine all these bindings
into a single schema. The criteria to be included here is must use 2
cells, have no interrupt capability, have 0 or 1 "reg" entries, and
have no other resources (like clocks).

Note that "ngpios" is now allowed in some cases it wasn't before and
constraints on it have been dropped.

Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250714201959.2983482-1-robh@kernel.org


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent aa66eb12
Loading
Loading
Loading
Loading
+0 −59
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/fcs,fxl6408.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Fairchild FXL6408 I2C GPIO Expander

maintainers:
  - Emanuele Ghidoli <emanuele.ghidoli@toradex.com>

properties:
  compatible:
    enum:
      - fcs,fxl6408

  reg:
    maxItems: 1

  "#gpio-cells":
    const: 2

  gpio-controller: true

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

patternProperties:
  "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
    type: object
    required:
      - gpio-hog

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

additionalProperties: false

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

        gpio_expander_43: gpio-expander@43 {
            compatible = "fcs,fxl6408";
            reg = <0x43>;
            gpio-controller;
            #gpio-cells = <2>;
            gpio-line-names = "Wi-Fi_W_DISABLE", "Wi-Fi_WKUP_WLAN",
                              "PWR_EN_+V3.3_WiFi_N", "PCIe_REF_CLK_EN",
                              "USB_RESET_N", "USB_BYPASS_N", "Wi-Fi_PDn",
                              "Wi-Fi_WKUP_BT";
        };
    };
+0 −19
Original line number Diff line number Diff line
Gateworks PLD GPIO controller bindings

The GPIO controller should be a child node on an I2C bus.

Required properties:
- compatible: Should be "gateworks,pld-gpio"
- reg: I2C slave address
- gpio-controller: Marks the device node as a GPIO controller.
- #gpio-cells: Should be <2>. The first cell is the gpio number and
  the second cell is used to specify optional parameters.

Example:

pld@56 {
	compatible = "gateworks,pld-gpio";
	reg = <0x56>;
	gpio-controller;
	#gpio-cells = <2>;
};
+0 −28
Original line number Diff line number Diff line
Cirrus Logic CLPS711X GPIO controller

Required properties:
- compatible: Should be "cirrus,ep7209-gpio"
- reg: Physical base GPIO controller registers location and length.
  There should be two registers, first is DATA register, the second
  is DIRECTION.
- gpio-controller: Marks the device node as a gpio controller.
- #gpio-cells: Should be two. The first cell is the pin number and
  the second cell is used to specify the gpio polarity:
    0 = active high
    1 = active low

Note: Each GPIO port should have an alias correctly numbered in "aliases"
node.

Example:

aliases {
	gpio0 = &porta;
};

porta: gpio@80000000 {
	compatible = "cirrus,ep7312-gpio","cirrus,ep7209-gpio";
	reg = <0x80000000 0x1>, <0x80000040 0x1>;
	gpio-controller;
	#gpio-cells = <2>;
};
+0 −37
Original line number Diff line number Diff line
TI/National Semiconductor LP3943 GPIO controller

Required properties:
  - compatible: "ti,lp3943-gpio"
  - gpio-controller: Marks the device node as a GPIO controller.
  - #gpio-cells: Should be 2. See gpio.txt in this directory for a
                 description of the cells format.

Example:
Simple LED controls with LP3943 GPIO controller

&i2c4 {
	lp3943@60 {
		compatible = "ti,lp3943";
		reg = <0x60>;

		gpioex: gpio {
			compatible = "ti,lp3943-gpio";
			gpio-controller;
			#gpio-cells = <2>;
		};
	};
};

leds {
	compatible = "gpio-leds";
	indicator1 {
		label = "indi1";
		gpios = <&gpioex 9 GPIO_ACTIVE_LOW>;
	};

	indicator2 {
		label = "indi2";
		gpios = <&gpioex 10 GPIO_ACTIVE_LOW>;
		default-state = "off";
	};
};
+0 −25
Original line number Diff line number Diff line
GPIO driver for MAX77620 Power management IC from Maxim Semiconductor.

Device has 8 GPIO pins which can be configured as GPIO as well as the
special IO functions.

Required properties:
-------------------
- gpio-controller : 	Marks the device node as a gpio controller.
- #gpio-cells : 	Should be two.  The first cell is the pin number and
			the second cell is used to specify the gpio polarity:
				0 = active high
				1 = active low
For more details, please refer generic GPIO DT binding document
<devicetree/bindings/gpio/gpio.txt>.

Example:
--------
#include <dt-bindings/mfd/max77620.h>
...
max77620@3c {
	compatible = "maxim,max77620";

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