linux/drivers/clk/ingenic
Paul Cercueil bc5d922c93 clk: ingenic: Fix round_rate misbehaving with non-integer dividers
Take a parent rate of 180 MHz, and a requested rate of 4.285715 MHz.
This results in a theorical divider of 41.999993 which is then rounded
up to 42. The .round_rate function would then return (180 MHz / 42) as
the clock, rounded down, so 4.285714 MHz.

Calling clk_set_rate on 4.285714 MHz would round the rate again, and
give a theorical divider of 42,0000028, now rounded up to 43, and the
rate returned would be (180 MHz / 43) which is 4.186046 MHz, aka. not
what we requested.

Fix this by rounding up the divisions.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Tested-by: Maarten ter Huurne <maarten@treewalker.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2019-02-22 10:13:43 -08:00
..
cgu.c clk: ingenic: Fix round_rate misbehaving with non-integer dividers 2019-02-22 10:13:43 -08:00
cgu.h docs: Fix some broken references 2018-06-15 18:10:01 -03:00
jz4725b-cgu.c clk: Add Ingenic jz4725b CGU driver 2018-10-16 15:19:48 -07:00
jz4740-cgu.c clk: ingenic: jz4740: Fix gating of UDC clock 2019-02-05 13:32:26 -08:00
jz4770-cgu.c clk: ingenic: jz4770: Add 150us delay after enabling VPU clock 2018-06-01 23:21:39 -07:00
jz4780-cgu.c clk: ingenic: Use const pointer to clk_ops in struct 2018-01-18 22:04:36 +00:00
Kconfig clk: Add Ingenic jz4725b CGU driver 2018-10-16 15:19:48 -07:00
Makefile clk: Add Ingenic jz4725b CGU driver 2018-10-16 15:19:48 -07:00