devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Raphael Gallais-Pou <rgallaispou@gmail.com>
Cc: "Thierry Reding" <thierry.reding@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Patrice Chotard" <patrice.chotard@foss.st.com>,
	linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dt-bindings: pwm: st: convert sti-pwm to DT schema
Date: Fri, 11 Aug 2023 13:29:38 -0600	[thread overview]
Message-ID: <20230811192938.GA3990758-robh@kernel.org> (raw)
In-Reply-To: <20230801220559.32530-1-rgallaispou@gmail.com>

On Wed, Aug 02, 2023 at 12:05:59AM +0200, Raphael Gallais-Pou wrote:
> Converts st,sti-pwm binding to DT schema format
> 
> Signed-off-by: Raphael Gallais-Pou <rgallaispou@gmail.com>
> ---
>  .../devicetree/bindings/pwm/pwm-st.txt        | 43 -----------
>  .../devicetree/bindings/pwm/st,sti-pwm.yaml   | 74 +++++++++++++++++++
>  2 files changed, 74 insertions(+), 43 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/pwm/pwm-st.txt
>  create mode 100644 Documentation/devicetree/bindings/pwm/st,sti-pwm.yaml
> 
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-st.txt b/Documentation/devicetree/bindings/pwm/pwm-st.txt
> deleted file mode 100644
> index 19fce774cafa..000000000000
> --- a/Documentation/devicetree/bindings/pwm/pwm-st.txt
> +++ /dev/null
> @@ -1,43 +0,0 @@
> -STMicroelectronics PWM driver bindings
> ---------------------------------------
> -
> -Required parameters:
> -- compatible :		"st,pwm"
> -- #pwm-cells : 		Number of cells used to specify a PWM. First cell
> -			specifies the per-chip index of the PWM to use and the
> -			second cell is the period in nanoseconds - fixed to 2
> -			for STiH41x.
> -- reg :			Physical base address and length of the controller's
> -			registers.
> -- pinctrl-names: 	Set to "default".
> -- pinctrl-0: 		List of phandles pointing to pin configuration nodes
> -			for PWM module.
> -			For Pinctrl properties, please refer to [1].
> -- clock-names: 		Valid entries are "pwm" and/or "capture".
> -- clocks: 		phandle of the clock used by the PWM module.
> -			For Clk properties, please refer to [2].
> -- interrupts:		IRQ for the Capture device
> -
> -Optional properties:
> -- st,pwm-num-chan:	Number of available PWM channels.  Default is 0.
> -- st,capture-num-chan:	Number of available Capture channels.  Default is 0.
> -
> -[1] Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
> -[2] Documentation/devicetree/bindings/clock/clock-bindings.txt
> -
> -Example:
> -
> -pwm1: pwm@fe510000 {
> -	compatible = "st,pwm";
> -	reg = <0xfe510000 0x68>;
> -	#pwm-cells = <2>;
> -	pinctrl-names = "default";
> -	pinctrl-0 = <&pinctrl_pwm1_chan0_default
> -		     &pinctrl_pwm1_chan1_default
> -		     &pinctrl_pwm1_chan2_default
> -		     &pinctrl_pwm1_chan3_default>;
> -	clocks = <&clk_sysin>;
> -	clock-names = "pwm";
> -	st,pwm-num-chan = <4>;
> -	st,capture-num-chan = <2>;
> -};
> diff --git a/Documentation/devicetree/bindings/pwm/st,sti-pwm.yaml b/Documentation/devicetree/bindings/pwm/st,sti-pwm.yaml
> new file mode 100644
> index 000000000000..8a7833e9c10c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pwm/st,sti-pwm.yaml
> @@ -0,0 +1,74 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pwm/st,sti-pwm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: STMicroelectronics STi PWM controller
> +
> +maintainers:
> +  - Patrice Chotard <patrice.chotard@foss.st.com>
> +
> +allOf:
> +  - $ref: pwm.yaml#
> +
> +properties:
> +  compatible:
> +    const: st,sti-pwm
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  pinctrl-names:
> +    const: default
> +
> +  pinctrl-0:
> +    description: Configuration for the default state.
> +
> +  clock-names:
> +    const: pwm
> +
> +  clocks:
> +    $ref: "/schemas/types.yaml#/definitions/phandle"

Drop quotes

> +
> +  st,pwm-num-chan:
> +    $ref: "/schemas/types.yaml#/definitions/uint32"
> +    description: Number of available PWM channels.

Constraints?

> +
> +  st,capture-num-chan:
> +    $ref: "/schemas/types.yaml#/definitions/uint32"
> +    description: Number of available Capture channels.

Constraints?

> +
> +  "#pwm-cells":
> +    const: 2
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clock-names
> +  - clocks
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    pwm1: pwm@9510000 {
> +        compatible = "st,sti-pwm";
> +        #pwm-cells = <2>;
> +        reg = <0x9510000 0x68>;
> +        interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
> +        pinctrl-names = "default";
> +        pinctrl-0 = <&pinctrl_pwm1_chan0_default
> +                 &pinctrl_pwm1_chan1_default
> +                 &pinctrl_pwm1_chan2_default
> +                 &pinctrl_pwm1_chan3_default>;
> +        clock-names = "pwm";
> +        clocks = <&clk_sysin>;
> +        st,pwm-num-chan = <4>;
> +    };
> +...
> -- 
> 2.41.0
> 

      parent reply	other threads:[~2023-08-11 19:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 22:05 [PATCH] dt-bindings: pwm: st: convert sti-pwm to DT schema Raphael Gallais-Pou
2023-08-02  8:02 ` Uwe Kleine-König
2023-08-03  7:18   ` Raphaël Gallais-Pou
2023-08-03  8:56     ` Uwe Kleine-König
2023-08-03 16:09       ` Conor Dooley
2023-08-03 17:19         ` Raphaël Gallais-Pou
2023-08-11 19:29 ` Rob Herring [this message]

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=20230811192938.GA3990758-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=rgallaispou@gmail.com \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).