[3/4] pwm: iqs620a: Explicitly set .polarity in .get_state()

Message ID 20230228135508.1798428-4-u.kleine-koenig@pengutronix.de
State New
Headers
Series pwm: Ensure .polarity is set in .get_state() |

Commit Message

Uwe Kleine-König Feb. 28, 2023, 1:55 p.m. UTC
  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-iqs620a.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Uwe Kleine-König March 10, 2023, 6:48 p.m. UTC | #1
[To += Jeff LaBundy]

On Tue, Feb 28, 2023 at 02:55:07PM +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: 6f0841a8197b ("pwm: Add support for Azoteq IQS620A PWM generator")

Best regards
Uwe
  
Jeff LaBundy March 10, 2023, 11:29 p.m. UTC | #2
On Fri, Mar 10, 2023 at 07:48:15PM +0100, Uwe Kleine-König wrote:
> [To += Jeff LaBundy]
> 
> On Tue, Feb 28, 2023 at 02:55:07PM +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: 6f0841a8197b ("pwm: Add support for Azoteq IQS620A PWM generator")

Reviewed-by: Jeff LaBundy <jeff@labundy.com>

> 
> Best regards
> Uwe
> 
> -- 
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | https://www.pengutronix.de/ |
  

Patch

diff --git a/drivers/pwm/pwm-iqs620a.c b/drivers/pwm/pwm-iqs620a.c
index 8362b4870c66..47b3141135f3 100644
--- a/drivers/pwm/pwm-iqs620a.c
+++ b/drivers/pwm/pwm-iqs620a.c
@@ -126,6 +126,7 @@  static int iqs620_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
 	mutex_unlock(&iqs620_pwm->lock);
 
 	state->period = IQS620_PWM_PERIOD_NS;
+	state->polarity = PWM_POLARITY_NORMAL;
 
 	return 0;
 }