All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Neil Armstrong <neil.armstrong@linaro.org>
Cc: "Heiner Kallweit" <hkallweit1@gmail.com>,
	"Jerome Brunet" <jbrunet@baylibre.com>,
	"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	"Kevin Hilman" <khilman@baylibre.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH v4 4/4] pwm: meson: make full use of common clock framework
Date: Mon, 17 Apr 2023 11:17:57 +0200	[thread overview]
Message-ID: <ZD0OxV_VOWcS7URd@orome> (raw)
In-Reply-To: <ca531c1a-3c62-5fb1-6765-68ec1e541483@linaro.org>


[-- Attachment #1.1: Type: text/plain, Size: 1595 bytes --]

On Mon, Apr 17, 2023 at 09:23:35AM +0200, Neil Armstrong wrote:
> On 13/04/2023 07:54, Heiner Kallweit wrote:
[...]
> > diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
[...]
> > @@ -271,16 +255,16 @@ static int meson_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> >   			/*
> >   			 * This IP block revision doesn't have an "always high"
> >   			 * setting which we can use for "inverted disabled".
> > -			 * Instead we achieve this using the same settings
> > -			 * that we use a pre_div of 0 (to get the shortest
> > -			 * possible duration for one "count") and
> > +			 * Instead we achieve this by setting an arbitrary,
> > +			 * very high frequency, resulting in the shortest
> > +			 * possible duration for one "count" and
> >   			 * "period == duty_cycle". This results in a signal
> >   			 * which is LOW for one "count", while being HIGH for
> >   			 * the rest of the (so the signal is HIGH for slightly
> >   			 * less than 100% of the period, but this is the best
> >   			 * we can achieve).
> >   			 */
> > -			channel->pre_div = 0;
> > +			channel->rate = 1000000000;
> >   			channel->hi = ~0;
> >   			channel->lo = 0;
> 
> This looks like a really bad idea... please don't do that and instead introduce
> some pinctrl states where we set the PWM pin as GPIO mode high/low state like we
> did for SPI:
> https://lore.kernel.org/r/20221004-up-aml-fix-spi-v4-2-0342d8e10c49@baylibre.com

Yeah, absolutely. If the pin controller can do that, that's the right
way to implement the desired behavior.

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

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

WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding@gmail.com>
To: Neil Armstrong <neil.armstrong@linaro.org>
Cc: "Heiner Kallweit" <hkallweit1@gmail.com>,
	"Jerome Brunet" <jbrunet@baylibre.com>,
	"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	"Kevin Hilman" <khilman@baylibre.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH v4 4/4] pwm: meson: make full use of common clock framework
Date: Mon, 17 Apr 2023 11:17:57 +0200	[thread overview]
Message-ID: <ZD0OxV_VOWcS7URd@orome> (raw)
In-Reply-To: <ca531c1a-3c62-5fb1-6765-68ec1e541483@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1595 bytes --]

On Mon, Apr 17, 2023 at 09:23:35AM +0200, Neil Armstrong wrote:
> On 13/04/2023 07:54, Heiner Kallweit wrote:
[...]
> > diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
[...]
> > @@ -271,16 +255,16 @@ static int meson_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> >   			/*
> >   			 * This IP block revision doesn't have an "always high"
> >   			 * setting which we can use for "inverted disabled".
> > -			 * Instead we achieve this using the same settings
> > -			 * that we use a pre_div of 0 (to get the shortest
> > -			 * possible duration for one "count") and
> > +			 * Instead we achieve this by setting an arbitrary,
> > +			 * very high frequency, resulting in the shortest
> > +			 * possible duration for one "count" and
> >   			 * "period == duty_cycle". This results in a signal
> >   			 * which is LOW for one "count", while being HIGH for
> >   			 * the rest of the (so the signal is HIGH for slightly
> >   			 * less than 100% of the period, but this is the best
> >   			 * we can achieve).
> >   			 */
> > -			channel->pre_div = 0;
> > +			channel->rate = 1000000000;
> >   			channel->hi = ~0;
> >   			channel->lo = 0;
> 
> This looks like a really bad idea... please don't do that and instead introduce
> some pinctrl states where we set the PWM pin as GPIO mode high/low state like we
> did for SPI:
> https://lore.kernel.org/r/20221004-up-aml-fix-spi-v4-2-0342d8e10c49@baylibre.com

Yeah, absolutely. If the pin controller can do that, that's the right
way to implement the desired behavior.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding@gmail.com>
To: Neil Armstrong <neil.armstrong@linaro.org>
Cc: "Heiner Kallweit" <hkallweit1@gmail.com>,
	"Jerome Brunet" <jbrunet@baylibre.com>,
	"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	"Kevin Hilman" <khilman@baylibre.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH v4 4/4] pwm: meson: make full use of common clock framework
Date: Mon, 17 Apr 2023 11:17:57 +0200	[thread overview]
Message-ID: <ZD0OxV_VOWcS7URd@orome> (raw)
In-Reply-To: <ca531c1a-3c62-5fb1-6765-68ec1e541483@linaro.org>


[-- Attachment #1.1: Type: text/plain, Size: 1595 bytes --]

On Mon, Apr 17, 2023 at 09:23:35AM +0200, Neil Armstrong wrote:
> On 13/04/2023 07:54, Heiner Kallweit wrote:
[...]
> > diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
[...]
> > @@ -271,16 +255,16 @@ static int meson_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> >   			/*
> >   			 * This IP block revision doesn't have an "always high"
> >   			 * setting which we can use for "inverted disabled".
> > -			 * Instead we achieve this using the same settings
> > -			 * that we use a pre_div of 0 (to get the shortest
> > -			 * possible duration for one "count") and
> > +			 * Instead we achieve this by setting an arbitrary,
> > +			 * very high frequency, resulting in the shortest
> > +			 * possible duration for one "count" and
> >   			 * "period == duty_cycle". This results in a signal
> >   			 * which is LOW for one "count", while being HIGH for
> >   			 * the rest of the (so the signal is HIGH for slightly
> >   			 * less than 100% of the period, but this is the best
> >   			 * we can achieve).
> >   			 */
> > -			channel->pre_div = 0;
> > +			channel->rate = 1000000000;
> >   			channel->hi = ~0;
> >   			channel->lo = 0;
> 
> This looks like a really bad idea... please don't do that and instead introduce
> some pinctrl states where we set the PWM pin as GPIO mode high/low state like we
> did for SPI:
> https://lore.kernel.org/r/20221004-up-aml-fix-spi-v4-2-0342d8e10c49@baylibre.com

Yeah, absolutely. If the pin controller can do that, that's the right
way to implement the desired behavior.

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

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

  reply	other threads:[~2023-04-17  9:18 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13  5:48 [PATCH v4 0/4] pwm: meson: make full use of common clock framework Heiner Kallweit
2023-04-13  5:48 ` Heiner Kallweit
2023-04-13  5:48 ` Heiner Kallweit
2023-04-13  5:49 ` [PATCH v4 1/4] pwm: meson: switch to using struct clk_parent_data for mux parents Heiner Kallweit
2023-04-13  5:49   ` Heiner Kallweit
2023-04-13  5:49   ` Heiner Kallweit
2023-04-13  5:50 ` [PATCH v4 2/4] pwm: meson: don't use hdmi/video clock as mux parent Heiner Kallweit
2023-04-13  5:50   ` Heiner Kallweit
2023-04-13  5:50   ` Heiner Kallweit
2023-04-13  5:51 ` [PATCH v4 3/4] pwm: meson: change clk/pwm gate from mask to bit Heiner Kallweit
2023-04-13  5:51   ` Heiner Kallweit
2023-04-13  5:51   ` Heiner Kallweit
2023-04-13  5:54 ` [PATCH v4 4/4] pwm: meson: make full use of common clock framework Heiner Kallweit
2023-04-13  5:54   ` Heiner Kallweit
2023-04-13  5:54   ` Heiner Kallweit
2023-04-14 19:39   ` Martin Blumenstingl
2023-04-14 19:39     ` Martin Blumenstingl
2023-04-14 19:39     ` Martin Blumenstingl
2023-04-15  6:39     ` Heiner Kallweit
2023-04-15  6:39       ` Heiner Kallweit
2023-04-15  6:39       ` Heiner Kallweit
2023-04-16 19:26       ` Martin Blumenstingl
2023-04-16 19:26         ` Martin Blumenstingl
2023-04-16 19:26         ` Martin Blumenstingl
2023-04-16 21:34         ` Heiner Kallweit
2023-04-16 21:34           ` Heiner Kallweit
2023-04-16 21:34           ` Heiner Kallweit
2023-04-23 20:55           ` Martin Blumenstingl
2023-04-23 20:55             ` Martin Blumenstingl
2023-04-23 20:55             ` Martin Blumenstingl
2023-04-17  7:23   ` Neil Armstrong
2023-04-17  7:23     ` Neil Armstrong
2023-04-17  7:23     ` Neil Armstrong
2023-04-17  9:17     ` Thierry Reding [this message]
2023-04-17  9:17       ` Thierry Reding
2023-04-17  9:17       ` Thierry Reding
2023-04-17  9:53     ` Heiner Kallweit
2023-04-17  9:53       ` Heiner Kallweit
2023-04-17  9:53       ` Heiner Kallweit
2023-04-17  9:59       ` neil.armstrong
2023-04-17  9:59         ` neil.armstrong
2023-04-17  9:59         ` neil.armstrong
2023-04-17 10:36         ` Heiner Kallweit
2023-04-17 10:36           ` Heiner Kallweit
2023-04-17 10:36           ` Heiner Kallweit
2023-04-17 12:21           ` neil.armstrong
2023-04-17 12:21             ` neil.armstrong
2023-04-17 12:21             ` neil.armstrong
2023-04-19 19:58             ` Heiner Kallweit
2023-04-19 19:58               ` Heiner Kallweit
2023-04-19 19:58               ` Heiner Kallweit
2023-04-21  7:39               ` neil.armstrong
2023-04-21  7:39                 ` neil.armstrong
2023-04-21  7:39                 ` neil.armstrong
2023-04-23 20:58               ` Martin Blumenstingl
2023-04-23 20:58                 ` Martin Blumenstingl
2023-04-23 20:58                 ` Martin Blumenstingl
2023-05-01 13:39                 ` Heiner Kallweit
2023-05-01 13:39                   ` Heiner Kallweit
2023-05-01 13:39                   ` Heiner Kallweit
2023-05-19 15:30   ` Dmitry Rokosov
2023-05-19 15:30     ` Dmitry Rokosov
2023-05-19 15:30     ` Dmitry Rokosov
2023-05-19 16:53     ` Heiner Kallweit
2023-05-19 16:53       ` Heiner Kallweit
2023-05-19 16:53       ` Heiner Kallweit
2023-05-22 13:37       ` Dmitry Rokosov
2023-05-22 13:37         ` Dmitry Rokosov
2023-05-22 13:37         ` Dmitry Rokosov
2023-05-22 20:10         ` Heiner Kallweit
2023-05-22 20:10           ` Heiner Kallweit
2023-05-22 20:10           ` Heiner Kallweit
2023-05-23 10:28           ` Dmitry Rokosov
2023-05-23 10:28             ` Dmitry Rokosov
2023-05-23 10:28             ` Dmitry Rokosov
2023-05-23 19:22             ` Heiner Kallweit
2023-05-23 19:22               ` Heiner Kallweit
2023-05-23 19:22               ` Heiner Kallweit
2023-04-17  7:19 ` [PATCH v4 0/4] " Neil Armstrong

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=ZD0OxV_VOWcS7URd@orome \
    --to=thierry.reding@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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.