提交 ceb12f93 编写于 作者: B Boris BREZILLON 提交者: Thierry Reding

pwm: atmel-tcb: fix max time computation for slow clk source

Use the the tcb counter width to compute the maximum time that can be
represented using the slow clock source instead of the static 16 bit width.
Signed-off-by: NBoris BREZILLON <b.brezillon@overkiz.com>
Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
上级 f3a82170
......@@ -307,7 +307,7 @@ static int atmel_tcb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
i = slowclk;
rate = 32768;
min = div_u64(NSEC_PER_SEC, rate);
max = min << 16;
max = min << tc->tcb_config->counter_width;
/* If period is too big return ERANGE error */
if (max < period_ns)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册