Lines Matching refs:gpt
34 struct clk_gpt *gpt = to_clk_gpt(hw); in gpt_calc_rate() local
35 struct gpt_rate_tbl *rtbl = gpt->rtbl; in gpt_calc_rate()
45 struct clk_gpt *gpt = to_clk_gpt(hw); in clk_gpt_round_rate() local
49 gpt->rtbl_cnt, &unused); in clk_gpt_round_rate()
55 struct clk_gpt *gpt = to_clk_gpt(hw); in clk_gpt_recalc_rate() local
59 if (gpt->lock) in clk_gpt_recalc_rate()
60 spin_lock_irqsave(gpt->lock, flags); in clk_gpt_recalc_rate()
62 val = readl_relaxed(gpt->reg); in clk_gpt_recalc_rate()
64 if (gpt->lock) in clk_gpt_recalc_rate()
65 spin_unlock_irqrestore(gpt->lock, flags); in clk_gpt_recalc_rate()
80 struct clk_gpt *gpt = to_clk_gpt(hw); in clk_gpt_set_rate() local
81 struct gpt_rate_tbl *rtbl = gpt->rtbl; in clk_gpt_set_rate()
85 clk_round_rate_index(hw, drate, prate, gpt_calc_rate, gpt->rtbl_cnt, in clk_gpt_set_rate()
88 if (gpt->lock) in clk_gpt_set_rate()
89 spin_lock_irqsave(gpt->lock, flags); in clk_gpt_set_rate()
91 val = readl(gpt->reg) & ~GPT_MSCALE_MASK; in clk_gpt_set_rate()
97 writel_relaxed(val, gpt->reg); in clk_gpt_set_rate()
99 if (gpt->lock) in clk_gpt_set_rate()
100 spin_unlock_irqrestore(gpt->lock, flags); in clk_gpt_set_rate()
116 struct clk_gpt *gpt; in clk_register_gpt() local
124 gpt = kzalloc(sizeof(*gpt), GFP_KERNEL); in clk_register_gpt()
125 if (!gpt) in clk_register_gpt()
129 gpt->reg = reg; in clk_register_gpt()
130 gpt->rtbl = rtbl; in clk_register_gpt()
131 gpt->rtbl_cnt = rtbl_cnt; in clk_register_gpt()
132 gpt->lock = lock; in clk_register_gpt()
133 gpt->hw.init = &init; in clk_register_gpt()
141 clk = clk_register(NULL, &gpt->hw); in clk_register_gpt()
146 kfree(gpt); in clk_register_gpt()