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