pwm: visconti: Fix and simplify period calculation
With the original code a request for period =
65536000 ns and period =
32768000 ns yields the same register settings (which results in
32768000
ns) because the value for pwmc0 was miscalculated.
Also simplify using that fls(0) is 0.
Fixes: 721b595744f1 ("pwm: visconti: Add Toshiba Visconti SoC PWM support")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>