All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: "Lothar Waßmann" <LW@karo-electronics.de>,
	"Shawn Guo" <shawn.guo@linaro.org>,
	"Sascha Hauer" <kernel@pengutronix.de>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Kumar Gala" <galak@codeaurora.org>,
	"Russell King" <linux@arm.linux.org.uk>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH 2/2] pwm: imx: support polarity inversion
Date: Mon, 13 Jan 2014 12:13:58 +0100	[thread overview]
Message-ID: <11504930.fjG2AZiQ4e@wuerfel> (raw)
In-Reply-To: <1389608988-10981-3-git-send-email-LW@KARO-electronics.de>

On Monday 13 January 2014 11:29:48 Lothar Waßmann wrote:

> diff --git a/arch/arm/boot/dts/imx50.dtsi b/arch/arm/boot/dts/imx50.dtsi
> index 01c0499..e3647a8 100644
> --- a/arch/arm/boot/dts/imx50.dtsi
> +++ b/arch/arm/boot/dts/imx50.dtsi
> @@ -273,7 +273,7 @@
>  			};
>  
>  			pwm1: pwm@53fb4000 {
> -				#pwm-cells = <2>;
> +				#pwm-cells = <3>;
>  				compatible = "fsl,imx50-pwm", "fsl,imx27-pwm";
>  				reg = <0x53fb4000 0x4000>;
>  				clocks = <&clks IMX5_CLK_PWM1_IPG_GATE>,
...
> @@ -271,6 +293,13 @@ static int imx_pwm_probe(struct platform_device *pdev)
>  		return PTR_ERR(imx->mmio_base);
>  
>  	data = of_id->data;
> +	if (data->output_polarity) {
> +		dev_info(&pdev->dev, "PWM supports inversion\n");
> +		imx_pwm_ops.set_polarity = imx_pwm_set_polarity;
> +		imx->chip.of_xlate = of_pwm_xlate_with_flags;
> +		imx->chip.of_pwm_n_cells = 3;
> +	}
> +
>  	imx->config = data->config;
>  	imx->set_enable = data->set_enable;

This looks like you are breaking compatibility with the binding,
which requires #pwm-cells to be <2>. You can extend the binding
to allow both <2> and <3>, but then you have to not only document
that change in the binding, but also ensure that the pwm driver
is able to use either variant.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] pwm: imx: support polarity inversion
Date: Mon, 13 Jan 2014 12:13:58 +0100	[thread overview]
Message-ID: <11504930.fjG2AZiQ4e@wuerfel> (raw)
In-Reply-To: <1389608988-10981-3-git-send-email-LW@KARO-electronics.de>

On Monday 13 January 2014 11:29:48 Lothar Wa?mann wrote:

> diff --git a/arch/arm/boot/dts/imx50.dtsi b/arch/arm/boot/dts/imx50.dtsi
> index 01c0499..e3647a8 100644
> --- a/arch/arm/boot/dts/imx50.dtsi
> +++ b/arch/arm/boot/dts/imx50.dtsi
> @@ -273,7 +273,7 @@
>  			};
>  
>  			pwm1: pwm at 53fb4000 {
> -				#pwm-cells = <2>;
> +				#pwm-cells = <3>;
>  				compatible = "fsl,imx50-pwm", "fsl,imx27-pwm";
>  				reg = <0x53fb4000 0x4000>;
>  				clocks = <&clks IMX5_CLK_PWM1_IPG_GATE>,
...
> @@ -271,6 +293,13 @@ static int imx_pwm_probe(struct platform_device *pdev)
>  		return PTR_ERR(imx->mmio_base);
>  
>  	data = of_id->data;
> +	if (data->output_polarity) {
> +		dev_info(&pdev->dev, "PWM supports inversion\n");
> +		imx_pwm_ops.set_polarity = imx_pwm_set_polarity;
> +		imx->chip.of_xlate = of_pwm_xlate_with_flags;
> +		imx->chip.of_pwm_n_cells = 3;
> +	}
> +
>  	imx->config = data->config;
>  	imx->set_enable = data->set_enable;

This looks like you are breaking compatibility with the binding,
which requires #pwm-cells to be <2>. You can extend the binding
to allow both <2> and <3>, but then you have to not only document
that change in the binding, but also ensure that the pwm driver
is able to use either variant.

	Arnd

  reply	other threads:[~2014-01-13 11:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 10:29 (unknown), Lothar Waßmann
2014-01-13 10:29 ` No subject Lothar Waßmann
2014-01-13 10:29 ` [PATCH 1/2] pwm: imx: indentation cleanup Lothar Waßmann
2014-01-13 10:29   ` Lothar Waßmann
2014-01-13 10:29 ` [PATCH 2/2] pwm: imx: support polarity inversion Lothar Waßmann
2014-01-13 10:29   ` Lothar Waßmann
2014-01-13 11:13   ` Arnd Bergmann [this message]
2014-01-13 11:13     ` Arnd Bergmann
2014-01-13 12:26     ` Lothar Waßmann
2014-01-13 12:26       ` Lothar Waßmann

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=11504930.fjG2AZiQ4e@wuerfel \
    --to=arnd@arndb.de \
    --cc=LW@karo-electronics.de \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=thierry.reding@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.