diff --git a/msm/dsi/dsi_ctrl.c b/msm/dsi/dsi_ctrl.c index 769fc10b9a..2c5ee1b8df 100644 --- a/msm/dsi/dsi_ctrl.c +++ b/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);