Lines Matching refs:hwc

642 	struct mux_hwclock *hwc = to_mux_hwclock(hw);  in mux_set_parent()  local
645 if (idx >= hwc->num_parents) in mux_set_parent()
648 clksel = hwc->parent_to_clksel[idx]; in mux_set_parent()
649 cg_out(hwc->cg, (clksel << CLKSEL_SHIFT) & CLKSEL_MASK, hwc->reg); in mux_set_parent()
656 struct mux_hwclock *hwc = to_mux_hwclock(hw); in mux_get_parent() local
660 clksel = (cg_in(hwc->cg, hwc->reg) & CLKSEL_MASK) >> CLKSEL_SHIFT; in mux_get_parent()
662 ret = hwc->clksel_to_parent[clksel]; in mux_get_parent()
664 pr_err("%s: mux at %p has bad clksel\n", __func__, hwc->reg); in mux_get_parent()
685 struct mux_hwclock *hwc, in get_pll_div() argument
690 if (!(hwc->info->clksel[idx].flags & CLKSEL_VALID)) in get_pll_div()
693 pll = hwc->info->clksel[idx].pll; in get_pll_div()
694 div = hwc->info->clksel[idx].div; in get_pll_div()
700 struct mux_hwclock *hwc, in create_mux_common() argument
718 hwc->clksel_to_parent[i] = -1; in create_mux_common()
720 div = get_pll_div(cg, hwc, i); in create_mux_common()
726 if (hwc->info->clksel[i].flags & CLKSEL_80PCT && in create_mux_common()
733 hwc->parent_to_clksel[j] = i; in create_mux_common()
734 hwc->clksel_to_parent[i] = j; in create_mux_common()
741 init.num_parents = hwc->num_parents = j; in create_mux_common()
743 hwc->hw.init = &init; in create_mux_common()
744 hwc->cg = cg; in create_mux_common()
746 clk = clk_register(NULL, &hwc->hw); in create_mux_common()
750 kfree(hwc); in create_mux_common()
759 struct mux_hwclock *hwc; in create_one_cmux() local
765 hwc = kzalloc(sizeof(*hwc), GFP_KERNEL); in create_one_cmux()
766 if (!hwc) in create_one_cmux()
769 hwc->reg = cg->regs + 0x20 * idx; in create_one_cmux()
770 hwc->info = cg->info.cmux_groups[cg->info.cmux_to_group[idx]]; in create_one_cmux()
779 clksel = (cg_in(cg, hwc->reg) & CLKSEL_MASK) >> CLKSEL_SHIFT; in create_one_cmux()
780 div = get_pll_div(cg, hwc, clksel); in create_one_cmux()
782 kfree(hwc); in create_one_cmux()
797 return create_mux_common(cg, hwc, &cmux_ops, min_rate, in create_one_cmux()
803 struct mux_hwclock *hwc; in create_one_hwaccel() local
805 hwc = kzalloc(sizeof(*hwc), GFP_KERNEL); in create_one_hwaccel()
806 if (!hwc) in create_one_hwaccel()
809 hwc->reg = cg->regs + 0x20 * idx + 0x10; in create_one_hwaccel()
810 hwc->info = cg->info.hwaccel[idx]; in create_one_hwaccel()
812 return create_mux_common(cg, hwc, &hwaccel_ops, 0, 0, in create_one_hwaccel()