Lines Matching refs:pc
80 struct spear_pwm_chip *pc = to_spear_pwm_chip(chip); in spear_pwm_config() local
95 clk_rate = clk_get_rate(pc->clk); in spear_pwm_config()
124 ret = clk_enable(pc->clk); in spear_pwm_config()
128 spear_pwm_writel(pc, pwm->hwpwm, PWMCR, in spear_pwm_config()
130 spear_pwm_writel(pc, pwm->hwpwm, PWMDCR, dc); in spear_pwm_config()
131 spear_pwm_writel(pc, pwm->hwpwm, PWMPCR, pv); in spear_pwm_config()
132 clk_disable(pc->clk); in spear_pwm_config()
139 struct spear_pwm_chip *pc = to_spear_pwm_chip(chip); in spear_pwm_enable() local
143 rc = clk_enable(pc->clk); in spear_pwm_enable()
147 val = spear_pwm_readl(pc, pwm->hwpwm, PWMCR); in spear_pwm_enable()
149 spear_pwm_writel(pc, pwm->hwpwm, PWMCR, val); in spear_pwm_enable()
156 struct spear_pwm_chip *pc = to_spear_pwm_chip(chip); in spear_pwm_disable() local
159 val = spear_pwm_readl(pc, pwm->hwpwm, PWMCR); in spear_pwm_disable()
161 spear_pwm_writel(pc, pwm->hwpwm, PWMCR, val); in spear_pwm_disable()
163 clk_disable(pc->clk); in spear_pwm_disable()
198 struct spear_pwm_chip *pc; in spear_pwm_probe() local
202 pc = devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL); in spear_pwm_probe()
203 if (!pc) in spear_pwm_probe()
206 pc->mmio_base = devm_platform_ioremap_resource(pdev, 0); in spear_pwm_probe()
207 if (IS_ERR(pc->mmio_base)) in spear_pwm_probe()
208 return PTR_ERR(pc->mmio_base); in spear_pwm_probe()
210 pc->clk = devm_clk_get(&pdev->dev, NULL); in spear_pwm_probe()
211 if (IS_ERR(pc->clk)) in spear_pwm_probe()
212 return PTR_ERR(pc->clk); in spear_pwm_probe()
214 platform_set_drvdata(pdev, pc); in spear_pwm_probe()
216 pc->chip.dev = &pdev->dev; in spear_pwm_probe()
217 pc->chip.ops = &spear_pwm_ops; in spear_pwm_probe()
218 pc->chip.npwm = NUM_PWM; in spear_pwm_probe()
220 ret = clk_prepare(pc->clk); in spear_pwm_probe()
225 ret = clk_enable(pc->clk); in spear_pwm_probe()
227 clk_unprepare(pc->clk); in spear_pwm_probe()
234 val = readl_relaxed(pc->mmio_base + PWMMCR); in spear_pwm_probe()
236 writel_relaxed(val, pc->mmio_base + PWMMCR); in spear_pwm_probe()
238 clk_disable(pc->clk); in spear_pwm_probe()
241 ret = pwmchip_add(&pc->chip); in spear_pwm_probe()
243 clk_unprepare(pc->clk); in spear_pwm_probe()
252 struct spear_pwm_chip *pc = platform_get_drvdata(pdev); in spear_pwm_remove() local
254 pwmchip_remove(&pc->chip); in spear_pwm_remove()
257 clk_unprepare(pc->clk); in spear_pwm_remove()