clk: qcom: clk-rcg2: Update logic to calculate D value for RCG
authorTaniya Das <tdas@codeaurora.org>
Sun, 27 Feb 2022 17:55:35 +0000 (23:25 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Apr 2022 12:18:18 +0000 (14:18 +0200)
commit52592f9afbfe01bce8f8953e4f19cbe3bcbdbd3a
tree30cfb433951ff8574ab98170edd902acfb6719d0
parentb576488fa3b5715a1ef3eafc0b1c1d3514345613
clk: qcom: clk-rcg2: Update logic to calculate D value for RCG

[ Upstream commit 58922910add18583d5273c2edcdb9fd7bf4eca02 ]

The display pixel clock has a requirement on certain newer platforms to
support M/N as (2/3) and the final D value calculated results in
underflow errors.
As the current implementation does not check for D value is within
the accepted range for a given M & N value. Update the logic to
calculate the final D value based on the range.

Fixes: 99cbd064b059f ("clk: qcom: Support display RCG clocks")
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220227175536.3131-1-tdas@codeaurora.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/qcom/clk-rcg2.c