public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] pwm: lpss: wait_for_update() before configuring pwm
@ 2024-08-19  8:04 Raag Jadav
  2024-08-19  8:21 ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Raag Jadav @ 2024-08-19  8:04 UTC (permalink / raw)
  To: ukleinek, mika.westerberg, andriy.shevchenko, jarkko.nikula
  Cc: linux-pwm, linux-kernel, Raag Jadav

Wait for SW_UPDATE bit to clear before configuring pwm channel instead of
failing right away, which will reduce failure rates on early access.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/pwm/pwm-lpss.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c
index 867e2bc8c601..4a634a43b133 100644
--- a/drivers/pwm/pwm-lpss.c
+++ b/drivers/pwm/pwm-lpss.c
@@ -111,16 +111,6 @@ static int pwm_lpss_wait_for_update(struct pwm_device *pwm)
 	return err;
 }
 
-static inline int pwm_lpss_is_updating(struct pwm_device *pwm)
-{
-	if (pwm_lpss_read(pwm) & PWM_SW_UPDATE) {
-		dev_err(pwmchip_parent(pwm->chip), "PWM_SW_UPDATE is still set, skipping update\n");
-		return -EBUSY;
-	}
-
-	return 0;
-}
-
 static void pwm_lpss_prepare(struct pwm_lpss_chip *lpwm, struct pwm_device *pwm,
 			     int duty_ns, int period_ns)
 {
@@ -168,7 +158,7 @@ static int pwm_lpss_prepare_enable(struct pwm_lpss_chip *lpwm,
 {
 	int ret;
 
-	ret = pwm_lpss_is_updating(pwm);
+	ret = pwm_lpss_wait_for_update(pwm);
 	if (ret)
 		return ret;
 
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-22  8:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19  8:04 [PATCH v1] pwm: lpss: wait_for_update() before configuring pwm Raag Jadav
2024-08-19  8:21 ` Andy Shevchenko
2024-08-20  5:50   ` Raag Jadav
2024-08-20  9:56     ` Andy Shevchenko
2024-08-22  8:55       ` Raag Jadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox