Lines Matching refs:gpt

37 	struct clk_gpt *gpt = to_clk_gpt(hw);  in gpt_calc_rate()  local
38 struct gpt_rate_tbl *rtbl = gpt->rtbl; in gpt_calc_rate()
48 struct clk_gpt *gpt = to_clk_gpt(hw); in clk_gpt_round_rate() local
52 gpt->rtbl_cnt, &unused); in clk_gpt_round_rate()
58 struct clk_gpt *gpt = to_clk_gpt(hw); in clk_gpt_recalc_rate() local
62 if (gpt->lock) in clk_gpt_recalc_rate()
63 spin_lock_irqsave(gpt->lock, flags); in clk_gpt_recalc_rate()
65 val = readl_relaxed(gpt->reg); in clk_gpt_recalc_rate()
67 if (gpt->lock) in clk_gpt_recalc_rate()
68 spin_unlock_irqrestore(gpt->lock, flags); in clk_gpt_recalc_rate()
83 struct clk_gpt *gpt = to_clk_gpt(hw); in clk_gpt_set_rate() local
84 struct gpt_rate_tbl *rtbl = gpt->rtbl; in clk_gpt_set_rate()
88 clk_round_rate_index(hw, drate, prate, gpt_calc_rate, gpt->rtbl_cnt, in clk_gpt_set_rate()
91 if (gpt->lock) in clk_gpt_set_rate()
92 spin_lock_irqsave(gpt->lock, flags); in clk_gpt_set_rate()
94 val = readl(gpt->reg) & ~GPT_MSCALE_MASK; in clk_gpt_set_rate()
100 writel_relaxed(val, gpt->reg); in clk_gpt_set_rate()
102 if (gpt->lock) in clk_gpt_set_rate()
103 spin_unlock_irqrestore(gpt->lock, flags); in clk_gpt_set_rate()
119 struct clk_gpt *gpt; in clk_register_gpt() local
127 gpt = kzalloc(sizeof(*gpt), GFP_KERNEL); in clk_register_gpt()
128 if (!gpt) in clk_register_gpt()
132 gpt->reg = reg; in clk_register_gpt()
133 gpt->rtbl = rtbl; in clk_register_gpt()
134 gpt->rtbl_cnt = rtbl_cnt; in clk_register_gpt()
135 gpt->lock = lock; in clk_register_gpt()
136 gpt->hw.init = &init; in clk_register_gpt()
144 clk = clk_register(NULL, &gpt->hw); in clk_register_gpt()
149 kfree(gpt); in clk_register_gpt()