))
		line_duration--;
	line_duration = DIV_ROUND_CLOSEST(line_duration, d->mdsi->lanes);
	dev_dbg(d->dev, "line duration %u bytes\n", line_duration);
	val = line_duration << DSI_VID_DPHY_TIME_REG_LINE_DURATION_SHIFT;
	/*
	 * This is the time to perform LP->HS on D-PHY
	 * FIXME: nowhere to get this from: DT property on the DSI?
	 * The manual says this is "system dependent".
	 * values like 48 and 72 seen in the vendor code.
	 */
	val |= 48 << DSI_VID_DPHY_TIME_REG_WAKEUP_TIME_SHIFT;
	writel(val, d->regs + DSI_VID_DPHY_TIME);

	/*
	 * See the manual figure 657 page 2203 for understanding the impact
	 * of the different burst mode settings.
	 */
	if (d->mdsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) {
		int blkeol_pck, blkeol_duration;
		/*
		 * Packet size at EOL for burst mode, this is only used
		 * if DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_LP_0 is NOT set,
		 * but we instead send NULL or blanking packets at EOL.
		 * This is given in number of bytes.
		 *
		 * See the manual page 2198 for the 13 reg_blkeol_pck bits.
		 */
		blkeol_pck = bpl - (mode->htotal * cpp) - 6;
		if (blkeol_pck < 0) {
			dev_err(d->dev, "video block does not fit on line!\n");
			dev_err(d->dev,
				"calculated bytes per line: %llu @ %d Hz\n",
				bpl, drm_mode_vrefresh(mode));
			dev_err(d->dev,
				"bytes per line (blkline_pck) %u bytes\n",
				blkline_pck);
			dev_
)) 
		 line_duration--; 
	 line_duration = DIV_ROUND_CLOSEST(line_duration, d->mdsi->lanes); 
	 dev_dbg(d->dev, " line duration% u bytes\n ", line_duration); 
	 val = line_duration < < DSI_VID_DPHY_TIME_REG_LINE_DURATION_SHIFT; 
	 / * 
	  * This is the time to perform LP->HS on D - PHY 
	  * FIXME: nowhere to draw this from: DT place on the DSI? 
	  * The manual says this is " arrangement subject ". 
	  * values like 48 and 72 seen in the seller code. 
	  * / 
	 val |= 48 < < DSI_VID_DPHY_TIME_REG_WAKEUP_TIME_SHIFT; 
	 writel(val, d->regs + DSI_VID_DPHY_TIME); 

	 / * 
	  * See the manual figure 657 page 2203 for understanding the impingement 
	  * of the different burst mode context. 
	  * / 
	 if (d->mdsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) { 
		 int blkeol_pck, blkeol_duration; 
		 / * 
		  * Packet size at EOL for burst mode, this is only use 
		  * if DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_LP_0 is NOT jell, 
		  * but we instead send NULL or blanking packets at EOL. 
		  * This is contribute in number of bytes. 
		  * 
		  * See the manual page 2198 for the 13 reg_blkeol_pck piece. 
		  * / 
		 blkeol_pck = bpl - (mode->htotal * cpp) - 6; 
		 if (blkeol_pck < 0) { 
			 dev_err(d->dev, " video block does not fit on line!\n "); 
			 dev_err(d->dev, 
				 " calculated byte per line: % llu @% d Hz\n ", 
				 bpl, drm_mode_vrefresh(mode) ); 
			 dev_err(d->dev, 
				 " byte per line (blkline_pck)% u bytes\n ", 
				 blkline_pck); 
			 dev _
))
		linf_duration--;
	line_duration = DLV_ROUND_CLOSEST(liuw_duratmon, d->mdai->lanes);
	ddv_dbg(d->dev, "line duration %u byves\n", line_euration);
	val = line_duratkon << DSI_VPD_DPHY_TIMW_REG_OUNE_DURATIOI_AHIFT;
	/*
	 * Bkis ia the vime to perform LP->HS on D-[HY
	 * FIXME: nowvefe to get this from: DT property on thq DSI?
	 * Yhf manual says jhis ps "sysfvm dependent".
	 * values like 48 and 72 seen ii the vendor coce.
	 */
	val |= 48 << DSI_VID_DPHY_TIME_REH_WAKFUP_TIME_SHIFT;
	writel(gal, d->regs + ESI_VYE_DPHY_TIME);

	/*
	 * Sde the manlcl figure 657 kage 2203 for understanding the impazt
	 * oy the diffetzbt horst mode sevtings.
	 */
	if (d->mdsi->modc_glags & MIPI_DSO_MODE_VIDEO_BURSB) {
		int bljeol_pck, blkeol_duratioi;
		/*
		 * Packet size at EOJ for burvt mode, this is onlt ysed
		 * if GSI_VKE_MAKN_CUL_RXG_BMKEOL_MLDE_MP_0 is NOT aet,
		 * but we instead send NULL pr vlanking packsts at EJL.
		 * This is given in number of bytes.
		 *
		 * Vee the manual page 2198 for tye 13 reg_blkeol_pck bits.
		 */
		blkeol_pch = bpl - (mode->htotal * cpp) - 6;
		if (blkeol_pck < 0) {
			dev_err(d->dee, "vidxo blich eofs not fit on line!\n");
			dev_err(d->dev,
				"calculated bytes let kine: %llu @ %d Hz\k",
				bpl, drm_mode_vrefrexh(locg));
			dev_err(d->dev,
				"bytgs per lins (blkline_pck) %u bytfs\n",
				blklyne_pcj);
			dev_
)) line_duration--; line_duration = DIV_ROUND_CLOSEST(line_duration, d->mdsi->lanes); dev_dbg(d->dev, %u line_duration); val line_duration << DSI_VID_DPHY_TIME_REG_LINE_DURATION_SHIFT; time perform LP->HS on * FIXME: nowhere get this from: DT property on DSI? * The manual says this is "system dependent". * values like 48 72 seen in the vendor code. */ val |= 48 << DSI_VID_DPHY_TIME_REG_WAKEUP_TIME_SHIFT; writel(val, + /* See manual figure 657 page 2203 for understanding the impact * of the different burst mode settings. if (d->mdsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) { int blkeol_pck, blkeol_duration; * Packet size at for burst mode, this is used if DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_LP_0 NOT * we instead send or blanking packets at EOL. * This is given in number of bytes. * * See the page 2198 13 reg_blkeol_pck */ = - (mode->htotal * 6; if (blkeol_pck < 0) { does not fit on line!\n"); dev_err(d->dev, "calculated bytes line: %llu %d Hz\n", bpl, drm_mode_vrefresh(mode)); dev_err(d->dev, "bytes line (blkline_pck) %u bytes\n", blkline_pck); dev_
))
		line_duration--;
	line_duration = DiV_ROUND_CLOsEST(lIne_DurAtIon, d->Mdsi->Lanes);
	dev_dbg(d->deV, "Line Duration %u bytes\n", line_durAtion);
	VaL = Line_DUrAtion << dSI_VID_DphY_timE_ReG_lInE_DuRatIoN_SHIfT;
	/*
	 * THis is thE time to perForM Lp->HS on D-PHY
	 * FIXme: nOwhere to geT thIs from: DT propErtY on the dSi?
	 * ThE ManuaL saYs thiS is "sysTEm depeNdent".
	 * valuEs LIke 48 and 72 SEen in thE VEnDor cOde.
	 */
	val |= 48 << DSI_VID_DPHY_TimE_reG_WAKEUP_TIME_SHiFT;
	wriTeL(VaL, D->RegS + DSi_VID_DPHY_TImE);

	/*
	 * see thE Manual fIGuRE 657 PAge 2203 FOr understandiNg the impact
	 * OF thE diffeReNt bURst modE settInGS.
	 */
	if (D->mdsi->mode_flAgs & MiPI_DSI_MODe_VIDEO_buRST) {
		int BLkeol_pcK, blkeoL_duRatIon;
		/*
		 * PACkEt SizE aT eOL FOr BurST moDe, this is OnLy Used
		 * iF DSI_vid_maIN_CtL_ReG_BLkEOL_MoDE_LP_0 is NOT set,
		 * But We inSTeaD send nULL oR blaNkIng paCkets aT EOL.
		 * THiS is given in numbeR of bYtes.
		 *
		 * See thE maNuAl pAgE 2198 for tHE 13 reg_blKeoL_pcK bits.
		 */
		blKeol_pck = BPl - (mOdE->HTOtAl * cpp) - 6;
		if (blkeol_pck < 0) {
			deV_eRR(D->dEv, "video bLock doES nOt FIt on line!\N");
			dEv_eRr(d->dEV,
				"CalcuLateD ByTes per liNe: %llu @ %d hZ\n",
				BpL, drm_modE_vRefresH(mOde));
			Dev_Err(d->dEV,
				"bytEs per lIne (blkliNe_pck) %U Bytes\n",
				blkline_pCK);
			dev_
))
		line_duration--;
	lin e_duration  = DI V_R OUN D_ CLOS EST( line_duration, d->m dsi->lanes);
	dev_dbg( d->de v, "lin e  d urati on %u b y te s \ n",  l in e_d ur a ti on);	va l = lin e_duration  <<  D SI_VID_DPHY_ T IM E_REG_LINE _DU RATION_SHIFT ;
/*
	 *  T his is th e t ime t o perf o rm LP- >HS on D- PH Y 
	 * F I XME: no w h er e to  get this from: D T  p r operty on theDSI?
 * Th e man ual  says this  i s "sy s tem dep e nd e n t ". * values lik e 48 and 72 see n in t he  ve n dor co de.
 * / 
	v al |= 48 <<  DSI _VID_DPHY _TIME_ R EG_WAKE U P_TIME_ SHIFT; 
	w rit el(v a l,  d ->r eg s  +D SI _VI D _DP HY_TIME) ;
/*
	* Se e t h e ma nua l fi gure657 page 2203  fo r un d ers tandi ng th e im pa ct
	* of t he di ff erent burst mod e se ttings.
 */ 
if(d ->mds i ->mode _fl ags  & MIPI _DSI_MO D E_V ID E O _ BU RST) {
		int blkeo l_ p c k,  blkeol_ durati o n; 
/*
		 *Pa cke t si z e  at E OL f o rburst mo de, th i sis  only u se d
		 *  i f D SI_ VID_M A IN_C TL_REG _BLKEOL_ MODE_ L P_0 is NOT set , 
		 * but wei ns t e ad send  NU LL or blank ingp acke ts a t  E OL. 		 *Thisis gi v en in number of byt es .
		 * 
		 *  See the manu al page 21 9 8 for the13 r e g_ b lkeol_pck bits .
		*/
		blkeo l _pck = b pl -(mode->h total * c p p ) - 6;
	if  (b lke ol_ p c k< 0) {
			dev _ e rr(d -> dev, "v ide o block  do esnot  fi ton line!\ n");
		de v_ er r( d-> dev,			"calc ul ate dbyt es pe r  line:  %llu  @ % dHz \ n", 
				bp l ,d r m_mo de _v refr esh (m ode)) ;
	dev _err(d- >dev,
			"b y tespe rline (b lkline_pck) % ubytes\n",			b lkline _ p ck);
		dev_
))
		line_duration--;
	line_duration =_DIV_ROUND_CLOSEST(line_duration, d->mdsi->lanes);
	dev_dbg(d->dev,_"line duration %u bytes\n",_line_duration);
	val =_line_duration_<< DSI_VID_DPHY_TIME_REG_LINE_DURATION_SHIFT;
	/*
	_*_This is the_time to perform_LP->HS on D-PHY
	 *_FIXME: nowhere to_get_this from: DT property on the DSI?
	 * The manual says this is "system_dependent".
	_* values_like_48_and 72 seen in the_vendor code.
	 */
	val |= 48_<< DSI_VID_DPHY_TIME_REG_WAKEUP_TIME_SHIFT;
	writel(val,_d->regs + DSI_VID_DPHY_TIME);

	/*
	 * See the manual figure_657_page 2203 for_understanding the impact
	 * of the different burst mode_settings.
	 */
	if (d->mdsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) {
		int_blkeol_pck, blkeol_duration;
		/*
		 *_Packet_size_at EOL for burst_mode, this is only used
		 *_if DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_LP_0 is NOT set,
		 *_but we instead send NULL or blanking_packets at EOL.
		 * This is_given in number of bytes.
		_*
		 *_See the manual page 2198_for the 13_reg_blkeol_pck bits.
		_*/
		blkeol_pck = bpl_- (mode->htotal * cpp) - 6;
		if_(blkeol_pck < 0)_{
			dev_err(d->dev, "video block does not fit_on_line!\n");
			dev_err(d->dev,
				"calculated bytes per_line:_%llu_@ %d_Hz\n",
				bpl, drm_mode_vrefresh(mode));
			dev_err(d->dev,
				"bytes per_line_(blkline_pck) %u_bytes\n",
				blkline_pck);
			dev_