clk: si5341: fix reported clk_rate when output divider is 2
authorAdam Wujek <dev_public@wujek.eu>
Fri, 3 Dec 2021 14:12:07 +0000 (14:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:59:10 +0000 (20:59 +0200)
commit161863aec0e16fdd505dc5b0ad919b9b70c1cf10
tree597717d7fe549a352ea53f2b8518881a4000363d
parent31e027259ce48cfa06700ad5a1a377768b56bf8b
clk: si5341: fix reported clk_rate when output divider is 2

[ Upstream commit 2a8b539433e111c4de364237627ef219d2f6350a ]

SI5341_OUT_CFG_RDIV_FORCE2 shall be checked first to distinguish whether
a divider for a given output is set to 2 (SI5341_OUT_CFG_RDIV_FORCE2
is set) or the output is disabled (SI5341_OUT_CFG_RDIV_FORCE2 not set,
SI5341_OUT_R_REG is set 0).
Before the change, divider set to 2 (SI5341_OUT_R_REG set to 0) was
interpreted as output is disabled.

Signed-off-by: Adam Wujek <dev_public@wujek.eu>
Link: https://lore.kernel.org/r/20211203141125.2447520-1-dev_public@wujek.eu
Reviewed-by: Robert Hancock <robert.hancock@calian.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/clk-si5341.c