Lines Matching refs:clk

35 #define to_scpi_clk(clk) container_of(clk, struct scpi_clk, hw)  argument
42 struct scpi_clk *clk = to_scpi_clk(hw); in scpi_clk_recalc_rate() local
44 return clk->scpi_ops->clk_get_val(clk->id); in scpi_clk_recalc_rate()
62 struct scpi_clk *clk = to_scpi_clk(hw); in scpi_clk_set_rate() local
64 return clk->scpi_ops->clk_set_val(clk->id, rate); in scpi_clk_set_rate()
74 static int __scpi_dvfs_round_rate(struct scpi_clk *clk, unsigned long rate) in __scpi_dvfs_round_rate() argument
78 const struct scpi_opp *opp = clk->info->opps; in __scpi_dvfs_round_rate()
80 for (idx = 0; idx < clk->info->count; idx++, opp++) { in __scpi_dvfs_round_rate()
96 struct scpi_clk *clk = to_scpi_clk(hw); in scpi_dvfs_recalc_rate() local
97 int idx = clk->scpi_ops->dvfs_get_idx(clk->id); in scpi_dvfs_recalc_rate()
103 opp = clk->info->opps + idx; in scpi_dvfs_recalc_rate()
110 struct scpi_clk *clk = to_scpi_clk(hw); in scpi_dvfs_round_rate() local
112 return __scpi_dvfs_round_rate(clk, rate); in scpi_dvfs_round_rate()
115 static int __scpi_find_dvfs_index(struct scpi_clk *clk, unsigned long rate) in __scpi_find_dvfs_index() argument
117 int idx, max_opp = clk->info->count; in __scpi_find_dvfs_index()
118 const struct scpi_opp *opp = clk->info->opps; in __scpi_find_dvfs_index()
129 struct scpi_clk *clk = to_scpi_clk(hw); in scpi_dvfs_set_rate() local
130 int ret = __scpi_find_dvfs_index(clk, rate); in scpi_dvfs_set_rate()
134 return clk->scpi_ops->dvfs_set_idx(clk->id, (u8)ret); in scpi_dvfs_set_rate()
149 static struct clk *
154 struct clk *clk; in scpi_clk_ops_init() local
175 clk = devm_clk_register(dev, &sclk->hw); in scpi_clk_ops_init()
176 if (!IS_ERR(clk) && max) in scpi_clk_ops_init()
178 return clk; in scpi_clk_ops_init()
182 struct scpi_clk **clk; member
186 static struct clk *
194 sclk = clk_data->clk[count]; in scpi_of_clk_src_get()
196 return sclk->hw.clk; in scpi_of_clk_src_get()
205 struct clk **clks; in scpi_clk_add()
220 clk_data->clk = devm_kcalloc(dev, count, sizeof(*clk_data->clk), in scpi_clk_add()
222 if (!clk_data->clk) in scpi_clk_add()
257 clk_data->clk[idx] = sclk; in scpi_clk_add()