[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210417155009.vnqxx3fn2yjzp3qc@pengutronix.de>
Date: Sat, 17 Apr 2021 17:50:09 +0200
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@...hiba.co.jp>
Cc: Rob Herring <robh+dt@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Lee Jones <lee.jones@...aro.org>, devicetree@...r.kernel.org,
linux-pwm@...r.kernel.org, punit1.agrawal@...hiba.co.jp,
yuji2.ishikawa@...hiba.co.jp, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM
support
Hello Nobuhiro,
On Fri, Apr 16, 2021 at 09:15:23PM +0900, Nobuhiro Iwamatsu wrote:
> > > > For me the critical (and only) difference between "off" and
> > > > "duty cycle = 0" is that when a new configuration is to be applied. In
> > > > the "off" state a new period can (and should) start immediately, while
> > > > with "duty_cycle = 0" the rising edge should be delayed until the
> > > > currently running period is over.[1]
> > > >
> > > > So the thing to do here (IMHO) is:
> > > >
> > > > Iff with PIPGM_PCSR = 0 configuring a new setting (that is finalized
> > > > with writing a non-zero value to PIPGM_PCSR) completes the currently
> > > > running period, then always assume the PWM as enabled.
> > >
> > > Yes, this device works that way.
> >
> > OK, then please use
> >
> > state->enabled = true
> >
> > unconditionally in visconti_pwm_get_state().
>
> Please let me check.
> If I unconditionally add 'state->enabled = true' to visconti_pwm_get_state(),
> state->enabled is set to true because visconti_pwm_get_state() is called when
> the device is created (this is when I write the device number to the export of
> /sys/class/pwm/pwmchip0 ).
> And since PIPGM_PCSR is 0 in this state, the pulse by PWM is not output.
A PWM that is currently configured with .enabled = true and .duty_cycle
= 0 doesn't have a pulse, so this is fine.
> However, I think this means that the device is working as this driver.
I don't understand this sentence.
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