Browse Source

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 <[email protected]>
Satya Rama Aditya Pinapala 4 năm trước cách đây
mục cha
commit
57064ba1cc
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      msm/dsi/dsi_ctrl.c

+ 3 - 2
msm/dsi/dsi_ctrl.c

@@ -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);