Lines Matching refs:vt8500
60 struct vt8500_chip *vt8500 = to_vt8500_chip(chip); in vt8500_pwm_busy_wait() local
64 while ((readl(vt8500->base + REG_STATUS) & mask) && --loops) in vt8500_pwm_busy_wait()
75 struct vt8500_chip *vt8500 = to_vt8500_chip(chip); in vt8500_pwm_config() local
81 err = clk_enable(vt8500->clk); in vt8500_pwm_config()
87 c = clk_get_rate(vt8500->clk); in vt8500_pwm_config()
100 clk_disable(vt8500->clk); in vt8500_pwm_config()
108 writel(prescale, vt8500->base + REG_SCALAR(pwm->hwpwm)); in vt8500_pwm_config()
111 writel(pv, vt8500->base + REG_PERIOD(pwm->hwpwm)); in vt8500_pwm_config()
114 writel(dc, vt8500->base + REG_DUTY(pwm->hwpwm)); in vt8500_pwm_config()
117 val = readl(vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_config()
119 writel(val, vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_config()
122 clk_disable(vt8500->clk); in vt8500_pwm_config()
128 struct vt8500_chip *vt8500 = to_vt8500_chip(chip); in vt8500_pwm_enable() local
132 err = clk_enable(vt8500->clk); in vt8500_pwm_enable()
138 val = readl(vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_enable()
140 writel(val, vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_enable()
148 struct vt8500_chip *vt8500 = to_vt8500_chip(chip); in vt8500_pwm_disable() local
151 val = readl(vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_disable()
153 writel(val, vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_disable()
156 clk_disable(vt8500->clk); in vt8500_pwm_disable()
163 struct vt8500_chip *vt8500 = to_vt8500_chip(chip); in vt8500_pwm_set_polarity() local
166 val = readl(vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_set_polarity()
173 writel(val, vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_set_polarity()
238 struct vt8500_chip *vt8500; in vt8500_pwm_probe() local
245 chip = devm_pwmchip_alloc(&pdev->dev, VT8500_NR_PWMS, sizeof(*vt8500)); in vt8500_pwm_probe()
248 vt8500 = to_vt8500_chip(chip); in vt8500_pwm_probe()
252 vt8500->clk = devm_clk_get_prepared(&pdev->dev, NULL); in vt8500_pwm_probe()
253 if (IS_ERR(vt8500->clk)) in vt8500_pwm_probe()
254 return dev_err_probe(&pdev->dev, PTR_ERR(vt8500->clk), "clock source not specified\n"); in vt8500_pwm_probe()
256 vt8500->base = devm_platform_ioremap_resource(pdev, 0); in vt8500_pwm_probe()
257 if (IS_ERR(vt8500->base)) in vt8500_pwm_probe()
258 return PTR_ERR(vt8500->base); in vt8500_pwm_probe()