“cc5c78824b6ceed60280c98c26284d590e026d34”上不存在“src/common/git@gitcode.net:taosdata/tdengine.git”
提交 20f10b41 编写于 作者: A Alexander Shiyan 提交者: Xie XiuQi

pwm: clps711x: Fix period calculation

[ Upstream commit b0f17570 ]

Commit e39c0df1 ("pwm: Introduce the pwm_args concept") has
changed the variable for the period for clps711x-pwm driver, so now
pwm_get/set_period() works with pwm->state.period variable instead
of pwm->args.period.
This patch changes the period variable in other places where it is used.
Signed-off-by: NAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 0d0d655d
...@@ -48,7 +48,7 @@ static void clps711x_pwm_update_val(struct clps711x_chip *priv, u32 n, u32 v) ...@@ -48,7 +48,7 @@ static void clps711x_pwm_update_val(struct clps711x_chip *priv, u32 n, u32 v)
static unsigned int clps711x_get_duty(struct pwm_device *pwm, unsigned int v) static unsigned int clps711x_get_duty(struct pwm_device *pwm, unsigned int v)
{ {
/* Duty cycle 0..15 max */ /* Duty cycle 0..15 max */
return DIV_ROUND_CLOSEST(v * 0xf, pwm_get_period(pwm)); return DIV_ROUND_CLOSEST(v * 0xf, pwm->args.period);
} }
static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
...@@ -71,7 +71,7 @@ static int clps711x_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, ...@@ -71,7 +71,7 @@ static int clps711x_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
struct clps711x_chip *priv = to_clps711x_chip(chip); struct clps711x_chip *priv = to_clps711x_chip(chip);
unsigned int duty; unsigned int duty;
if (period_ns != pwm_get_period(pwm)) if (period_ns != pwm->args.period)
return -EINVAL; return -EINVAL;
duty = clps711x_get_duty(pwm, duty_ns); duty = clps711x_get_duty(pwm, duty_ns);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册