* [PATCH 0/4] pwm: Ensure .polarity is set in .get_state()
@ 2023-02-28 13:55 Uwe Kleine-König
2023-02-28 13:55 ` [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity " Uwe Kleine-König
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2023-02-28 13:55 UTC (permalink / raw)
To: Thierry Reding, Munehisa Kamata, Jiancheng Xue, yuanjian,
Rob Herring, Benson Leung, Orson Zhai, Baolin Wang,
Chunyan Zhang
Cc: linux-pwm, linux-kernel, Guenter Roeck, chrome-platform, kernel
Hello,
in the context of the discussion with Munehisa Kamata about the meson driver
not setting .polarity in .get_state() I checked the other drivers for the same
issue. The identified drivers are fixed here. For three of them
zero-initializing *state would be good enough, still I think setting the
polarity explicitly is a good idea. For the hibvt driver (that supports
both polarities) the change is a real improvement.
Note I didn't touch the meson driver here that requires some non-trivial
updates that I don't want to tackle without hardware to test.
Best regards
Uwe
Uwe Kleine-König (4):
pwm: hibvt: Explicitly set .polarity in .get_state()
pwm: cros-ec: Explicitly set .polarity in .get_state()
pwm: iqs620a: Explicitly set .polarity in .get_state()
pwm: sprd: Explicitly set .polarity in .get_state()
drivers/pwm/pwm-cros-ec.c | 1 +
drivers/pwm/pwm-hibvt.c | 1 +
drivers/pwm/pwm-iqs620a.c | 1 +
drivers/pwm/pwm-sprd.c | 1 +
4 files changed, 4 insertions(+)
base-commit: 7a77daf8223e772a225d6aa6202a5b1ae2392caf
--
2.39.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity in .get_state()
2023-02-28 13:55 [PATCH 0/4] pwm: Ensure .polarity is set in .get_state() Uwe Kleine-König
@ 2023-02-28 13:55 ` Uwe Kleine-König
2023-02-28 16:19 ` Guenter Roeck
2023-03-10 18:50 ` Uwe Kleine-König
2023-05-08 3:45 ` [PATCH 0/4] pwm: Ensure .polarity is set " patchwork-bot+chrome-platform
2023-05-08 3:56 ` patchwork-bot+chrome-platform
2 siblings, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2023-02-28 13:55 UTC (permalink / raw)
To: Thierry Reding, Munehisa Kamata, Benson Leung
Cc: Guenter Roeck, linux-pwm, chrome-platform, linux-kernel, kernel
The driver only supports normal polarity. Complete the implementation of
.get_state() by setting .polarity accordingly.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/pwm/pwm-cros-ec.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c
index 86df6702cb83..ad18b0ebe3f1 100644
--- a/drivers/pwm/pwm-cros-ec.c
+++ b/drivers/pwm/pwm-cros-ec.c
@@ -198,6 +198,7 @@ static int cros_ec_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
state->enabled = (ret > 0);
state->period = EC_PWM_MAX_DUTY;
+ state->polarity = PWM_POLARITY_NORMAL;
/*
* Note that "disabled" and "duty cycle == 0" are treated the same. If
--
2.39.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity in .get_state()
2023-02-28 13:55 ` [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity " Uwe Kleine-König
@ 2023-02-28 16:19 ` Guenter Roeck
2023-03-10 18:50 ` Uwe Kleine-König
1 sibling, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2023-02-28 16:19 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Thierry Reding, Munehisa Kamata, Benson Leung, Guenter Roeck,
linux-pwm, chrome-platform, linux-kernel, kernel
On Tue, Feb 28, 2023 at 5:55 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> The driver only supports normal polarity. Complete the implementation of
> .get_state() by setting .polarity accordingly.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
> ---
> drivers/pwm/pwm-cros-ec.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c
> index 86df6702cb83..ad18b0ebe3f1 100644
> --- a/drivers/pwm/pwm-cros-ec.c
> +++ b/drivers/pwm/pwm-cros-ec.c
> @@ -198,6 +198,7 @@ static int cros_ec_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
>
> state->enabled = (ret > 0);
> state->period = EC_PWM_MAX_DUTY;
> + state->polarity = PWM_POLARITY_NORMAL;
>
> /*
> * Note that "disabled" and "duty cycle == 0" are treated the same. If
> --
> 2.39.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity in .get_state()
2023-02-28 13:55 ` [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity " Uwe Kleine-König
2023-02-28 16:19 ` Guenter Roeck
@ 2023-03-10 18:50 ` Uwe Kleine-König
1 sibling, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2023-03-10 18:50 UTC (permalink / raw)
To: Thierry Reding, Munehisa Kamata, Benson Leung
Cc: Guenter Roeck, linux-pwm, linux-kernel, kernel, chrome-platform
[-- Attachment #1: Type: text/plain, Size: 631 bytes --]
On Tue, Feb 28, 2023 at 02:55:06PM +0100, Uwe Kleine-König wrote:
> The driver only supports normal polarity. Complete the implementation of
> .get_state() by setting .polarity accordingly.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
I think we should apply this patch as a fix to prevent similar failures
as reported for the meson driver. To justify that:
Fixes: 1f0d3bb02785 ("pwm: Add ChromeOS EC PWM driver")
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] pwm: Ensure .polarity is set in .get_state()
2023-02-28 13:55 [PATCH 0/4] pwm: Ensure .polarity is set in .get_state() Uwe Kleine-König
2023-02-28 13:55 ` [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity " Uwe Kleine-König
@ 2023-05-08 3:45 ` patchwork-bot+chrome-platform
2023-05-08 3:56 ` patchwork-bot+chrome-platform
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-05-08 3:45 UTC (permalink / raw)
To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
Cc: thierry.reding, kamatam, xuejiancheng, yuanjian12, robh, bleung,
orsonzhai, baolin.wang, zhang.lyra, linux-pwm, linux-kernel,
groeck, chrome-platform, kernel
Hello:
This patch was applied to chrome-platform/linux.git (for-kernelci)
by Thierry Reding <thierry.reding@gmail.com>:
On Tue, 28 Feb 2023 14:55:04 +0100 you wrote:
> Hello,
>
> in the context of the discussion with Munehisa Kamata about the meson driver
> not setting .polarity in .get_state() I checked the other drivers for the same
> issue. The identified drivers are fixed here. For three of them
> zero-initializing *state would be good enough, still I think setting the
> polarity explicitly is a good idea. For the hibvt driver (that supports
> both polarities) the change is a real improvement.
>
> [...]
Here is the summary with links:
- [2/4] pwm: cros-ec: Explicitly set .polarity in .get_state()
https://git.kernel.org/chrome-platform/c/30006b77c7e1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] pwm: Ensure .polarity is set in .get_state()
2023-02-28 13:55 [PATCH 0/4] pwm: Ensure .polarity is set in .get_state() Uwe Kleine-König
2023-02-28 13:55 ` [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity " Uwe Kleine-König
2023-05-08 3:45 ` [PATCH 0/4] pwm: Ensure .polarity is set " patchwork-bot+chrome-platform
@ 2023-05-08 3:56 ` patchwork-bot+chrome-platform
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-05-08 3:56 UTC (permalink / raw)
To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
Cc: thierry.reding, kamatam, xuejiancheng, yuanjian12, robh, bleung,
orsonzhai, baolin.wang, zhang.lyra, linux-pwm, linux-kernel,
groeck, chrome-platform, kernel
Hello:
This patch was applied to chrome-platform/linux.git (for-next)
by Thierry Reding <thierry.reding@gmail.com>:
On Tue, 28 Feb 2023 14:55:04 +0100 you wrote:
> Hello,
>
> in the context of the discussion with Munehisa Kamata about the meson driver
> not setting .polarity in .get_state() I checked the other drivers for the same
> issue. The identified drivers are fixed here. For three of them
> zero-initializing *state would be good enough, still I think setting the
> polarity explicitly is a good idea. For the hibvt driver (that supports
> both polarities) the change is a real improvement.
>
> [...]
Here is the summary with links:
- [2/4] pwm: cros-ec: Explicitly set .polarity in .get_state()
https://git.kernel.org/chrome-platform/c/30006b77c7e1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-05-08 3:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 13:55 [PATCH 0/4] pwm: Ensure .polarity is set in .get_state() Uwe Kleine-König
2023-02-28 13:55 ` [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity " Uwe Kleine-König
2023-02-28 16:19 ` Guenter Roeck
2023-03-10 18:50 ` Uwe Kleine-König
2023-05-08 3:45 ` [PATCH 0/4] pwm: Ensure .polarity is set " patchwork-bot+chrome-platform
2023-05-08 3:56 ` patchwork-bot+chrome-platform
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).