[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240819080412.15115-1-raag.jadav@intel.com>
Date: Mon, 19 Aug 2024 13:34:12 +0530
From: Raag Jadav <raag.jadav@...el.com>
To: ukleinek@...nel.org,
mika.westerberg@...ux.intel.com,
andriy.shevchenko@...ux.intel.com,
jarkko.nikula@...ux.intel.com
Cc: linux-pwm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Raag Jadav <raag.jadav@...el.com>
Subject: [PATCH v1] pwm: lpss: wait_for_update() before configuring pwm
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@...el.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
Powered by blists - more mailing lists