[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20ac22dbeb9e41bdcb594ee82f6ccd609c3426c6.1583782035.git.gurus@codeaurora.org>
Date: Mon, 9 Mar 2020 12:35:13 -0700
From: Guru Das Srinagesh <gurus@...eaurora.org>
To: linux-pwm@...r.kernel.org
Cc: Thierry Reding <thierry.reding@...il.com>,
Uwe Kleine-König <uwe@...ine-koenig.org>,
Subbaraman Narayanamurthy <subbaram@...eaurora.org>,
linux-kernel@...r.kernel.org,
Guru Das Srinagesh <gurus@...eaurora.org>,
Fabrice Gasnier <fabrice.gasnier@...com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...com>
Subject: [PATCH v7 10/13] pwm: stm32-lp: Use %llu format specifier for period
Because period and duty cycle are defined in the PWM framework structs
as ints with units of nanoseconds, the maximum time duration that can be
set is limited to ~2.147 seconds. Redefining them as u64 values will
enable larger time durations to be set.
As a first step, prepare this driver to handle the switch to u64 period
and duty_cycle by updating the format specifier in this dev_dbg message.
The actual switch to u64 period and duty_cycle follows as a separate
patch.
Cc: Fabrice Gasnier <fabrice.gasnier@...com>
Cc: Maxime Coquelin <mcoquelin.stm32@...il.com>
Cc: Alexandre Torgue <alexandre.torgue@...com>
Signed-off-by: Guru Das Srinagesh <gurus@...eaurora.org>
---
drivers/pwm/pwm-stm32-lp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c
index 67fca62..134c146 100644
--- a/drivers/pwm/pwm-stm32-lp.c
+++ b/drivers/pwm/pwm-stm32-lp.c
@@ -61,7 +61,7 @@ static int stm32_pwm_lp_apply(struct pwm_chip *chip, struct pwm_device *pwm,
do_div(div, NSEC_PER_SEC);
if (!div) {
/* Clock is too slow to achieve requested period. */
- dev_dbg(priv->chip.dev, "Can't reach %u ns\n", state->period);
+ dev_dbg(priv->chip.dev, "Can't reach %llu ns\n", state->period);
return -EINVAL;
}
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Powered by blists - more mailing lists