Lines Matching refs:tcu_clk
67 struct ingenic_tcu_clk *tcu_clk = to_tcu_clk(hw); in ingenic_tcu_enable() local
68 const struct ingenic_tcu_clk_info *info = tcu_clk->info; in ingenic_tcu_enable()
69 struct ingenic_tcu *tcu = tcu_clk->tcu; in ingenic_tcu_enable()
78 struct ingenic_tcu_clk *tcu_clk = to_tcu_clk(hw); in ingenic_tcu_disable() local
79 const struct ingenic_tcu_clk_info *info = tcu_clk->info; in ingenic_tcu_disable()
80 struct ingenic_tcu *tcu = tcu_clk->tcu; in ingenic_tcu_disable()
87 struct ingenic_tcu_clk *tcu_clk = to_tcu_clk(hw); in ingenic_tcu_is_enabled() local
88 const struct ingenic_tcu_clk_info *info = tcu_clk->info; in ingenic_tcu_is_enabled()
91 regmap_read(tcu_clk->tcu->map, TCU_REG_TSR, &value); in ingenic_tcu_is_enabled()
98 struct ingenic_tcu_clk *tcu_clk = to_tcu_clk(hw); in ingenic_tcu_enable_regs() local
99 const struct ingenic_tcu_clk_info *info = tcu_clk->info; in ingenic_tcu_enable_regs()
100 struct ingenic_tcu *tcu = tcu_clk->tcu; in ingenic_tcu_enable_regs()
115 struct ingenic_tcu_clk *tcu_clk = to_tcu_clk(hw); in ingenic_tcu_disable_regs() local
116 const struct ingenic_tcu_clk_info *info = tcu_clk->info; in ingenic_tcu_disable_regs()
117 struct ingenic_tcu *tcu = tcu_clk->tcu; in ingenic_tcu_disable_regs()
124 struct ingenic_tcu_clk *tcu_clk = to_tcu_clk(hw); in ingenic_tcu_get_parent() local
125 const struct ingenic_tcu_clk_info *info = tcu_clk->info; in ingenic_tcu_get_parent()
129 ret = regmap_read(tcu_clk->tcu->map, info->tcsr_reg, &val); in ingenic_tcu_get_parent()
130 WARN_ONCE(ret < 0, "Unable to read TCSR %d", tcu_clk->idx); in ingenic_tcu_get_parent()
137 struct ingenic_tcu_clk *tcu_clk = to_tcu_clk(hw); in ingenic_tcu_set_parent() local
138 const struct ingenic_tcu_clk_info *info = tcu_clk->info; in ingenic_tcu_set_parent()
144 ret = regmap_update_bits(tcu_clk->tcu->map, info->tcsr_reg, in ingenic_tcu_set_parent()
146 WARN_ONCE(ret < 0, "Unable to update TCSR %d", tcu_clk->idx); in ingenic_tcu_set_parent()
157 struct ingenic_tcu_clk *tcu_clk = to_tcu_clk(hw); in ingenic_tcu_recalc_rate() local
158 const struct ingenic_tcu_clk_info *info = tcu_clk->info; in ingenic_tcu_recalc_rate()
162 ret = regmap_read(tcu_clk->tcu->map, info->tcsr_reg, &prescale); in ingenic_tcu_recalc_rate()
163 WARN_ONCE(ret < 0, "Unable to read TCSR %d", tcu_clk->idx); in ingenic_tcu_recalc_rate()
201 struct ingenic_tcu_clk *tcu_clk = to_tcu_clk(hw); in ingenic_tcu_set_rate() local
202 const struct ingenic_tcu_clk_info *info = tcu_clk->info; in ingenic_tcu_set_rate()
209 ret = regmap_update_bits(tcu_clk->tcu->map, info->tcsr_reg, in ingenic_tcu_set_rate()
212 WARN_ONCE(ret < 0, "Unable to update TCSR %d", tcu_clk->idx); in ingenic_tcu_set_rate()
273 struct ingenic_tcu_clk *tcu_clk; in ingenic_tcu_register_clock() local
276 tcu_clk = kzalloc(sizeof(*tcu_clk), GFP_KERNEL); in ingenic_tcu_register_clock()
277 if (!tcu_clk) in ingenic_tcu_register_clock()
280 tcu_clk->hw.init = &info->init_data; in ingenic_tcu_register_clock()
281 tcu_clk->idx = idx; in ingenic_tcu_register_clock()
282 tcu_clk->info = info; in ingenic_tcu_register_clock()
283 tcu_clk->tcu = tcu; in ingenic_tcu_register_clock()
286 ingenic_tcu_enable_regs(&tcu_clk->hw); in ingenic_tcu_register_clock()
288 ingenic_tcu_disable_regs(&tcu_clk->hw); in ingenic_tcu_register_clock()
290 err = clk_hw_register(NULL, &tcu_clk->hw); in ingenic_tcu_register_clock()
292 kfree(tcu_clk); in ingenic_tcu_register_clock()
296 clocks->hws[idx] = &tcu_clk->hw; in ingenic_tcu_register_clock()