diff mbox series

[V5,1/5] dt-bindings: pwm: Add i.MX TPM PWM binding

Message ID 1552894581-3391-2-git-send-email-Anson.Huang@nxp.com (mailing list archive)
State New, archived
Headers show
Series Add i.MX7ULP EVK PWM backlight support | expand

Commit Message

Anson Huang March 18, 2019, 7:41 a.m. UTC
Add i.MX TPM(Low Power Timer/Pulse Width Modulation Module) PWM binding.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
No changes.
---
 Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt

Comments

Stefan Agner March 18, 2019, 8:18 a.m. UTC | #1
On 18.03.2019 08:41, Anson Huang wrote:
> Add i.MX TPM(Low Power Timer/Pulse Width Modulation Module) PWM binding.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> No changes.
> ---
>  Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> 
> diff --git a/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> b/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> new file mode 100644
> index 0000000..d47b8fb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> @@ -0,0 +1,19 @@
> +Freescale i.MX TPM PWM controller
> +
> +Required properties:
> +- compatible : Should be "fsl,imx-tpm-pwm".
> +- reg: Physical base address and length of the controller's registers.
> +- #pwm-cells: Should be 2. See pwm.txt in this directory for a
> description of the cells format.

It seems that the driver supports polarity. Can we use 3 cells so we can
specify the polarity in the device tree?

Also use 3 cells in the base device tree to enable other boards making
use of the polarity (arch/arm/boot/dts/imx7ulp.dtsi).

--
Stefan

> +- clocks : The clock provided by the SoC to drive the PWM.
> +- interrupts: The interrupt for the pwm controller.
> +
> +Example:
> +
> +pwm0: tpm@40250000 {
> +	compatible = "fsl,imx-tpm-pwm";
> +	reg = <0x40250000 0x1000>;
> +	assigned-clocks = <&clks IMX7ULP_CLK_LPTPM4>;
> +	assigned-clock-parents = <&clks IMX7ULP_CLK_SOSC_BUS_CLK>;
> +	clocks = <&clks IMX7ULP_CLK_LPTPM4>;
> +	#pwm-cells = <2>;
> +};
Anson Huang March 18, 2019, 9:50 a.m. UTC | #2
Hi, Stefan

Best Regards!
Anson Huang

> -----Original Message-----
> From: Stefan Agner [mailto:stefan@agner.ch]
> Sent: 2019年3月18日 16:19
> To: Anson Huang <anson.huang@nxp.com>
> Cc: thierry.reding@gmail.com; robh+dt@kernel.org; mark.rutland@arm.com;
> shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; linux@armlinux.org.uk; otavio@ossystems.com.br;
> Leonard Crestez <leonard.crestez@nxp.com>; Robin Gong
> <yibin.gong@nxp.com>; jan.tuerk@emtrion.com; linux-
> pwm@vger.kernel.org; devicetree@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org; u.kleine-
> koenig@pengutronix.de; dl-linux-imx <linux-imx@nxp.com>
> Subject: Re: [PATCH V5 1/5] dt-bindings: pwm: Add i.MX TPM PWM binding
> 
> On 18.03.2019 08:41, Anson Huang wrote:
> > Add i.MX TPM(Low Power Timer/Pulse Width Modulation Module) PWM
> binding.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> > No changes.
> > ---
> >  Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt | 19
> > +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> >
> > diff --git a/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> > b/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> > new file mode 100644
> > index 0000000..d47b8fb
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> > @@ -0,0 +1,19 @@
> > +Freescale i.MX TPM PWM controller
> > +
> > +Required properties:
> > +- compatible : Should be "fsl,imx-tpm-pwm".
> > +- reg: Physical base address and length of the controller's registers.
> > +- #pwm-cells: Should be 2. See pwm.txt in this directory for a
> > description of the cells format.
> 
> It seems that the driver supports polarity. Can we use 3 cells so we can
> specify the polarity in the device tree?
> 
> Also use 3 cells in the base device tree to enable other boards making use of
> the polarity (arch/arm/boot/dts/imx7ulp.dtsi).

It makes sense, I will change it to 3 cells and specify the polarity in backlight node.

Anson.

> 
> --
> Stefan
> 
> > +- clocks : The clock provided by the SoC to drive the PWM.
> > +- interrupts: The interrupt for the pwm controller.
> > +
> > +Example:
> > +
> > +pwm0: tpm@40250000 {
> > +	compatible = "fsl,imx-tpm-pwm";
> > +	reg = <0x40250000 0x1000>;
> > +	assigned-clocks = <&clks IMX7ULP_CLK_LPTPM4>;
> > +	assigned-clock-parents = <&clks IMX7ULP_CLK_SOSC_BUS_CLK>;
> > +	clocks = <&clks IMX7ULP_CLK_LPTPM4>;
> > +	#pwm-cells = <2>;
> > +};
Thierry Reding March 18, 2019, 9:58 a.m. UTC | #3
On Mon, Mar 18, 2019 at 07:41:32AM +0000, Anson Huang wrote:
> Add i.MX TPM(Low Power Timer/Pulse Width Modulation Module) PWM binding.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> No changes.
> ---
>  Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> 
> diff --git a/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt b/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> new file mode 100644
> index 0000000..d47b8fb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> @@ -0,0 +1,19 @@
> +Freescale i.MX TPM PWM controller
> +
> +Required properties:
> +- compatible : Should be "fsl,imx-tpm-pwm".

Should this perhaps only be "fsl,imx-tpm"? Sounds to me like this is a
hardware block called "TPM" that can be used as a PWM. The compatible
string should describe the hardware block, not the mode in which it is
used.

> +- reg: Physical base address and length of the controller's registers.
> +- #pwm-cells: Should be 2. See pwm.txt in this directory for a description of the cells format.
> +- clocks : The clock provided by the SoC to drive the PWM.
> +- interrupts: The interrupt for the pwm controller.

pwm -> PWM

Thierry
Anson Huang March 18, 2019, 10:09 a.m. UTC | #4
Hi, Thierry

Best Regards!
Anson Huang

> -----Original Message-----
> From: Thierry Reding [mailto:thierry.reding@gmail.com]
> Sent: 2019年3月18日 17:59
> To: Anson Huang <anson.huang@nxp.com>
> Cc: robh+dt@kernel.org; mark.rutland@arm.com; shawnguo@kernel.org;
> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> linux@armlinux.org.uk; otavio@ossystems.com.br; stefan@agner.ch;
> Leonard Crestez <leonard.crestez@nxp.com>; Robin Gong
> <yibin.gong@nxp.com>; jan.tuerk@emtrion.com; linux-
> pwm@vger.kernel.org; devicetree@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org; u.kleine-
> koenig@pengutronix.de; dl-linux-imx <linux-imx@nxp.com>
> Subject: Re: [PATCH V5 1/5] dt-bindings: pwm: Add i.MX TPM PWM binding
> 
> On Mon, Mar 18, 2019 at 07:41:32AM +0000, Anson Huang wrote:
> > Add i.MX TPM(Low Power Timer/Pulse Width Modulation Module) PWM
> binding.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> > No changes.
> > ---
> >  Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt | 19
> > +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> >
> > diff --git a/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> > b/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> > new file mode 100644
> > index 0000000..d47b8fb
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
> > @@ -0,0 +1,19 @@
> > +Freescale i.MX TPM PWM controller
> > +
> > +Required properties:
> > +- compatible : Should be "fsl,imx-tpm-pwm".
> 
> Should this perhaps only be "fsl,imx-tpm"? Sounds to me like this is a
> hardware block called "TPM" that can be used as a PWM. The compatible
> string should describe the hardware block, not the mode in which it is used.

OK, will fix it.

> 
> > +- reg: Physical base address and length of the controller's registers.
> > +- #pwm-cells: Should be 2. See pwm.txt in this directory for a description
> of the cells format.
> > +- clocks : The clock provided by the SoC to drive the PWM.
> > +- interrupts: The interrupt for the pwm controller.
> 
> pwm -> PWM

OK.
Thanks,
Anson

> 
> Thierry
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt b/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
new file mode 100644
index 0000000..d47b8fb
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/imx-tpm-pwm.txt
@@ -0,0 +1,19 @@ 
+Freescale i.MX TPM PWM controller
+
+Required properties:
+- compatible : Should be "fsl,imx-tpm-pwm".
+- reg: Physical base address and length of the controller's registers.
+- #pwm-cells: Should be 2. See pwm.txt in this directory for a description of the cells format.
+- clocks : The clock provided by the SoC to drive the PWM.
+- interrupts: The interrupt for the pwm controller.
+
+Example:
+
+pwm0: tpm@40250000 {
+	compatible = "fsl,imx-tpm-pwm";
+	reg = <0x40250000 0x1000>;
+	assigned-clocks = <&clks IMX7ULP_CLK_LPTPM4>;
+	assigned-clock-parents = <&clks IMX7ULP_CLK_SOSC_BUS_CLK>;
+	clocks = <&clks IMX7ULP_CLK_LPTPM4>;
+	#pwm-cells = <2>;
+};