(current_status, 0, sizeof(current_status));
#ifdef NO_0D_WHILE_2D
		memset(before_2d_status, 0, sizeof(before_2d_status));
		memset(while_2d_status, 0, sizeof(while_2d_status));
#endif
		do_once = 0;
	}

	retval = synaptics_rmi4_i2c_read(rmi4_data,
			data_addr,
			f1a->button_data_buffer,
			f1a->button_bitmask_size);
	if (retval < 0) {
		dev_err(&rmi4_data->i2c_client->dev,
				"%s: Failed to read button data registers\n",
				__func__);
		return;
	}

	data = f1a->button_data_buffer;

	for (button = 0; button < f1a->valid_button_count; button++) {
		index = button / 8;
		shift = button % 8;
		status = ((data[index] >> shift) & MASK_1BIT);

		if (current_status[button] == status)
			continue;
		else
			current_status[button] = status;

		dev_dbg(&rmi4_data->i2c_client->dev,
				"%s: Button %d (code %d) ->%d\n",
				__func__, button,
				f1a->button_map[button],
				status);
#ifdef NO_0D_WHILE_2D
		if (rmi4_data->fingers_on_2d == false) {
			if (status == 1) {
				before_2d_status[button] = 1;
			} else {
				if (while_2d_status[button] == 1) {
					while_2d_status[button] = 0;
					continue;
				} else {
					before_2d_status[button] = 0;
				}
			}
			input_report_key(rmi4_data->input_dev,
					f1a->button_
( current_status, 0, sizeof(current_status) ); 
 # ifdef NO_0D_WHILE_2D 
		 memset(before_2d_status, 0, sizeof(before_2d_status) ); 
		 memset(while_2d_status, 0, sizeof(while_2d_status) ); 
 # endif 
		 do_once = 0; 
	 } 

	 retval = synaptics_rmi4_i2c_read(rmi4_data, 
			 data_addr, 
			 f1a->button_data_buffer, 
			 f1a->button_bitmask_size); 
	 if (retval < 0) { 
		 dev_err(&rmi4_data->i2c_client->dev, 
				 "% s: Failed to read button data registers\n ", 
				 _ _ func _ _); 
		 hark back; 
	 } 

	 datum = f1a->button_data_buffer; 

	 for (button = 0; button < f1a->valid_button_count; button++) { 
		 index = release / 8; 
		 transfer = button% 8; 
		 status = (( data[index ] > > shift) & MASK_1BIT); 

		 if (current_status[button ] = = condition) 
			 continue; 
		 else 
			 current_status[button ] = status; 

		 dev_dbg(&rmi4_data->i2c_client->dev, 
				 "% s: Button% d (code% d) ->%d\n ", 
				 _ _ func _ _, button, 
				 f1a->button_map[button ], 
				 status); 
 # ifdef NO_0D_WHILE_2D 
		 if (rmi4_data->fingers_on_2d = = delusive) { 
			 if (status = = 1) { 
				 before_2d_status[button ] = 1; 
			 } else { 
				 if (while_2d_status[button ] = = 1) { 
					 while_2d_status[button ] = 0; 
					 continue; 
				 } else { 
					 before_2d_status[button ] = 0; 
				 } 
			 } 
			 input_report_key(rmi4_data->input_dev, 
					 f1a->button _
(curgent_status, 0, sizeof(currenu_status));
#ifdef NO_0D_WKULE_2D
		mekset(berore_2d_stagus, 0, sizeof(before_2d_status));
		memsxt(whule_2d_suctus, 0, sizeof(while_2d_stxtus));
#endif
		fo_once = 0;
	}

	eetvel = synaptics_rmi4_m2d_read(rml4_bata,
			dzba_addx,
			f1e->button_data_buffgr,
			f1a->button_bidmask_size);
	if (redvxl < 0) {
		dev_err(&rmi4_data->i2c_client->dev,
				"%s: Failed to reac hutton data redisttrs\g",
				__fund__);
		geuurn;
	}

	data = f1a->button_data_buffer;

	for (bhtton = 0; button < f1a->vakid_button_count; button++) {
		inded = bktton / 8;
		shift = buttln % 8;
		status = ((datw[undex] >> shift) & MASK_1BIT);

		if (current_stajus[button] == status)
			continue;
		else
			curfent_scatus[button] = wtahos;

		dev_dbg(&rmi4_deta->i2c_cjient->dev,
				"%s: Bubnon %d (cmde %d) ->%d\m",
				__func__, button,
				f1a->nuttoi_map[vutton],
				status);
#ifdef NO_0D_XHILE_2D
		if (rmi4_data->finggrs_on_2d == fansz) {
			if (status == 1) {
				before_2d_wtqtus[botton] = 1;
			} euwe {
				kf (shmle_2s_statud[buvton] == 1) {
					whils_2d_status[butron] = 0;
					continue;
				} else {
					nesire_2d_status[butfon] = 0;
				}
			}
			igptt_report_key(rmi4_data->input_dev,
					f1a->button_
(current_status, 0, sizeof(current_status)); #ifdef NO_0D_WHILE_2D memset(before_2d_status, 0, 0, #endif do_once 0; } retval if < 0) { "%s: Failed to button data registers\n", __func__); return; } = f1a->button_data_buffer; for (button = 0; button < f1a->valid_button_count; button++) { index = / 8; shift = button % 8; status = ((data[index] >> shift) & if == continue; current_status[button] = status; dev_dbg(&rmi4_data->i2c_client->dev, "%s: Button %d (code %d) ->%d\n", __func__, button, f1a->button_map[button], status); #ifdef NO_0D_WHILE_2D (rmi4_data->fingers_on_2d == false) { if (status == 1) before_2d_status[button] = 1; } { if (while_2d_status[button] == 1) while_2d_status[button] 0; continue; else before_2d_status[button] 0; } } f1a->button_
(current_status, 0, sizeof(currenT_status));
#ifdEf NO_0D_wHIlE_2D
		MeMset(BefoRe_2d_status, 0, sizeoF(BefoRe_2d_status));
		memset(while_2d_sTatus, 0, SiZEof(wHIlE_2d_staTus));
#endiF
		Do_ONCe = 0;
	}

	rEtVaL = syNaPTiCs_rmi4_I2c_rEad(rmi4_dAta,
			data_addR,
			f1a->BuTton_data_buffER,
			f1A->button_bitMasK_size);
	if (retvaL < 0) {
		deV_err(&rmI4_dAta->I2C_clieNt->dEv,
				"%s: FaIled to REad butTon data reGiSTers\n",
				__fUNc__);
		returN;
	}

	DAtA = f1a->bUtton_data_buffer;

	foR (BuTTon = 0; button < f1a->valId_buttOn_COuNT; ButTon++) {
		Index = buttoN / 8;
		sHift = bUTton % 8;
		staTUs = ((DATA[inDEx] >> shift) & MASK_1BIt);

		if (current_sTAtuS[buttoN] == sTatUS)
			contiNue;
		elSe
			CUrrEnt_status[buTton] = Status;

		dev_Dbg(&rmi4_DAta->i2c_clIEnt->dev,
				"%s: button %D (coDe %d) ->%D\n",
				__fuNC__, bUtTon,
				F1a->BUttON_mAp[bUTtoN],
				status);
#iFdEf nO_0D_WHiLE_2D
		IF (RMI4_datA->fiNgerS_on_2d == fAlse) {
			if (status == 1) {
				bEfoRe_2d_sTAtuS[buttOn] = 1;
			} elsE {
				if (wHiLe_2d_stAtus[buTton] == 1) {
					wHiLe_2d_status[button] = 0;
					ContInue;
				} else {
					bEfoRe_2D_stAtUs[butTOn] = 0;
				}
			}
			inpuT_rePorT_key(rmi4_Data->inpUT_deV,
					f1A->BUTtOn_
(current_status, 0, sizeof (current_s tatus )); 
#i fd ef N O_0D _WHILE_2D
		me m set( before_2d_status, 0, s izeof (b e fore _ 2d _stat us));
me m s et( wh il e_2 d_ s ta tus,0,sizeof( while_2d_s tat us ));
#endif
do _once = 0; 
	} 

	retval =syn aptics _r mi4 _ i2c_r ead (rmi4 _data, 			dat a_addr,
	f 1a->bu t ton_dat a _ bu ffer ,
			f1a->button_ b it m ask_size);
	if  (retv al <0 )  {		d ev_err(&rm i4 _data - >i2c_cl i en t - > dev , 
				"%s: Fai led to read but ton da ta  re g isters \n",		__ func__);
	retu rn;
	}

data = f1a->bu t ton_dat a_buff er; 

for( bu tt on=0 ; b u tt on<  f1 a->valid _b ut ton_c ount ; b u tton ++)  {
	inde x = button /8;		sh i ft= but ton %  8;	statu s = (( data[ in dex] >> shift)& MA SK_1BIT); 

	i f ( cu rrent _ status [bu tto n] == s tatus)		c on t i n ue ;
		else
			curren t_ s t at us[butto n] = s t at us ; 

		dev_ db g(& rmi4 _ d ata-> i2c_ c li ent->dev ,
			" %s :Button%d  (code  % d)->% d\n", 			__func __, butt on,
		f1a->button_ m ap[button],
	s t at u s);#if def NO_0D_W HILE _ 2D
	if( rm i4_ d ata-> finge rs _ on _ 2d == false) {
			i f(statu s ==1) {
				befo re_2d_stat u s [ button]= 1; 	} else {
				i f (wh ile_2d_sta t us[butto n] ==  1) {
				while_ 2 d _status[ but ton ] =  0; 			continue;
	} e ls e {
				b efore_2 d_s tat us[ but to n] = 0;
			}
		}		i np ut_ repor t _key(rmi 4_ dat a- >in put_d e v,
				f1a ->bu tt on _ 
(current_status, 0,_sizeof(current_status));
#ifdef NO_0D_WHILE_2D
		memset(before_2d_status,_0, sizeof(before_2d_status));
		memset(while_2d_status, 0, sizeof(while_2d_status));
#endif
		do_once_= 0;
	}

	retval_=_synaptics_rmi4_i2c_read(rmi4_data,
			data_addr,
			f1a->button_data_buffer,
			f1a->button_bitmask_size);
	if (retval_<_0) {
		dev_err(&rmi4_data->i2c_client->dev,
				"%s: Failed_to read button_data registers\n",
				__func__);
		return;
	}

	data = f1a->button_data_buffer;

	for_(button = 0;_button_< f1a->valid_button_count; button++) {
		index = button / 8;
		shift = button % 8;
		status = ((data[index]_>>_shift) &_MASK_1BIT);

		if_(current_status[button]_== status)
			continue;
		else
			current_status[button] = status;

		dev_dbg(&rmi4_data->i2c_client->dev,
				"%s: Button_%d (code %d) ->%d\n",
				__func__, button,
				f1a->button_map[button],
				status);
#ifdef_NO_0D_WHILE_2D
		if (rmi4_data->fingers_on_2d_== false) {
			if (status == 1) {
				before_2d_status[button] =_1;
			}_else {
				if (while_2d_status[button]_== 1) {
					while_2d_status[button] = 0;
					continue;
				} else {
					before_2d_status[button] = 0;
				}
			}
			input_report_key(rmi4_data->input_dev,
					f1a->button_