#include <linux/component.h>
 #include <linux/debugfs.h>
 #include <linux/iopoll.h>
+#include <linux/math64.h>
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
                                           u32 hcomponent)
 {
        u32 frac, lbcc;
+       int bpp;
 
-       lbcc = hcomponent * dsi->lane_mbps * MSEC_PER_SEC / 8;
+       bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
+       if (bpp < 0) {
+               dev_err(dsi->dev, "failed to get bpp\n");
+               return 0;
+       }
+
+       lbcc = div_u64((u64)hcomponent * mode->clock * bpp, dsi->lanes * 8);
 
        frac = lbcc % mode->clock;
        lbcc = lbcc / mode->clock;