linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Aswath Govindraju <a-govindraju@ti.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Mark Brown <broonie@kernel.org>,
	linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] dt-bindings: spi: omap-spi: Convert to json-schema
Date: Fri, 18 Jun 2021 14:45:05 -0600	[thread overview]
Message-ID: <20210618204505.GA2835349@robh.at.kernel.org> (raw)
In-Reply-To: <20210608052010.15656-1-a-govindraju@ti.com>

On Tue, Jun 08, 2021 at 10:50:09AM +0530, Aswath Govindraju wrote:
> Convert omap-spi dt-binding documentation from txt to yaml format.
> 
> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
> ---
> 
> changes since v1:
> - split the series according to their respective trees
> 
> link to v1:
> https://lore.kernel.org/patchwork/project/lkml/list/?series=502255
> 
>  .../devicetree/bindings/spi/omap-spi.txt      |  48 -------
>  .../devicetree/bindings/spi/omap-spi.yaml     | 126 ++++++++++++++++++
>  2 files changed, 126 insertions(+), 48 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/spi/omap-spi.txt
>  create mode 100644 Documentation/devicetree/bindings/spi/omap-spi.yaml
> 
> diff --git a/Documentation/devicetree/bindings/spi/omap-spi.txt b/Documentation/devicetree/bindings/spi/omap-spi.txt
> deleted file mode 100644
> index 487208c256c0..000000000000
> --- a/Documentation/devicetree/bindings/spi/omap-spi.txt
> +++ /dev/null
> @@ -1,48 +0,0 @@
> -OMAP2+ McSPI device
> -
> -Required properties:
> -- compatible :
> -  - "ti,am654-mcspi" for AM654.
> -  - "ti,omap2-mcspi" for OMAP2 & OMAP3.
> -  - "ti,omap4-mcspi" for OMAP4+.
> -- ti,spi-num-cs : Number of chipselect supported  by the instance.
> -- ti,hwmods: Name of the hwmod associated to the McSPI
> -- ti,pindir-d0-out-d1-in: Select the D0 pin as output and D1 as
> -			  input. The default is D0 as input and
> -			  D1 as output.
> -
> -Optional properties:
> -- dmas: List of DMA specifiers with the controller specific format
> -	as described in the generic DMA client binding. A tx and rx
> -	specifier is required for each chip select.
> -- dma-names: List of DMA request names. These strings correspond
> -	1:1 with the DMA specifiers listed in dmas. The string naming
> -	is to be "rxN" and "txN" for RX and TX requests,
> -	respectively, where N equals the chip select number.
> -
> -Examples:
> -
> -[hwmod populated DMA resources]
> -
> -mcspi1: mcspi@1 {
> -    #address-cells = <1>;
> -    #size-cells = <0>;
> -    compatible = "ti,omap4-mcspi";
> -    ti,hwmods = "mcspi1";
> -    ti,spi-num-cs = <4>;
> -};
> -
> -[generic DMA request binding]
> -
> -mcspi1: mcspi@1 {
> -    #address-cells = <1>;
> -    #size-cells = <0>;
> -    compatible = "ti,omap4-mcspi";
> -    ti,hwmods = "mcspi1";
> -    ti,spi-num-cs = <2>;
> -    dmas = <&edma 42
> -	    &edma 43
> -	    &edma 44
> -	    &edma 45>;
> -    dma-names = "tx0", "rx0", "tx1", "rx1";
> -};
> diff --git a/Documentation/devicetree/bindings/spi/omap-spi.yaml b/Documentation/devicetree/bindings/spi/omap-spi.yaml
> new file mode 100644
> index 000000000000..cd20704f2edc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/omap-spi.yaml
> @@ -0,0 +1,126 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/omap-spi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: SPI controller bindings for OMAP and K3 SoCs
> +
> +maintainers:
> +  - Mark Brown <broonie@kernel.org>

A TI person here please.

You need a ref to spi-controller.yaml

> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - enum:
> +              - ti,am654-mcspi
> +              - ti,am4372-mcspi
> +          - const: ti,omap4-mcspi
> +      - items:
> +          - enum:
> +              - ti,omap2-mcspi
> +              - ti,omap4-mcspi
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +

> +  '#address-cells':
> +    const: 1
> +
> +  '#size-cells':
> +    const: 0

Don't need these, covered by spi-controller.yaml.

> +
> +  power-domains:
> +    maxItems: 1
> +
> +  ti,spi-num-cs:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: Number of chipselect supported  by the instance.
> +    minimum: 1
> +    maximum: 4
> +
> +  ti,hwmods:
> +    $ref: /schemas/types.yaml#/definitions/string
> +    description:
> +      Must be "mcspi<n>", n being the instance number (1-based).
> +      This property is applicable only on legacy platforms mainly omap2/3
> +      and ti81xx and should not be used on other platforms.
> +    deprecated: true
> +
> +  ti,pindir-d0-out-d1-in:
> +    description:
> +      Select the D0 pin as output and D1 as input. The default is D0
> +      as input and D1 as output.
> +    type: boolean
> +
> +  dmas:
> +    description:
> +      List of DMA specifiers with the controller specific format as
> +      described in the generic DMA client binding. A tx and rx
> +      specifier is required for each chip select.
> +    minItems: 1
> +    maxItems: 8
> +
> +  dma-names:
> +    description:
> +      List of DMA request names. These strings correspond 1:1 with
> +      the DMA sepecifiers listed in dmas. The string names is to be
> +      "rxN" and "txN" for RX and TX requests, respectively. Where N
> +      is the chip select number.
> +    minItems: 1
> +    maxItems: 8
> +
> +patternProperties:
> +  "@[0-9a-f]+$":
> +    type: object
> +    description:
> +      Flash devices are defined as a sub-node of the spi controller

Covered by spi-controller.yaml.

> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +additionalProperties: false
> +
> +if:
> +  properties:
> +    compatible:
> +      oneOf:
> +        - const: ti,omap2-mcspi
> +        - const: ti,omap4-mcspi
> +
> +then:
> +  properties:
> +    ti,hwmods:
> +      items:
> +        - pattern: "^mcspi([1-9])$"
> +
> +else:
> +  properties:
> +    ti,hwmods: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    #include <dt-bindings/soc/ti,sci_pm_domain.h>
> +
> +    main_spi0: spi@2100000 {

Drop unused labels.

> +      compatible = "ti,am654-mcspi","ti,omap4-mcspi";
> +      reg = <0x2100000 0x400>;
> +      interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
> +      clocks = <&k3_clks 137 1>;
> +      power-domains = <&k3_pds 137 TI_SCI_PD_EXCLUSIVE>;
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +      dmas = <&main_udmap 0xc500>, <&main_udmap 0x4500>;
> +      dma-names = "tx0", "rx0";
> +    };
> -- 
> 2.17.1
> 
> 

  reply	other threads:[~2021-06-18 20:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08  5:20 [PATCH v2] dt-bindings: spi: omap-spi: Convert to json-schema Aswath Govindraju
2021-06-18 20:45 ` Rob Herring [this message]
2021-06-21  9:32   ` Aswath Govindraju

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=20210618204505.GA2835349@robh.at.kernel.org \
    --to=robh@kernel.org \
    --cc=a-govindraju@ti.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lokeshvutla@ti.com \
    --cc=vigneshr@ti.com \
    /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;
as well as URLs for NNTP newsgroup(s).