2023-02-28 13:55:33

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity in .get_state()

The driver only supports normal polarity. Complete the implementation of
.get_state() by setting .polarity accordingly.

Signed-off-by: Uwe Kleine-König <[email protected]>
---
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



2023-02-28 16:19:20

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity in .get_state()

On Tue, Feb 28, 2023 at 5:55 AM Uwe Kleine-König
<[email protected]> wrote:
>
> The driver only supports normal polarity. Complete the implementation of
> .get_state() by setting .polarity accordingly.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> 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
>

2023-03-10 18:50:42

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity in .get_state()

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 <[email protected]>

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/ |


Attachments:
(No filename) (614.00 B)
signature.asc (488.00 B)
Download all attachments