Lines Matching refs:zclk
92 struct cpg_z_clk *zclk = to_z_clk(hw); in cpg_z_clk_recalc_rate() local
96 val = readl(zclk->reg) & zclk->mask; in cpg_z_clk_recalc_rate()
97 mult = 32 - (val >> __ffs(zclk->mask)); in cpg_z_clk_recalc_rate()
119 struct cpg_z_clk *zclk = to_z_clk(hw); in cpg_z_clk_set_rate() local
128 if (readl(zclk->kick_reg) & CPG_FRQCRB_KICK) in cpg_z_clk_set_rate()
131 val = readl(zclk->reg) & ~zclk->mask; in cpg_z_clk_set_rate()
132 val |= ((32 - mult) << __ffs(zclk->mask)) & zclk->mask; in cpg_z_clk_set_rate()
133 writel(val, zclk->reg); in cpg_z_clk_set_rate()
139 kick = readl(zclk->kick_reg); in cpg_z_clk_set_rate()
141 writel(kick, zclk->kick_reg); in cpg_z_clk_set_rate()
153 if (!(readl(zclk->kick_reg) & CPG_FRQCRB_KICK)) in cpg_z_clk_set_rate()
174 struct cpg_z_clk *zclk; in cpg_z_clk_register() local
177 zclk = kzalloc(sizeof(*zclk), GFP_KERNEL); in cpg_z_clk_register()
178 if (!zclk) in cpg_z_clk_register()
187 zclk->reg = reg + CPG_FRQCRC; in cpg_z_clk_register()
188 zclk->kick_reg = reg + CPG_FRQCRB; in cpg_z_clk_register()
189 zclk->hw.init = &init; in cpg_z_clk_register()
190 zclk->mask = mask; in cpg_z_clk_register()
192 clk = clk_register(NULL, &zclk->hw); in cpg_z_clk_register()
194 kfree(zclk); in cpg_z_clk_register()