From: vz@mleia.com (Vladimir Zapolskiy)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] arm: dts: lpc32xx: add device node for the second pwm controller
Date: Thu, 15 Oct 2015 13:25:02 +0300 [thread overview]
Message-ID: <561F7EFE.5070908@mleia.com> (raw)
In-Reply-To: <CAGhQ9Vx9ghfAD0=ntsFL50+iBQDag=HHGb6=X2-AfYPtSb_-yQ@mail.gmail.com>
Hi Joachim,
On 14.10.2015 21:04, Joachim Eastwood wrote:
> Hi Vladimir,
>
> On 13 October 2015 at 01:54, Vladimir Zapolskiy <vz@mleia.com> wrote:
>> LPC32xx SoCs have two independent PWM controllers, they have different
>> clock parents, clock gates and even slightly different controls,
>> each of these two PWM controllers has one output channel. Due to
>> almost similar controls arranged in a row it is incorrectly assumed
>> that there is one PWM controller with two channels, fix this problem
>> in lpc32xx.dtsi, which at the moment prevents separate configuration
>> of different clock parents and gates for both PWM controllers.
>>
>> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
>> ---
>> arch/arm/boot/dts/lpc32xx.dtsi | 10 ++++++++--
>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/lpc32xx.dtsi b/arch/arm/boot/dts/lpc32xx.dtsi
>> index 929458d..f4d2a0e 100644
>> --- a/arch/arm/boot/dts/lpc32xx.dtsi
>> +++ b/arch/arm/boot/dts/lpc32xx.dtsi
>> @@ -286,9 +286,15 @@
>> status = "disabled";
>> };
>>
>> - pwm: pwm at 4005C000 {
>> + pwm1: pwm at 4005C000 {
>> compatible = "nxp,lpc3220-pwm";
>> - reg = <0x4005C000 0x8>;
>> + reg = <0x4005C000 0x4>;
>> + status = "disabled";
>> + };
>> +
>> + pwm2: pwm at 4005C004 {
>> + compatible = "nxp,lpc3220-pwm";
>> + reg = <0x4005C004 0x4>;
>> status = "disabled";
>> };
>> };
>
> I am not really against your change, but...
>
> What's wrong with a binding like the one below?
> pwm: pwm at 0x4005c000 {
> compatible = "nxp,lpc3220-pwm";
> reg = <0x4005C000 0x8>;
> clocks =<&clk CLK_PWM1, &clk CLK_PWM2>;
> clock-names = "pwm1", "pwm2";
> #pwm-cells = <3>;
> };
>
> With two clocks and where the first pwm-cell would select either PWM1 or PWM2.
>
> Seems like the driver only handle one clock, but should be fairly easy to fix.
I thought about it and IMHO it is a more complicated change in DTS (and
no doubts in the driver), which hides the structure of hardware. There
is no one PWM with two channels.
There are two independent PWMs, even control registers are different,
PWM2 can be programmed to output the internal interrupt status, and it
means that possibly in future I may want to describe one of the PWMs
with a different "compatible" property.
> Note: with your DT change you would also need to change the driver
> since it currently sets npwm to 2.
>
It is done -- http://permalink.gmane.org/gmane.linux.pwm/2831
Thanks for review.
--
With best wishes,
Vladimir
prev parent reply other threads:[~2015-10-15 10:25 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-12 23:54 [PATCH 0/5] arm: dts: lpc32xx: fixes and updates to lpc32xx.dtsi Vladimir Zapolskiy
2015-10-12 23:54 ` [PATCH 1/5] arm: dts: lpc32xx: change include syntax to be C preprocessor friendly Vladimir Zapolskiy
2015-10-12 23:54 ` [PATCH 2/5] arm: dts: lpc32xx: fix improper usage of ranges property Vladimir Zapolskiy
2015-10-13 12:44 ` Arnd Bergmann
2015-10-13 15:51 ` Vladimir Zapolskiy
2015-10-13 19:36 ` Arnd Bergmann
2015-10-13 23:13 ` Vladimir Zapolskiy
2015-10-14 13:52 ` Arnd Bergmann
2015-10-14 14:07 ` Vladimir Zapolskiy
2015-10-14 14:13 ` Arnd Bergmann
2015-10-14 17:23 ` Joachim Eastwood
2015-10-14 20:07 ` Arnd Bergmann
2015-10-14 21:15 ` Joachim Eastwood
2015-10-12 23:54 ` [PATCH 3/5] arm: dts: lpc32xx: add labels to all defined peripheral nodes Vladimir Zapolskiy
2015-10-12 23:54 ` [PATCH 4/5] arm: dts: lpc32xx: remove unneeded cell settings from cpus Vladimir Zapolskiy
2015-10-13 8:18 ` Joachim Eastwood
2015-10-13 10:03 ` Vladimir Zapolskiy
2015-10-13 16:20 ` [PATCH v2 4/5] arm: dts: lpc32xx: add reg property to cpu device node Vladimir Zapolskiy
2015-10-12 23:54 ` [PATCH 5/5] arm: dts: lpc32xx: add device node for the second pwm controller Vladimir Zapolskiy
2015-10-14 18:04 ` Joachim Eastwood
2015-10-15 10:25 ` Vladimir Zapolskiy [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=561F7EFE.5070908@mleia.com \
--to=vz@mleia.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).