Commit 77e1ea9e authored by Frank Li's avatar Frank Li Committed by Bartosz Golaszewski
Browse files

dt-bindings: gpio: mpc8xxx: Convert to yaml format



Convert binding doc from txt to yaml.

Remove redundated "gpio1: gpio@2300000" example.
Add gpio-controller at example "gpio@1100".

Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: default avatarFrank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20240531164357.1419858-1-Frank.Li@nxp.com


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 8fce7727
Loading
Loading
Loading
Loading
+82 −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/fsl,qoriq-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Freescale MPC512x/MPC8xxx/QorIQ/Layerscape GPIO controller

maintainers:
  - Frank Li <Frank.Li@nxp.com>

properties:
  compatible:
    oneOf:
      - enum:
          - fsl,mpc5121-gpio
          - fsl,mpc5125-gpio
          - fsl,mpc8349-gpio
          - fsl,mpc8572-gpio
          - fsl,mpc8610-gpio
          - fsl,pq3-gpio
      - items:
          - enum:
              - fsl,ls1021a-gpio
              - fsl,ls1028a-gpio
              - fsl,ls1043a-gpio
              - fsl,ls1088a-gpio
              - fsl,ls2080a-gpio
          - const: fsl,qoriq-gpio

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  "#gpio-cells":
    const: 2

  gpio-controller: true

  interrupt-controller: true

  "#interrupt-cells":
    const: 2

  little-endian:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      GPIO registers are used as little endian. If not
      present registers are used as big endian by default.

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

additionalProperties: false

examples:
  - |
    gpio@1100 {
        compatible = "fsl,mpc5125-gpio";
        reg = <0x1100 0x080>;
        interrupts = <78 0x8>;
        gpio-controller;
        #gpio-cells = <2>;
    };

  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    gpio@2300000 {
        compatible = "fsl,ls2080a-gpio", "fsl,qoriq-gpio";
        reg = <0x2300000 0x10000>;
        interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
        little-endian;
        gpio-controller;
        #gpio-cells = <2>;
        interrupt-controller;
        #interrupt-cells = <2>;
    };
+0 −53
Original line number Diff line number Diff line
* Freescale MPC512x/MPC8xxx/QorIQ/Layerscape GPIO controller

Required properties:
- compatible : Should be "fsl,<soc>-gpio"
  The following <soc>s are known to be supported:
	mpc5121, mpc5125, mpc8349, mpc8572, mpc8610, pq3, qoriq,
	ls1021a, ls1043a, ls2080a, ls1028a, ls1088a.
- reg : Address and length of the register set for the device
- interrupts : Should be the port interrupt shared by all 32 pins.
- #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

Optional properties:
- little-endian : GPIO registers are used as little endian. If not
                  present registers are used as big endian by default.

Example of gpio-controller node for a mpc5125 SoC:

gpio0: gpio@1100 {
	compatible = "fsl,mpc5125-gpio";
	#gpio-cells = <2>;
	reg = <0x1100 0x080>;
	interrupts = <78 0x8>;
};

Example of gpio-controller node for a ls2080a SoC:

gpio0: gpio@2300000 {
	compatible = "fsl,ls2080a-gpio", "fsl,qoriq-gpio";
	reg = <0x0 0x2300000 0x0 0x10000>;
	interrupts = <0 36 0x4>; /* Level high type */
	gpio-controller;
	little-endian;
	#gpio-cells = <2>;
	interrupt-controller;
	#interrupt-cells = <2>;
};


Example of gpio-controller node for a ls1028a/ls1088a SoC:

gpio1: gpio@2300000 {
	compatible = "fsl,ls1028a-gpio", "fsl,ls1088a-gpio", "fsl,qoriq-gpio";
	reg = <0x0 0x2300000 0x0 0x10000>;
	interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
	gpio-controller;
	#gpio-cells = <2>;
	interrupt-controller;
	#interrupt-cells = <2>;
	little-endian;
};