All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Rob Herring <robh+dt@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	devicetree@vger.kernel.org, linux-pwm@vger.kernel.org,
	punit1.agrawal@toshiba.co.jp, yuji2.ishikawa@toshiba.co.jp,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support
Date: Sun, 18 Apr 2021 20:07:18 +0900	[thread overview]
Message-ID: <20210418110718.4zrh665anbz3wmqc@toshiba.co.jp> (raw)
In-Reply-To: <20210417155009.vnqxx3fn2yjzp3qc@pengutronix.de>

Hi Uwe,

On Sat, Apr 17, 2021 at 05:50:09PM +0200, Uwe Kleine-König wrote:
> 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.
> 

I understood, thanks.

> > However, I think this means that the device is working as this driver.
> 
> I don't understand this sentence.

The description of the struct pwm_state says "PWM enabled status".
I thought 'state-> enabled' would hold the working state of the hardware.

> 
> Best regards
> Uwe

Best regards,
  Nobuhiro

WARNING: multiple messages have this Message-ID (diff)
From: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Rob Herring <robh+dt@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	devicetree@vger.kernel.org, linux-pwm@vger.kernel.org,
	punit1.agrawal@toshiba.co.jp, yuji2.ishikawa@toshiba.co.jp,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support
Date: Sun, 18 Apr 2021 20:07:18 +0900	[thread overview]
Message-ID: <20210418110718.4zrh665anbz3wmqc@toshiba.co.jp> (raw)
In-Reply-To: <20210417155009.vnqxx3fn2yjzp3qc@pengutronix.de>

Hi Uwe,

On Sat, Apr 17, 2021 at 05:50:09PM +0200, Uwe Kleine-König wrote:
> 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.
> 

I understood, thanks.

> > However, I think this means that the device is working as this driver.
> 
> I don't understand this sentence.

The description of the struct pwm_state says "PWM enabled status".
I thought 'state-> enabled' would hold the working state of the hardware.

> 
> Best regards
> Uwe

Best regards,
  Nobuhiro

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-04-18 11:08 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 23:08 [PATCH v4 0/2] pwm: visconti: Add Toshiba Visconti SoC PWM support Nobuhiro Iwamatsu
2021-04-09 23:08 ` Nobuhiro Iwamatsu
2021-04-09 23:08 ` [PATCH v4 1/2] dt-bindings: pwm: Add bindings for Toshiba Visconti PWM Controller Nobuhiro Iwamatsu
2021-04-09 23:08   ` Nobuhiro Iwamatsu
2021-04-09 23:08 ` [PATCH v4 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support Nobuhiro Iwamatsu
2021-04-09 23:08   ` Nobuhiro Iwamatsu
2021-04-10  1:57   ` kernel test robot
2021-04-10 13:53   ` Uwe Kleine-König
2021-04-10 13:53     ` Uwe Kleine-König
2021-04-12  2:55     ` Nobuhiro Iwamatsu
2021-04-12  2:55       ` Nobuhiro Iwamatsu
2021-04-12  7:02       ` Uwe Kleine-König
2021-04-12  7:02         ` Uwe Kleine-König
2021-04-16  8:07         ` Nobuhiro Iwamatsu
2021-04-16  8:07           ` Nobuhiro Iwamatsu
2021-04-16  9:44           ` Uwe Kleine-König
2021-04-16  9:44             ` Uwe Kleine-König
2021-04-16 12:15             ` Nobuhiro Iwamatsu
2021-04-16 12:15               ` Nobuhiro Iwamatsu
2021-04-17 15:50               ` Uwe Kleine-König
2021-04-17 15:50                 ` Uwe Kleine-König
2021-04-18 11:07                 ` Nobuhiro Iwamatsu [this message]
2021-04-18 11:07                   ` Nobuhiro Iwamatsu
2021-04-10 18:52   ` Uwe Kleine-König
2021-04-10 18:52     ` Uwe Kleine-König
2021-04-12  3:04     ` Nobuhiro Iwamatsu
2021-04-12  3:04       ` Nobuhiro Iwamatsu

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=20210418110718.4zrh665anbz3wmqc@toshiba.co.jp \
    --to=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=punit1.agrawal@toshiba.co.jp \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=yuji2.ishikawa@toshiba.co.jp \
    /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.