[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210503062338.meohvoth7cyfppvu@pengutronix.de>
Date: Mon, 3 May 2021 08:23:38 +0200
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Billy Tsai <billy_tsai@...eedtech.com>
Cc: "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"linux-aspeed@...ts.ozlabs.org" <linux-aspeed@...ts.ozlabs.org>,
"linux-pwm@...r.kernel.org" <linux-pwm@...r.kernel.org>,
"andrew@...id.au" <andrew@...id.au>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"thierry.reding@...il.com" <thierry.reding@...il.com>,
"joel@....id.au" <joel@....id.au>,
"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
BMC-SW <BMC-SW@...eedtech.com>,
"lee.jones@...aro.org" <lee.jones@...aro.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [v2 2/2] pwm: Add Aspeed ast2600 PWM support
Hello,
your second reply is nearly identical to the first. It would be helpful
to only write new stuff in new mail. I think there is only a single new
paragraph that I will reply to here.
On Mon, May 03, 2021 at 05:57:23AM +0000, Billy Tsai wrote:
> On 2021/4/27, 4:44 AM,Uwe Kleine-Königwrote:
> > Also please round down in the division to never provide a duty_cycle
> > bigger than the requested vaule. Also you have to use the actually used
> > period as divider, not state->period.
>
> I don’t think that I should use the actually used period as divider.
> The state->duty_cycle is relative with state->period, not the actual period
> if I use the actual period the precision of the duty cycle may lose.
The strategy you should implement in .apply() is: Pick the biggest
period that is not bigger than the requested period. With that period
pick the biggest duty_cycle that is not bigger than the requested
duty_cycle.
As the actual period might be smaller than state->period, dividing by
the latter yields a result that might be too small.
See commit 8035e6c66a5e98f098edf7441667de74affb4e78 (currently in next)
for a similar example.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists