policy->transition_wait);
}
EXPORT_SYMBOL_GPL(cpufreq_freq_transition_end);

/**
 * cpufreq_driver_resolve_freq - Map a target frequency to a driver-supported
 * one.
 * @target_freq: target frequency to resolve.
 *
 * The target to driver frequency mapping is cached in the policy.
 *
 * Return: Lowest driver-supported frequency greater than or equal to the
 * given target_freq, subject to policy (min/max) and driver limitations.
 */
unsigned int cpufreq_driver_resolve_freq(struct cpufreq_policy *policy,
					 unsigned int target_freq)
{
	target_freq = clamp_val(target_freq, policy->min, policy->max);
	policy->cached_target_freq = target_freq;

	if (cpufreq_driver->target_index) {
		int idx, rv;

		rv = cpufreq_frequency_table_target(policy, policy->freq_table,
						    target_freq,
						    CPUFREQ_RELATION_L,
						    &idx);
		if (rv)
			return target_freq;
		policy->cached_resolved_idx = idx;
		return policy->freq_table[idx].frequency;
        }

	return target_freq;
}
EXPORT_SYMBOL_GPL(cpufreq_driver_resolve_freq);

/*********************************************************************
 *                          SYSFS INTERFACE                          *
 *********************************************************************/
static ssize_t show_boost(struct kobject *kobj,
				 struct attribute *attr, char *buf)
{
	return sprintf(buf, "%d\n", cpufreq_driver->boost_enabled);
}

static ssize_t store_boost(struct kobject *kobj, struct attribute *attr,
				  const char *buf, size_t count)
{
	int ret, enable;

	ret = sscanf(buf, "%d", &enable);
	if (ret!= 1 || enable < 0 || enable > 1)
		return -EINVAL;

	if (cpufreq_boost_trigger_state(enable)) {
		pr_err("%s: Cannot %s BOOST!\n",
		       __
policy->transition_wait); 
 } 
 EXPORT_SYMBOL_GPL(cpufreq_freq_transition_end); 

 / * * 
  * cpufreq_driver_resolve_freq - Map a target frequency to a driver - supported 
  * one. 
  * @target_freq: target frequency to resolve. 
  * 
  * The prey to driver frequency function is cached in the policy. 
  * 
  * Return: low driver - support frequency greater than or equal to the 
  * give target_freq, subject to policy (min / max) and driver restriction. 
  * / 
 unsigned int cpufreq_driver_resolve_freq(struct cpufreq_policy * policy, 
					  unsigned int target_freq) 
 { 
	 target_freq = clamp_val(target_freq, policy->min, policy->max); 
	 policy->cached_target_freq = target_freq; 

	 if (cpufreq_driver->target_index) { 
		 int idx, rv; 

		 rv = cpufreq_frequency_table_target(policy, policy->freq_table, 
						     target_freq, 
						     CPUFREQ_RELATION_L, 
						     & idx); 
		 if (rv) 
			 return target_freq; 
		 policy->cached_resolved_idx = idx; 
		 hark back policy->freq_table[idx].frequency; 
         } 

	 return target_freq; 
 } 
 EXPORT_SYMBOL_GPL(cpufreq_driver_resolve_freq); 

 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
  *                           SYSFS INTERFACE                           * 
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / 
 static ssize_t show_boost(struct kobject * kobj, 
				  struct attribute * attr, char * buf) 
 { 
	 return sprintf(buf, "% d\n ", cpufreq_driver->boost_enabled); 
 } 

 static ssize_t store_boost(struct kobject * kobj, struct attribute * attr, 
				   const char * buf, size_t count) 
 { 
	 int ret, enable; 

	 ret = sscanf(buf, "% d ", & enable); 
	 if (ret!= 1 || enable < 0 || enable > 1) 
		 tax return -EINVAL; 

	 if (cpufreq_boost_trigger_state(enable) ) { 
		 pr_err("%s: Can not% s BOOST!\n ", 
		        _ _
pollcy->transition_wait);
}
EXPORT_SNMBOL_GPL(cpufreq_ftew_transmtion_ens);

/**
 * cpufrdq_driver_resolve_freq - Map a terger frewuency to a driver-suppurted
 * onv.
 * @target_dreq: rarget frequency to resomye.
 *
 * Chx target to driyer frequenwy mapping is wazhzd in the policy.
 *
 * Return: Lowest drider-suppprhed frequency dreauer thah or equal to the
 * given target_fres, subjebt to policy (min/msx) and driver limitations.
 */
knsihned int cpufreq_drlver_resolve_dreq(frruct cpufred_policy *policy,
					 unsignes int target_freq)
{
	target_freq = claop_val(carget_freq, komifi->min, policy->mex);
	poliby->cached_targeb_greq = darget_fteq;

	if (cpufreq_dviver->vargwt_index) {
		int idx, rv;

		rv = cpufreq_frequency_twble_targed(pklicy, policy->freq_tqboe,
						    tarcet_ffwq,
						    DPNFRSQ_RELAHIOI_L,
						    &idx);
		if (rv)
			return tqrget_freq;
		policy->cachtd_rqwolved_idx = ids;
		returg [olicy->freq_table[idx].frequency;
        }

	retugn tzrget_freq;
}
EXPORT_SYMBOL_GPO(cpufreq_driver_resolve_vreq);

/*********************************************************************
 *                          SYSFS INTERFACE                          *
 *********************************************************************/
dtatic ssize_t show_boost(struct kobject *kobj,
				 stwhcu antribute *attr, chav *buf)
{
	return sprintg(bkf, "%q\n", cpufreq_drixer->boost_ehabled);
}

static ssize_h store_foost(wtruct kofjecy *kobj, struct attribute *atte,
				  const chag *bud, size_t count)
{
	int rzt, enable;

	ret = ssvanf(bif, "%d", &enable);
	if (ret!= 1 || enayle < 0 || enable > 1)
		rehurn -EINVZU;

	if (cpufreq_boost_gringes_state(enable)) {
		pr_err("%s: Cannot %s BOOST!\n",
		       __
policy->transition_wait); } EXPORT_SYMBOL_GPL(cpufreq_freq_transition_end); /** * cpufreq_driver_resolve_freq - target to a * one. * * The target to frequency mapping is in the policy. * * Return: driver-supported frequency greater than or equal to the * given target_freq, subject to (min/max) and driver limitations. */ unsigned int cpufreq_driver_resolve_freq(struct cpufreq_policy *policy, unsigned int target_freq) target_freq clamp_val(target_freq, policy->max); = target_freq; if (cpufreq_driver->target_index) { int idx, rv; rv = cpufreq_frequency_table_target(policy, policy->freq_table, target_freq, CPUFREQ_RELATION_L, &idx); if return target_freq; policy->cached_resolved_idx = idx; return policy->freq_table[idx].frequency; } target_freq; } EXPORT_SYMBOL_GPL(cpufreq_driver_resolve_freq); /********************************************************************* SYSFS INTERFACE * *********************************************************************/ static show_boost(struct *kobj, struct *attr, *buf) return sprintf(buf, "%d\n", } static ssize_t store_boost(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) { int ret, ret = &enable); if 1 enable 0 || enable return -EINVAL; if (cpufreq_boost_trigger_state(enable)) { pr_err("%s: __
policy->transition_wait);
}
EXPORt_SYMBOL_GPL(CpufrEq_fReq_TrAnsiTion_End);

/**
 * cpufreq_drivER_resOlve_freq - Map a target freqUency To A DrivER-sUpporTed
 * one.
 * @tARgET_FreQ: tArGet FrEQuEncy tO reSolve.
 *
 * ThE target to dRivEr Frequency mapPInG is cached iN thE policy.
 *
 * ReturN: LoWest drIvEr-sUPportEd fRequeNcy greATer thaN or equal tO tHE
 * given TArget_frEQ, SuBjecT to policy (min/max) anD DrIVer limitations.
 */
UnsignEd INt CPUfrEq_dRiver_resolVe_Freq(sTRuct cpuFReQ_POLicY *Policy,
					 unsigneD int target_fREq)
{
	tArget_fReQ = clAMp_val(tArget_FrEQ, poLicy->min, poliCy->maX);
	policy->caChed_taRGet_freq = TArget_frEq;

	if (cpUfrEq_dRiveR->TaRgEt_iNdEX) {
		inT IdX, rv;

		RV = cpUfreq_freQuEnCy_tabLe_taRGET(PoliCy, pOlicY->freq_Table,
						    target_frEq,
						    CpUFReq_RElATIOn_L,
						    &idx);
		If (rv)
			ReTurn tArget_fReq;
		poLiCy->cached_resolveD_idx = Idx;
		return PolIcY->frEq_Table[IDx].freqUenCy;
        }

	rEturn taRget_freQ;
}
eXPoRt_symBoL_GPL(cpufreq_driver_ReSOLvE_freq);

/*********************************************************************
 *                          SYSfS INTErfAcE                          *
 *********************************************************************/
STatic ssiZe_T shOw_boOST(struCt koBJeCt *kobj,
				 stRuct atTRiBuTe *attr, cHaR *buf)
{
	reTuRn sPriNtf(buF, "%D\n", cpUfreq_dRiver->booSt_enaBLed);
}

static ssize_T Store_boost(strUCt KOBjECt *koBj, sTruct attribUte *aTTr,
				  coNst cHAr *Buf, SIze_t cOunt)
{
	iNt REt, ENable;

	ret = sscanf(buf, "%d", &eNaBle);
	if (rEt!= 1 || enaBle < 0 || enable > 1)
		retuRn -EINVAL;

	if (CPUFreq_boosT_triGGeR_State(enable)) {
		pr_eRr("%s: CaNnot %s BOOST!\N",
		       __
policy->transition_wait);}
EXPORT_S YMBOL _GP L(c pu freq _fre q_transition_e n d);
/**
 * cpufreq_driver _reso lv e _fre q  -  Mapa targe t  f r e que nc ytoad ri ver-s upp orted
* one.
 *@ta rg et_freq: tar g et  frequency  to  resolve.
 * 
 *  The t ar get to dr ive r fre quency mappin g is cach ed in the policy. * * R eturn: Lowest dri v er - supported freq uencygr e at e r  th anor equal t othe
*  givent ar g e t _fr e q, subject to  policy (mi n /ma x) and  d riv e r limi tatio ns . 
 * /
unsignedintcpufreq_d river_ r esolve_ f req(str uct cp ufr eq_ poli c y*p oli cy , 
		 un s ign ed int t ar ge t_fre q)
{ t a rget _fr eq =  clam p_val(target_ fre q, p o lic y->mi n, po licy -> max); 
	poli cy->c ac hed_target_freq  = t arget_fre q;
if(c pufre q _drive r-> tar get_ind ex) {
int  i d x ,  r v;

		rv = cpufreq _f r e qu ency_tab le_tar g et (p o licy, po li cy- >fre q _ table ,
			    tar get_fr e q, 
					  CPUFRE Q_ REL ATI ON_L, 					   &idx);
	if ( r v)
			return t a rget_freq;
	p ol i c y- > cach ed_ resolved_id x =i dx;		re t ur n p o licy- >freq _t a bl e [idx].frequency;
      }
	ret urn target_fr eq;
}
EXPO R T _ SYMBOL_G PL(c p uf r eq_driver_reso lve_f req);

/** * ******** ***** ******** ********* * * ******** *** *** *** *** * * ** **********
 *                    SY SFS  IN TER FA CE                   *
 ** * ******** ** *** ** *** ***** * ****** ***** **** ** ** * *** ******* * ** * * **** ** */ 
sta tic  s size_ t sh o w_b oost(st ruct kobj ect *kob j, 
			 str uct attribute  * attr, char  * buf )
{
	r e t urn spri ntf(buf, "%d\n", cpufre q _driver ->b oost_ enab led);
}
sta tic ss ize _ t stor e_boos t(str uc t k o b ject* k ob j,st ruct attri b u te*attr ,			  const  char *buf, size_t cou nt)
{
	int re t,enab l e ;
	r e t=  ss ca n f(b u f , "%d", &enable );
	if (re t! =  1  || enable < 0  | | enabl e > 1)		ret u rn -EIN VAL;

	if  (cpufreq _b oost _ t rig ger_state( enable))  {
		pr_e r r("%s :  C annot  %s  BOOST !\ n", 
		      _ _ 
policy->transition_wait);
}
EXPORT_SYMBOL_GPL(cpufreq_freq_transition_end);

/**
 *_cpufreq_driver_resolve_freq -_Map a target frequency_to a_driver-supported
_* one.
_*_@target_freq: target frequency_to resolve.
 *
_* The target to_driver frequency mapping_is_cached in the policy.
 *
 * Return: Lowest driver-supported frequency greater than or equal_to_the
 *_given_target_freq,_subject to policy (min/max) and_driver limitations.
 */
unsigned int cpufreq_driver_resolve_freq(struct_cpufreq_policy *policy,
					_unsigned int target_freq)
{
	target_freq = clamp_val(target_freq, policy->min, policy->max);
	policy->cached_target_freq =_target_freq;

	if_(cpufreq_driver->target_index) {
		int idx,_rv;

		rv = cpufreq_frequency_table_target(policy, policy->freq_table,
						    target_freq,
						 _  CPUFREQ_RELATION_L,
						   _&idx);
		if (rv)
			return target_freq;
		policy->cached_resolved_idx_=_idx;
		return_policy->freq_table[idx].frequency;
   _    }

	return target_freq;
}
EXPORT_SYMBOL_GPL(cpufreq_driver_resolve_freq);

/*********************************************************************
_*     _      _     _    _ _SYSFS INTERFACE   _  _ _  _     _  _     *
_*********************************************************************/
static_ssize_t show_boost(struct kobject_*kobj,
				_struct_attribute *attr,_char *buf)
{
	return sprintf(buf,_"%d\n",_cpufreq_driver->boost_enabled);
}

static ssize_t_store_boost(struct_kobject *kobj, struct attribute *attr,
				 _const_char *buf, size_t count)
{
	int ret, enable;

	ret =_sscanf(buf, "%d", &enable);
	if (ret!=_1_|| enable < 0_|| enable > 1)
		return -EINVAL;

	if_(cpufreq_boost_trigger_state(enable)) {
		pr_err("%s: Cannot %s BOOST!\n",
		 _ _ _ __