disp: msm: dsi: round up the byte clock to even number

Change rounds up the calculated byte clock rate to the nearest
even number.

Change-Id: Iea6d3121343f1b2cb6d0a06cd47a84b050d55ac1
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
This commit is contained in:
Satya Rama Aditya Pinapala
2021-02-23 14:37:28 -08:00
parent 5c7dfa0712
commit 57064ba1cc

View File

@@ -1029,10 +1029,11 @@ static int dsi_ctrl_update_link_freqs(struct dsi_ctrl *dsi_ctrl,
byte_clk_rate = bit_rate_per_lane;
/**
* Ensure that the byte clock rate is even to avoid failures
* during set rate for byte intf clock.
* during set rate for byte intf clock. Round up to the nearest
* even number for byte clk.
*/
byte_clk_rate = DIV_ROUND_CLOSEST(byte_clk_rate, 8);
byte_clk_rate &= ~BIT(0);
byte_clk_rate = ((byte_clk_rate + 1) & ~BIT(0));
byte_intf_clk_rate = byte_clk_rate;
byte_intf_clk_div = host_cfg->byte_intf_clk_div;
do_div(byte_intf_clk_rate, byte_intf_clk_div);