Commit 0d447e92 authored by Hugo Villeneuve's avatar Hugo Villeneuve Committed by Greg Kroah-Hartman
Browse files

dt-bindings: sc16is7xx: convert to YAML



Convert binding from text format to YAML.

Additions to original text binding:
  - add rs485 reference.

Signed-off-by: default avatarHugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230927160153.2717788-3-hugo@hugovil.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1a0a2a1e
Loading
Loading
Loading
Loading
+0 −118
Original line number Diff line number Diff line
* NXP SC16IS7xx advanced Universal Asynchronous Receiver-Transmitter (UART)
* i2c as bus

Required properties:
- compatible: Should be one of the following:
  - "nxp,sc16is740" for NXP SC16IS740,
  - "nxp,sc16is741" for NXP SC16IS741,
  - "nxp,sc16is750" for NXP SC16IS750,
  - "nxp,sc16is752" for NXP SC16IS752,
  - "nxp,sc16is760" for NXP SC16IS760,
  - "nxp,sc16is762" for NXP SC16IS762.
- reg: I2C address of the SC16IS7xx device.
- interrupts: Should contain the UART interrupt
- clocks: Reference to the IC source clock.
	OR (when there is no clock provider visible to the platform)
- clock-frequency: The source clock frequency for the IC.

Optional properties:
- gpio-controller: Marks the device node as a GPIO controller.
- #gpio-cells: Should be two. The first cell is the GPIO number and
  the second cell is used to specify the GPIO polarity:
    0 = active high,
    1 = active low.
- irda-mode-ports: An array that lists the indices of the port that
		   should operate in IrDA mode.
- nxp,modem-control-line-ports: An array that lists the indices of the port that
				should have shared GPIO lines configured as
				modem control lines.

Example:
        sc16is750: sc16is750@51 {
                compatible = "nxp,sc16is750";
                reg = <0x51>;
                clocks = <&clk20m>;
                interrupt-parent = <&gpio3>;
                interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
                gpio-controller;
                #gpio-cells = <2>;
        };

	sc16is752: sc16is752@53 {
		compatible = "nxp,sc16is752";
		reg = <0x53>;
		clocks = <&clk20m>;
		interrupt-parent = <&gpio3>;
		interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
		nxp,modem-control-line-ports = <1>; /* Port 1 as modem control lines */
		gpio-controller; /* Port 0 as GPIOs */
		#gpio-cells = <2>;
	};

	sc16is752: sc16is752@54 {
		compatible = "nxp,sc16is752";
		reg = <0x54>;
		clocks = <&clk20m>;
		interrupt-parent = <&gpio3>;
		interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
		nxp,modem-control-line-ports = <0 1>; /* Ports 0 and 1 as modem control lines */
	};

* spi as bus

Required properties:
- compatible: Should be one of the following:
  - "nxp,sc16is740" for NXP SC16IS740,
  - "nxp,sc16is741" for NXP SC16IS741,
  - "nxp,sc16is750" for NXP SC16IS750,
  - "nxp,sc16is752" for NXP SC16IS752,
  - "nxp,sc16is760" for NXP SC16IS760,
  - "nxp,sc16is762" for NXP SC16IS762.
- reg: SPI chip select number.
- interrupts: Specifies the interrupt source of the parent interrupt
  controller. The format of the interrupt specifier depends on the
  parent interrupt controller.
- clocks: phandle to the IC source clock.

Optional properties:
- gpio-controller: Marks the device node as a GPIO controller.
- #gpio-cells: Should be two. The first cell is the GPIO number and
  the second cell is used to specify the GPIO polarity:
    0 = active high,
    1 = active low.
- irda-mode-ports: An array that lists the indices of the port that
		   should operate in IrDA mode.
- nxp,modem-control-line-ports: An array that lists the indices of the port that
				should have shared GPIO lines configured as
				modem control lines.

Example:
	sc16is750: sc16is750@0 {
		compatible = "nxp,sc16is750";
		reg = <0>;
		clocks = <&clk20m>;
		interrupt-parent = <&gpio3>;
		interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
		gpio-controller;
		#gpio-cells = <2>;
	};

	sc16is752: sc16is752@1 {
		compatible = "nxp,sc16is752";
		reg = <1>;
		clocks = <&clk20m>;
		interrupt-parent = <&gpio3>;
		interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
		nxp,modem-control-line-ports = <1>; /* Port 1 as modem control lines */
		gpio-controller; /* Port 0 as GPIOs */
		#gpio-cells = <2>;
	};

	sc16is752: sc16is752@2 {
		compatible = "nxp,sc16is752";
		reg = <2>;
		clocks = <&clk20m>;
		interrupt-parent = <&gpio3>;
		interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
		nxp,modem-control-line-ports = <0 1>; /* Ports 0 and 1 as modem control lines */
	};
+127 −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/serial/nxp,sc16is7xx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NXP SC16IS7xx Advanced Universal Asynchronous Receiver-Transmitter (UART)

maintainers:
  - Hugo Villeneuve <hvilleneuve@dimonoff.com>

properties:
  compatible:
    enum:
      - nxp,sc16is740
      - nxp,sc16is741
      - nxp,sc16is750
      - nxp,sc16is752
      - nxp,sc16is760
      - nxp,sc16is762

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-frequency:
    description:
      When there is no clock provider visible to the platform, this
      is the source crystal or external clock frequency for the IC in Hz.
    minimum: 1
    maximum: 80000000

  gpio-controller: true

  "#gpio-cells":
    const: 2

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

  irda-mode-ports:
    description: |
      An array that lists the indices of the port that should operate in IrDA
      mode:
      0: port A
      1: port B
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 2
    items:
      minimum: 0
      maximum: 1

  nxp,modem-control-line-ports:
    description: |
      An array that lists the indices of the port that should have shared GPIO
      lines configured as modem control lines:
      0: port A
      1: port B
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 2
    items:
      minimum: 0
      maximum: 1

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - $ref: /schemas/serial/serial.yaml#
  - $ref: /schemas/serial/rs485.yaml#

required:
  - compatible
  - reg
  - interrupts

oneOf:
  - required:
      - clocks
  - required:
      - clock-frequency

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        serial@51 {
            compatible = "nxp,sc16is750";
            reg = <0x51>;
            clocks = <&clk20m>;
            interrupt-parent = <&gpio3>;
            interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
            gpio-controller;
            #gpio-cells = <2>;
        };

        serial@53 {
            compatible = "nxp,sc16is752";
            reg = <0x53>;
            clocks = <&clk20m>;
            interrupt-parent = <&gpio3>;
            interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
            nxp,modem-control-line-ports = <1>; /* Port 1 as modem control lines */
            gpio-controller; /* Port 0 as GPIOs */
            #gpio-cells = <2>;
        };

        serial@54 {
            compatible = "nxp,sc16is752";
            reg = <0x54>;
            clocks = <&clk20m>;
            interrupt-parent = <&gpio3>;
            interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
            nxp,modem-control-line-ports = <0 1>; /* Ports 0 and 1 as modem control lines */
        };
    };