]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
clk: ingenic: Fix divider calculation with div tables
authorPaul Cercueil <paul@crapouillou.net>
Sat, 12 Dec 2020 13:57:33 +0000 (13:57 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 20 Jan 2021 13:26:36 +0000 (14:26 +0100)
commit759e7df414e89fb94e119be75d670f9fbafd83f7
tree23c5dba10c9efafd6d0e56e7da8c03de43e303c5
parent4f2e792c332670bbd7b9ef5c085d1791460e5ca7
clk: ingenic: Fix divider calculation with div tables

BugLink: https://bugs.launchpad.net/bugs/1910822
commit 11a163f2c7d6a9f27ce144cd7e367a81c851621a upstream.

The previous code assumed that a higher hardware value always resulted
in a bigger divider, which is correct for the regular clocks, but is
an invalid assumption when a divider table is provided for the clock.

Perfect example of this is the PLL0_HALF clock, which applies a /2
divider with the hardware value 0, and a /1 divider otherwise.

Fixes: a9fa2893fcc6 ("clk: ingenic: Add support for divider tables")
Cc: <stable@vger.kernel.org> # 5.2
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20201212135733.38050-1-paul@crapouillou.net
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/clk/ingenic/cgu.c