Lines Matching refs:bcm_clk
51 static bool clk_requires_trigger(struct kona_clk *bcm_clk) in clk_requires_trigger() argument
53 struct peri_clk_data *peri = bcm_clk->u.peri; in clk_requires_trigger()
57 if (bcm_clk->type != bcm_clk_peri) in clk_requires_trigger()
77 static bool peri_clk_data_offsets_valid(struct kona_clk *bcm_clk) in peri_clk_data_offsets_valid() argument
90 BUG_ON(bcm_clk->type != bcm_clk_peri); in peri_clk_data_offsets_valid()
91 peri = bcm_clk->u.peri; in peri_clk_data_offsets_valid()
92 name = bcm_clk->init_data.name; in peri_clk_data_offsets_valid()
93 range = bcm_clk->ccu->range; in peri_clk_data_offsets_valid()
368 static bool kona_dividers_valid(struct kona_clk *bcm_clk) in kona_dividers_valid() argument
370 struct peri_clk_data *peri = bcm_clk->u.peri; in kona_dividers_valid()
375 BUG_ON(bcm_clk->type != bcm_clk_peri); in kona_dividers_valid()
400 peri_clk_data_valid(struct kona_clk *bcm_clk) in peri_clk_data_valid() argument
412 BUG_ON(bcm_clk->type != bcm_clk_peri); in peri_clk_data_valid()
419 if (!peri_clk_data_offsets_valid(bcm_clk)) in peri_clk_data_valid()
422 peri = bcm_clk->u.peri; in peri_clk_data_valid()
423 name = bcm_clk->init_data.name; in peri_clk_data_valid()
474 if (!clk_requires_trigger(bcm_clk)) { in peri_clk_data_valid()
483 } else if (clk_requires_trigger(bcm_clk)) { in peri_clk_data_valid()
489 return kona_dividers_valid(bcm_clk); in peri_clk_data_valid()
492 static bool kona_clk_valid(struct kona_clk *bcm_clk) in kona_clk_valid() argument
494 switch (bcm_clk->type) { in kona_clk_valid()
496 if (!peri_clk_data_valid(bcm_clk)) in kona_clk_valid()
501 (int)bcm_clk->type); in kona_clk_valid()
681 static void bcm_clk_teardown(struct kona_clk *bcm_clk) in bcm_clk_teardown() argument
683 switch (bcm_clk->type) { in bcm_clk_teardown()
685 peri_clk_teardown(bcm_clk->u.data, &bcm_clk->init_data); in bcm_clk_teardown()
690 bcm_clk->u.data = NULL; in bcm_clk_teardown()
691 bcm_clk->type = bcm_clk_none; in bcm_clk_teardown()
696 struct kona_clk *bcm_clk; in kona_clk_teardown() local
703 bcm_clk = to_kona_clk(hw); in kona_clk_teardown()
704 bcm_clk_teardown(bcm_clk); in kona_clk_teardown()
707 static int kona_clk_setup(struct kona_clk *bcm_clk) in kona_clk_setup() argument
710 struct clk_init_data *init_data = &bcm_clk->init_data; in kona_clk_setup()
712 switch (bcm_clk->type) { in kona_clk_setup()
714 ret = peri_clk_setup(bcm_clk->u.data, init_data); in kona_clk_setup()
720 (int)bcm_clk->type, init_data->name); in kona_clk_setup()
725 if (!kona_clk_valid(bcm_clk)) { in kona_clk_setup()
732 bcm_clk->hw.init = init_data; in kona_clk_setup()
733 ret = clk_hw_register(NULL, &bcm_clk->hw); in kona_clk_setup()
742 bcm_clk_teardown(bcm_clk); in kona_clk_setup()