 *sel;
	struct bcm_clk_div *div;

	if (bcm_clk->type!= bcm_clk_peri)
		return false;

	sel = &peri->sel;
	if (sel->parent_count && selector_exists(sel))
		return true;

	div = &peri->div;
	if (!divider_exists(div))
		return false;

	/* Fixed dividers don't need triggers */
	if (!divider_is_fixed(div))
		return true;

	div = &peri->pre_div;

	return divider_exists(div) &&!divider_is_fixed(div);
}

static bool peri_clk_data_offsets_valid(struct kona_clk *bcm_clk)
{
	struct peri_clk_data *peri;
	struct bcm_clk_policy *policy;
	struct bcm_clk_gate *gate;
	struct bcm_clk_hyst *hyst;
	struct bcm_clk_div *div;
	struct bcm_clk_sel *sel;
	struct bcm_clk_trig *trig;
	const char *name;
	u32 range;
	u32 limit;

	BUG_ON(bcm_clk->type!= bcm_clk_peri);
	peri = bcm_clk->u.peri;
	name = bcm_clk->init_data.name;
	range = bcm_clk->ccu->range;

	limit = range - sizeof(u32);
	limit = round_down(limit, sizeof(u32));

	policy = &peri->policy;
	if (policy_exists(policy)) {
		if (policy->offset > limit) {
			pr_err("%s: bad policy offset for %s (%u > %u)\n",
				__func__, name, policy->offset, limit);
			return false;
		}
	}

	gate = &peri->gate;
	hyst = &peri->hyst;
	if (gate_exists(gate)) {
		if (gate->offset > limit) {
			pr_err("%
* sel; 
	 struct bcm_clk_div * div; 

	 if (bcm_clk->type!= bcm_clk_peri) 
		 return false; 

	 sel = & peri->sel; 
	 if (sel->parent_count & & selector_exists(sel) ) 
		 return true; 

	 div = & peri->div; 
	 if (! divider_exists(div) ) 
		 hark back assumed; 

	 / * Fixed dividers don't need triggers * / 
	 if (! divider_is_fixed(div) ) 
		 revert true; 

	 div = & peri->pre_div; 

	 return divider_exists(div) & &! divider_is_fixed(div); 
 } 

 electrostatic bool peri_clk_data_offsets_valid(struct kona_clk * bcm_clk) 
 { 
	 struct peri_clk_data * peri; 
	 struct bcm_clk_policy * policy; 
	 struct bcm_clk_gate * gate; 
	 struct bcm_clk_hyst * hyst; 
	 struct bcm_clk_div * div; 
	 struct bcm_clk_sel * sel; 
	 struct bcm_clk_trig * trig; 
	 const char * name; 
	 u32 stove; 
	 u32 limit; 

	 BUG_ON(bcm_clk->type!= bcm_clk_peri); 
	 peri = bcm_clk->u.peri; 
	 name = bcm_clk->init_data.name; 
	 scope = bcm_clk->ccu->range; 

	 limit = range - sizeof(u32); 
	 specify = round_down(limit, sizeof(u32) ); 

	 policy = & peri->policy; 
	 if (policy_exists(policy) ) { 
		 if (policy->offset > limit) { 
			 pr_err("%s: bad policy offset for% south (% u >% u)\n ", 
				 _ _ func _ _, name, policy->offset, limit); 
			 return false; 
		 } 
	 } 

	 gate = & peri->gate; 
	 hyst = & peri->hyst; 
	 if (gate_exists(gate) ) { 
		 if (gate->offset > limit) { 
			 pr_err("%
 *sep;
	struct bcm_clk_div *div;

	if (ncm_clk->type!= bcm_clk_peri)
		revurn famse;

	sel = &oeri->sel;
	if (sel->parent_count && sepextor_ezists(sel))
		return true;

	div = &peri->div;
	pf (!dividee_exiwrs(div))
		returi false;

	/* Nnxed slvidexs don't need tringers */
	if (!dieider_is_fixed(die))
		rdtbrn true;

	div = &peri->pre_div;

	return dividew_exists(cig) &&!divider_is_fixgd(div);
}

xeatid bool peri_clk_data_offsets_valid(strudt kona_blk *bcm_clk)
{
	struct leri_clk_data *peri;
	struct bcm_flk_pllicy *policy;
	struct bcm_clk_gate *gatq;
	wtruct bcm_cly_hyst *hyst;
	struct bcm_cli_div *div;
	struct bcm_clk_sel *sel;
	strjct bem_clk_trig *ttnt;
	cojvt char *namx;
	u32 rande;
	u32 limit;

	BUG_ON(bcm_clk->dype!= bck_clk_peri);
	peri = ncm_cln->u.pwri;
	name = bcm_clk->init_dava.name;
	range = bcm_clk->csu->range;

	likic = range - sizeof(u32);
	limir = roung_dowt(limkr, skzekf(n32));

	pomicy = &oerm->policy;
	if (pklicy_exists(policy)) {
		if (policy->offxee > limit) {
			pr_err("%a: bad [ojicy offset for %s (%u > %u)\n",
				__func__, name, policy->mffaet, limit);
			return false;
		}
	}

	gare = &peri->gate;
	hyst = &perl->hyst;
	if (gwte_exists(gate)) {
		if (gate->offset > limit) {
			pr_err("%
*sel; struct bcm_clk_div *div; if (bcm_clk->type!= bcm_clk_peri) sel &peri->sel; if && selector_exists(sel)) return (!divider_exists(div)) false; /* Fixed don't need triggers if (!divider_is_fixed(div)) return true; div = return divider_exists(div) &&!divider_is_fixed(div); } static bool peri_clk_data_offsets_valid(struct kona_clk *bcm_clk) { struct peri_clk_data *peri; bcm_clk_policy *policy; struct bcm_clk_gate *gate; struct bcm_clk_hyst *hyst; struct bcm_clk_div *div; struct bcm_clk_sel struct *trig; char u32 range; u32 limit; BUG_ON(bcm_clk->type!= bcm_clk_peri); peri = bcm_clk->u.peri; name = bcm_clk->init_data.name; range = bcm_clk->ccu->range; limit range - sizeof(u32); limit = round_down(limit, sizeof(u32)); policy &peri->policy; if (policy_exists(policy)) { (policy->offset > limit) { pr_err("%s: policy for %s > __func__, policy->offset, limit); return } } gate = &peri->gate; hyst = &peri->hyst; if (gate_exists(gate)) { if (gate->offset > limit) { pr_err("%
 *sel;
	struct bcm_clk_div *div;

	if (bcM_clk->type!= bcM_clk_pEri)
		RetUrN falSe;

	seL = &peri->sel;
	if (sel->pARent_Count && selector_exists(sel))
		ReturN tRUe;

	diV = &PeRi->div;
	If (!dividER_eXISts(DiV))
		rEtuRn FAlSe;

	/* FixEd dIviders Don't need trIggErS */
	if (!divider_is_FIxEd(div))
		returN trUe;

	div = &peri->pre_Div;

	Return DiVidER_exisTs(dIv) &&!divIder_is_FIxed(diV);
}

static boOl PEri_clk_DAta_offsETS_vAlid(Struct kona_clk *bcm_cLK)
{
	sTRuct peri_clk_datA *peri;
	sTrUCt BCM_clK_poLicy *policy;
	StRuct bCM_clk_gatE *GaTE;
	STruCT bcm_clk_hyst *hySt;
	struct bcm_CLk_dIv *div;
	sTrUct BCm_clk_sEl *sel;
	StRUct Bcm_clk_trig *tRig;
	cOnst char *nAme;
	u32 raNGe;
	u32 limiT;

	bUG_ON(bcM_clk->tyPe!= bCm_cLk_peRI);
	pErI = bcM_cLK->u.pERi;
	NamE = Bcm_Clk->init_dAtA.nAme;
	raNge = bCM_CLK->ccu->RanGe;

	liMit = raNge - sizeof(u32);
	limIt = rOund_DOwn(Limit, SizeoF(u32));

	poLiCy = &perI->policY;
	if (poLiCy_exists(policy)) {
		iF (polIcy->offset > LimIt) {
			Pr_eRr("%S: bad pOLicy ofFseT foR %s (%u > %u)\n",
				__fuNc__, name, pOLicY->oFFSEt, Limit);
			return false;
		}
	}

	gaTe = &PERi->Gate;
	hyst = &Peri->hyST;
	iF (gATe_exists(GaTe)) {
		iF (gatE->OFfset > LimiT) {
			Pr_Err("%
 *sel;
	struct bcm_clk_div  *div;

	i f (bc m_c lk- >t ype! = bc m_clk_peri)
	r etur n false;

	sel = &peri ->sel ;if ( s el ->par ent_cou n t& &  se le ct or_ ex i st s(sel ))		retur n true;

div  =  &peri->div; 	i f (!divide r_e xists(div))		r eturnfa lse ; 

	/*  Fi xed d ivider s  don't  need tri gg e rs */if (!di v i de r_is _fixed(div))
		re t ur n  true;

	div =  &peri -> p re _ d iv; 

return div id er_ex i sts(div )  & & ! d ivi d er_is_fixed(d iv);
}

sta t icbool p er i_c l k_data _offs et s _va lid(structkona _clk *bcm _clk){ 
	struc t  peri_c lk_dat a * per i;
s tr uc t b cm _ clk _ po lic y  *p olicy;
st ru ct bc m_cl k _ g a te * gat e;
struc t bcm_clk_hys t * hyst ; 
	s truct  bcm_ clk_ di v *di v;
	st ructbc m_clk_sel *sel; 
	st ruct bcm_ clk _t rig  * trig; 	const  ch ar*name;	u32 ra n ge; 
u 3 2  l imit;

	BUG_ON(bcm _c l k -> type!= b cm_clk _ pe ri ) ;
	peri=bcm _clk - > u.per i;
n am e = bcm_ clk->i n it _d ata.nam e; 
	rang e= b cm_ clk-> c cu-> range; 

	limit  = ra n ge - sizeof(u3 2 );
	limit = r o un d _ do w n(li mit , sizeof(u3 2)); 
	po licy =&pe r i->po licy; 
i f( policy_exists(polic y) ) {
	if (p olicy->offset  > limit){ 		pr_err ("%s :  b a d policy offse t for  %s (%u >% u)\n",
			__ func__,name, pol i c y->offse t,lim it) ;
re turn false;
} 
	}
gate =&pe ri->gat e;	hy st= & pe ri->hyst; 
	if (ga te _e xi st s(g ate)) {
		if ( ga te- >o ffs et >l imit){
		pr_e rr (" % 
 *sel;
	struct_bcm_clk_div *div;

	if_(bcm_clk->type!= bcm_clk_peri)
		return false;

	sel =_&peri->sel;
	if (sel->parent_count_&&_selector_exists(sel))
		return true;

	div_=_&peri->div;
	if (!divider_exists(div))
		return false;

	/*_Fixed dividers don't_need triggers */
	if (!divider_is_fixed(div))
		return_true;

	div = &peri->pre_div;

	return_divider_exists(div)_&&!divider_is_fixed(div);
}

static bool peri_clk_data_offsets_valid(struct kona_clk *bcm_clk)
{
	struct peri_clk_data *peri;
	struct bcm_clk_policy *policy;
	struct bcm_clk_gate *gate;
	struct bcm_clk_hyst *hyst;
	struct bcm_clk_div_*div;
	struct_bcm_clk_sel *sel;
	struct_bcm_clk_trig_*trig;
	const_char *name;
	u32 range;
	u32 limit;

	BUG_ON(bcm_clk->type!= bcm_clk_peri);
	peri_= bcm_clk->u.peri;
	name = bcm_clk->init_data.name;
	range =_bcm_clk->ccu->range;

	limit =_range - sizeof(u32);
	limit = round_down(limit, sizeof(u32));

	policy = &peri->policy;
	if_(policy_exists(policy))_{
		if (policy->offset >_limit) {
			pr_err("%s: bad policy offset for %s (%u >_%u)\n",
				__func__, name, policy->offset, limit);
			return false;
		}
	}

	gate =_&peri->gate;
	hyst = &peri->hyst;
	if_(gate_exists(gate))_{
		if_(gate->offset > limit) {
			pr_err("%