Lines Matching refs:cg

33 	struct mtk_clk_gate *cg = to_mtk_clk_gate(hw);  in mtk_get_clockgating()  local
36 regmap_read(cg->regmap, cg->sta_ofs, &val); in mtk_get_clockgating()
38 return val & BIT(cg->bit); in mtk_get_clockgating()
53 struct mtk_clk_gate *cg = to_mtk_clk_gate(hw); in mtk_cg_set_bit() local
55 regmap_write(cg->regmap, cg->set_ofs, BIT(cg->bit)); in mtk_cg_set_bit()
60 struct mtk_clk_gate *cg = to_mtk_clk_gate(hw); in mtk_cg_clr_bit() local
62 regmap_write(cg->regmap, cg->clr_ofs, BIT(cg->bit)); in mtk_cg_clr_bit()
67 struct mtk_clk_gate *cg = to_mtk_clk_gate(hw); in mtk_cg_set_bit_no_setclr() local
69 regmap_set_bits(cg->regmap, cg->sta_ofs, BIT(cg->bit)); in mtk_cg_set_bit_no_setclr()
74 struct mtk_clk_gate *cg = to_mtk_clk_gate(hw); in mtk_cg_clr_bit_no_setclr() local
76 regmap_clear_bits(cg->regmap, cg->sta_ofs, BIT(cg->bit)); in mtk_cg_clr_bit_no_setclr()
162 struct mtk_clk_gate *cg; in mtk_clk_register_gate() local
166 cg = kzalloc(sizeof(*cg), GFP_KERNEL); in mtk_clk_register_gate()
167 if (!cg) in mtk_clk_register_gate()
176 cg->regmap = regmap; in mtk_clk_register_gate()
177 cg->set_ofs = set_ofs; in mtk_clk_register_gate()
178 cg->clr_ofs = clr_ofs; in mtk_clk_register_gate()
179 cg->sta_ofs = sta_ofs; in mtk_clk_register_gate()
180 cg->bit = bit; in mtk_clk_register_gate()
182 cg->hw.init = &init; in mtk_clk_register_gate()
184 ret = clk_hw_register(dev, &cg->hw); in mtk_clk_register_gate()
186 kfree(cg); in mtk_clk_register_gate()
190 return &cg->hw; in mtk_clk_register_gate()
195 struct mtk_clk_gate *cg; in mtk_clk_unregister_gate() local
199 cg = to_mtk_clk_gate(hw); in mtk_clk_unregister_gate()
202 kfree(cg); in mtk_clk_unregister_gate()