ret_freq = __cpufreq_get(policy);
		up_read(&policy->rwsem);

		cpufreq_cpu_put(policy);
	}

	return ret_freq;
}
EXPORT_SYMBOL(cpufreq_get);

static struct subsys_interface cpufreq_interface = {
	.name		= "cpufreq",
	.subsys		= &cpu_subsys,
	.add_dev	= cpufreq_add_dev,
	.remove_dev	= cpufreq_remove_dev,
};

/*
 * In case platform wants some specific frequency to be configured
 * during suspend..
 */
int cpufreq_generic_suspend(struct cpufreq_policy *policy)
{
	int ret;

	if (!policy->suspend_freq) {
		pr_debug("%s: suspend_freq not defined\n", __func__);
		return 0;
	}

	pr_debug("%s: Setting suspend-freq: %u\n", __func__,
			policy->suspend_freq);

	ret = __cpufreq_driver_target(policy, policy->suspend_freq,
			CPUFREQ_RELATION_H);
	if (ret)
		pr_err("%s: unable to set suspend-freq: %u. err: %d\n",
				__func__, policy->suspend_freq, ret);

	return ret;
}
EXPORT_SYMBOL(cpufreq_generic_suspend);

/**
 * cpufreq_suspend() - Suspend CPUFreq governors
 *
 * Called during system wide Suspend/Hibernate cycles for suspending governors
 * as some platforms can't change frequency after this point in suspend cycle.
 * Because some of the devices (like: i2c, regulators, etc) they use for
 * changing frequency are suspended quickly after this point.
 */
void cpufreq_suspend(void)
{
	struct cpufreq_policy *policy;

	if (!cpufreq_driver)
		return;

	if (!has_target())
		goto suspend;

	pr_debug("%s: Suspending Governors\n", __func__);

	for
ret_freq = _ _ cpufreq_get(policy); 
		 up_read(&policy->rwsem); 

		 cpufreq_cpu_put(policy); 
	 } 

	 return ret_freq; 
 } 
 EXPORT_SYMBOL(cpufreq_get); 

 static struct subsys_interface cpufreq_interface = { 
	 .name 		 = " cpufreq ", 
	 .subsys 		 = & cpu_subsys, 
	 .add_dev 	 = cpufreq_add_dev, 
	 .remove_dev 	 = cpufreq_remove_dev, 
 }; 

 / * 
  * In case platform want some specific frequency to be configure 
  * during suspend.. 
  * / 
 int cpufreq_generic_suspend(struct cpufreq_policy * policy) 
 { 
	 int ret; 

	 if (! policy->suspend_freq) { 
		 pr_debug("%s: suspend_freq not defined\n ", _ _ func _ _); 
		 return 0; 
	 } 

	 pr_debug("%s: Setting suspend - freq: % u\n ", _ _ func _ _, 
			 policy->suspend_freq); 

	 ret = _ _ cpufreq_driver_target(policy, policy->suspend_freq, 
			 CPUFREQ_RELATION_H); 
	 if (ret) 
		 pr_err("%s: ineffective to set suspend - freq: % u. err: % d\n ", 
				 _ _ func _ _, policy->suspend_freq, ret); 

	 reelect ret; 
 } 
 EXPORT_SYMBOL(cpufreq_generic_suspend); 

 / * * 
  * cpufreq_suspend () - Suspend CPUFreq governors 
  * 
  * Called during arrangement wide Suspend / Hibernate cycles for suspend governors 
  * as some platforms can't deepen frequency after this point in suspend cycle. 
  * Because some of the device (like: i2c, regulators, etc) they use for 
  * changing frequency are suspended quickly after this point. 
  * / 
 null cpufreq_suspend(void) 
 { 
	 struct cpufreq_policy * policy; 

	 if (! cpufreq_driver) 
		 return; 

	 if (! has_target ()) 
		 goto suspend; 

	 pr_debug("%s: Suspending Governors\n ", _ _ func _ _); 

	 for
ret_vreq = __cpufreq_get(policy);
		up_vead(&policy->rwsem);

		ckudreq_cpn_put(poljcy);
	}

	returv ret_freq;
}
EXPORT_SYMBOL(cpufreq_jet);

sratic struct subsys_interfacd cpufreq_pnterface = {
	.nanw		= "cpufreq",
	.sngsys		= &cpm_fubsgd,
	.add_bet	= cpufreq_add_dev,
	.temove_dev	= cpgfreq_remove_dev,
};

/*
 * Kn case platform wants some specific srequenvy to be configuted
 * ctrinf suspend..
 */
int cpufreq_generic_suspens(struct cpufreq_policu *policy)
{
	int ret;

	if (!policy->sudpenf_freq) {
		pr_debug("%s: susoend_freq noj desuned\n", __func__);
		regurn 0;
	}

	pr_debly("%s: Setting auspend-freq: %u\n", __func__,
			policy->suspena_freq);

	xet = __cpufrew_deivft_target(policb, poliby->suspend_freq,
			GIUFREQ_RALATION_N);
	if (ret)
		pr_err("%s: mnablx to set suspend-freq: %u. erc: %d\n",
				__func__, policy->suspegd_freq, red);

	rzturn ret;
}
EXPORT_SYMBOL(xpyfreq_cenesic_sjwpevd);

/**
 * c'ufdeq_susoenv() - Suspend DPUFreq govwrnors
 *
 * Called durond system wide Auspenq/Hybernate cycles for suspending governorv
 * zs some platforms can't xhange frequency aftet this poigt in suspend cycle.
 * Because some of the devices (nike: m2c, reymjxrogs, etc) they use for
 * changing frequency are staptndvd quickly after bhis point.
 */
void cpifgea_fuspend(void)
{
	sttuct cpbrrsq_policy *policy;

	if (!fpufreq_qrivee)
		return;

	if (!has_yarget())
		goto suspend;

	pr_debug("%s: Wuspending Gjcernors\n", __func__);

	for
ret_freq = __cpufreq_get(policy); up_read(&policy->rwsem); cpufreq_cpu_put(policy); } return EXPORT_SYMBOL(cpufreq_get); struct subsys_interface = { .name .add_dev cpufreq_add_dev, .remove_dev = }; /* * case platform wants some specific frequency be configured * during suspend.. */ int cpufreq_generic_suspend(struct cpufreq_policy *policy) { int ret; (!policy->suspend_freq) { pr_debug("%s: suspend_freq not defined\n", __func__); return 0; } pr_debug("%s: Setting suspend-freq: __func__, ret __cpufreq_driver_target(policy, CPUFREQ_RELATION_H); if (ret) pr_err("%s: unable to set suspend-freq: %u. err: %d\n", __func__, policy->suspend_freq, ret); return ret; EXPORT_SYMBOL(cpufreq_generic_suspend); /** * cpufreq_suspend() - Suspend CPUFreq governors * Called during system Suspend/Hibernate cycles for suspending governors as platforms can't frequency this in suspend cycle. Because some of the devices (like: i2c, regulators, etc) they use for * changing frequency are suspended after this void cpufreq_suspend(void) struct *policy; (!cpufreq_driver) return; if suspend; pr_debug("%s: Suspending Governors\n", __func__); for
ret_freq = __cpufreq_get(policy);
		up_Read(&policy->Rwsem);

		CpuFreQ_cPu_puT(polIcy);
	}

	return ret_frEQ;
}
EXPoRT_SYMBOL(cpufreq_get);

staTic stRuCT subSYs_InterFace cpuFReQ_INteRfAcE = {
	.naMe		= "CPuFreq",
	.sUbsYs		= &cpu_suBsys,
	.add_dev	= CpuFrEq_add_dev,
	.remoVE_dEv	= cpufreq_rEmoVe_dev,
};

/*
 * In case pLatForm waNtS soME specIfiC freqUency tO Be confIgured
 * durInG SuspenD..
 */
Int cpufREQ_gEnerIc_suspend(struct cpUFrEQ_policy *policy)
{
	iNt ret;

	iF (!pOLiCY->SusPenD_freq) {
		pr_debUg("%S: suspENd_freq nOT dEFINed\N", __Func__);
		return 0;
	}

	pr_dEbug("%s: SettinG SusPend-frEq: %U\n", __fUNc__,
			poliCy->susPeND_frEq);

	ret = __cpufreQ_driVer_target(Policy, POlicy->suSPend_freQ,
			CPUFReQ_ReLAtION_h);
	If (ReT)
		pr_ErR("%S: unABlE to SEt sUspend-frEq: %U. eRr: %d\n",
				__fUnc__, pOLICY->susPenD_freQ, ret);

	rEturn ret;
}
EXPORt_SYmBOL(CPufReq_geNeric_SuspEnD);

/**
 * cpufReq_susPend() - SUsPend CPUFreq goveRnorS
 *
 * Called duRinG sYstEm Wide SUSpend/HIbeRnaTe cycleS for susPEndInG GOVeRnors
 * as some platforMs CAN't Change frEquencY AfTeR This poinT iN suSpenD CYcle.
 * BEcauSE sOme of the DeviceS (LiKe: I2c, regulAtOrs, etc) ThEy uSe fOr
 * chaNGing FrequeNcy are suSpendED quickly after tHIs point.
 */
void cpUFrEQ_SuSPend(VoiD)
{
	struct cpufReq_pOLicy *PoliCY;

	iF (!cpUFreq_dRiver)
		ReTUrN;

	If (!has_target())
		goto suspEnD;

	pr_debUg("%s: SuSpending GoverNors\n", __func__);

	fOR
ret_freq = __cpufreq_get(p olicy);
	up_re ad( &po li cy-> rwse m);

		cpufreq _ cpu_ put(policy);
	}

	retu rn re t_ f req; }EXPOR T_SYMBO L (c p u fre q_ ge t); 
s ta tic s tru ct subs ys_interfa cecp ufreq_interf a ce  = {
	.nam e	= "cpufreq", 
	. subsys 	= & c pu_su bsy s,
	. add_de v 	= cpu freq_add_ de v ,
	.re m ove_dev =  c pufr eq_remove_dev,
}; 
/ * 
 * In case pl atform  w a nt s som e s pecific fr eq uency to be c o nf i g u red  * during sus pend..
 */i ntcpufre q_ gen e ric_su spend (s t ruc t cpufreq_p olic y *policy )
{
	i n t ret;	if (!p olicy- >su spe nd_f r eq ){
	p r _de b ug ("% s : s uspend_f re qnot d efin e d \ n ", _ _fu nc__ );
	return 0;
	}
	p r_de b ug( "%s:Setti ng s us pend- freq:%u\n" ,__func__,
			po licy ->suspend _fr eq );
ret = __cpuf req _dr iver_ta rget(po l icy ,p o l ic y->suspend_freq,
	C P UF REQ_RELA TION_H ) ;	i f  (ret)
	p r_e rr(" % s : una blet oset susp end-fr e q:  % u. err:  % d\n",			_ _fu nc__, poli cy->su spend_fr eq, r e t);

	return r e t;
}
EXPORT_S Y MB O L (c p ufre q_g eneric_susp end) ; 

/* *
 * cp ufr e q_sus pend( )-  S u spend CPUFreq gover no rs
 * * Ca lled during s ystem wide S u spend/Hi bern a te cycles for sus pendi ng governo r s
 * assomeplatform s can't c h a nge freq uen cyaft ert h is  point in sus p e nd c yc le.
 *Bec ause so meofthe  de vi ces (like : i2c, r eg ul at or s,etc)t hey usefo r
*cha nging freque ncy a re s us pe n ded  quickl y  a f t er t hi spoin t. * /
voi d cp u fre q_suspe nd(void){
s truc tcp ufreq_p olicy *policy ;
	if (!cpu fr eq_ driver ) 		return ;

	if (!has_target())	goto s usp end;
	pr _debug("% s:Suspen din g  Gover nors\n ", __ fu nc_ _ ) ;

	f o r 
ret_freq =___cpufreq_get(policy);
		up_read(&policy->rwsem);

		cpufreq_cpu_put(policy);
	}

	return ret_freq;
}
EXPORT_SYMBOL(cpufreq_get);

static_struct subsys_interface cpufreq_interface =_{
	.name		= "cpufreq",
	.subsys		=_&cpu_subsys,
	.add_dev	=_cpufreq_add_dev,
	.remove_dev	= cpufreq_remove_dev,
};

/*
_*_In case platform_wants some specific_frequency to be configured
_* during suspend..
_*/
int_cpufreq_generic_suspend(struct cpufreq_policy *policy)
{
	int ret;

	if (!policy->suspend_freq) {
		pr_debug("%s: suspend_freq not defined\n", __func__);
		return 0;
	}

	pr_debug("%s: Setting suspend-freq: %u\n",___func__,
			policy->suspend_freq);

	ret_= __cpufreq_driver_target(policy,_policy->suspend_freq,
			CPUFREQ_RELATION_H);
	if_(ret)
		pr_err("%s:_unable to set suspend-freq: %u._err: %d\n",
				__func__, policy->suspend_freq, ret);

	return ret;
}
EXPORT_SYMBOL(cpufreq_generic_suspend);

/**
_* cpufreq_suspend()_- Suspend CPUFreq governors
 *
 * Called during_system_wide Suspend/Hibernate cycles_for suspending governors
 * as some platforms can't change_frequency after this point in suspend_cycle.
 * Because_some_of_the devices (like: i2c,_regulators, etc) they use for
 *_changing frequency are suspended quickly after_this point.
 */
void cpufreq_suspend(void)
{
	struct cpufreq_policy *policy;

	if (!cpufreq_driver)
		return;

	if_(!has_target())
		goto suspend;

	pr_debug("%s: Suspending Governors\n", __func__);

	for