]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: qcom: fix RCG M/N counter configuration
authorArchit Taneja <architt@codeaurora.org>
Wed, 4 Mar 2015 09:49:35 +0000 (15:19 +0530)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 17 May 2015 23:12:19 +0000 (19:12 -0400)
commit5ec6388f8e752c6f63caf859ad2be687668c3389
treeb60c9e4adb193d7a37e843a160445fa26a6f1fa2
parentd415fc1d430b6f0a5c1011bf9830fcdb756a8718
clk: qcom: fix RCG M/N counter configuration

[ Upstream commit 0b21503dbbfa669dbd847b33578d4041513cddb2 ]

Currently, a RCG's M/N counter (used for fraction division) is
set to either 'bypass' (counter disabled) or 'dual edge' (counter
enabled) based on whether the corresponding rcg struct has a mnd
field specified and a non-zero N.

In the case where M and N are the same value, the M/N counter is
still enabled by code even though no division takes place.
Leaving the RCG in such a state can result in improper behavior.
This was observed with the DSI pixel clock RCG when M and N were
both set to 1.

Add an additional check (M != N) to enable the M/N counter only
when it's needed for fraction division.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Fixes: bcd61c0f535a (clk: qcom: Add support for root clock
generators (RCGs))
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/clk/qcom/clk-rcg2.c