[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201208091033.bxzrlad7mjbe3dsp@pengutronix.de>
Date: Tue, 8 Dec 2020 10:10:33 +0100
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Clemens Gruber <clemens.gruber@...ruber.com>
Cc: linux-pwm@...r.kernel.org,
Thierry Reding <thierry.reding@...il.com>,
Lee Jones <lee.jones@...aro.org>, linux-kernel@...r.kernel.org,
Sven Van Asbroeck <TheSven73@...il.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
David Jander <david@...tonic.nl>
Subject: Re: [PATCH v4 1/4] pwm: pca9685: Switch to atomic API
Hello Clemens,
On Tue, Dec 08, 2020 at 12:13:44AM +0100, Clemens Gruber wrote:
> On Mon, Dec 07, 2020 at 11:00:25PM +0100, Uwe Kleine-König wrote:
> > On Mon, Dec 07, 2020 at 08:36:27PM +0100, Clemens Gruber wrote:
> > > The hardware readout may return slightly different values than those
> > > that were set in apply due to the limited range of possible prescale and
> > > counter register values. If one channel is reconfigured with new duty
> > > cycle and period, the others will keep the same relative duty cycle to
> > > period ratio as they had before, even though the per-chip / global
> > > frequency changed. (The PCA9685 has only one prescaler!)
> >
> > This is not acceptable, if you have two PWM outputs and a consumer
> > modifies one of them the other must change. So if this chip only
> > supports a single period length of all channels, the first consumer
> > enabling a channel defines the period to be used. All later consumers
> > must live with that. (Also the first must be denied modifying the period
> > if a second consumer has enabled its PWM.)
>
> Good idea, but is it OK to potentially break users relying on the old
> behavior ("the last one who changes the period wins") ?
If this is already in the old code, this probably warrants a separate
fix, and yes, I consider this a severe bug. (Consider one channel
driving a motor and reconfiguring an LED modifies the motor's speed.)
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