public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Hugo Villeneuve <hugo@hugovil.com>
Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, hvilleneuve@dimonoff.com,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 4/4] dt-bindings: sc16is7xx: convert to YAML
Date: Thu, 21 Sep 2023 14:45:06 +0100	[thread overview]
Message-ID: <20230921-decorated-patronize-45285045adbf@spud> (raw)
In-Reply-To: <20230920152015.1376838-5-hugo@hugovil.com>

[-- Attachment #1: Type: text/plain, Size: 4855 bytes --]

Hey,

On Wed, Sep 20, 2023 at 11:20:15AM -0400, Hugo Villeneuve wrote:
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> 
> Convert binding from text format to YAML.
> 
> Additions to original text binding:
>   - add rs485 reference.
> 
> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> ---
>  .../bindings/serial/nxp,sc16is7xx.txt         | 118 ----------------
>  .../bindings/serial/nxp,sc16is7xx.yaml        | 126 ++++++++++++++++++
>  2 files changed, 126 insertions(+), 118 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt
>  create mode 100644 Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml

> diff --git a/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml
> new file mode 100644
> index 000000000000..508639e09e06
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml
> @@ -0,0 +1,126 @@
> +# 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)

nit, but my OCD was triggered - capitalise the a in "advanced"?

> +
> +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
> +    description: Reference to the IC source clock.

You could probably drop this, if it only has one clock it's a bit
redundant.

> +  clock-frequency:
> +    description: |

This | should not be needed here, there's no formatting to preserve.

> +      When there is no clock provider visible to the platform, this
> +      is the source crystal or external clock frequency for the IC in Hz.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 1
> +    maximum: 80000000
> +
> +  gpio-controller:
> +    description: Marks the device node as a GPIO controller.
> +    type: boolean
> +
> +  "#gpio-cells":
> +    const: 2
> +
> +  gpio-line-names:
> +    minItems: 1
> +    maxItems: 8
> +
> +  nxp,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>
> +    serial0: serial@51 {

These labels are not used and should be removed.

Otherwise, conversion looks aight to me.

Thanks,
Conor.

> +        compatible = "nxp,sc16is750";
> +        reg = <0x51>;
> +        clocks = <&clk20m>;
> +        interrupt-parent = <&gpio3>;
> +        interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
> +        gpio-controller;
> +        #gpio-cells = <2>;
> +    };
> +
> +    serial1: 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>;
> +    };
> +
> +    serial2: 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 */
> +    };
> -- 
> 2.30.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2023-09-21 13:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 15:20 [PATCH 0/4] serial: sc16is7xx: device tree improvements Hugo Villeneuve
2023-09-20 15:20 ` [PATCH 1/4] serial: sc16is7xx: use device_property APIs when configuring irda mode Hugo Villeneuve
2023-09-20 15:20 ` [PATCH 2/4] serial: sc16is7xx: recognize "nxp,irda-mode-ports" DT property Hugo Villeneuve
2023-09-20 15:20 ` [PATCH 3/4] dt-bindings: sc16is7xx: add vendor prefix to irda-mode-ports property Hugo Villeneuve
2023-09-21 10:29   ` m.brock
2023-09-21 13:37     ` Hugo Villeneuve
2023-09-21 13:47   ` Conor Dooley
2023-09-21 16:24   ` Rob Herring
2023-09-21 16:32     ` Hugo Villeneuve
2023-09-22 19:52       ` Rob Herring
2023-09-27 14:28         ` Hugo Villeneuve
2023-09-20 15:20 ` [PATCH 4/4] dt-bindings: sc16is7xx: convert to YAML Hugo Villeneuve
2023-09-20 23:13   ` Rob Herring
2023-09-21 16:22     ` Hugo Villeneuve
2023-09-21 13:45   ` Conor Dooley [this message]
2023-09-21 15:30     ` Hugo Villeneuve
2023-09-22 11:35       ` Conor Dooley
2023-09-22 13:08         ` Hugo Villeneuve
2023-09-21 15:33   ` Rob Herring
2023-09-21 16:27     ` Hugo Villeneuve

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230921-decorated-patronize-45285045adbf@spud \
    --to=conor@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hugo@hugovil.com \
    --cc=hvilleneuve@dimonoff.com \
    --cc=jirislaby@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox