Searched refs:ep93xx_pwm (Results 1 - 1 of 1) sorted by relevance
/linux-4.4.14/drivers/pwm/ |
H A D | pwm-ep93xx.c | 45 struct ep93xx_pwm { struct 51 static inline struct ep93xx_pwm *to_ep93xx_pwm(struct pwm_chip *chip) to_ep93xx_pwm() 53 return container_of(chip, struct ep93xx_pwm, chip); to_ep93xx_pwm() 73 struct ep93xx_pwm *ep93xx_pwm = to_ep93xx_pwm(chip); ep93xx_pwm_config() local 74 void __iomem *base = ep93xx_pwm->base; ep93xx_pwm_config() 86 ret = clk_enable(ep93xx_pwm->clk); ep93xx_pwm_config() 91 c = clk_get_rate(ep93xx_pwm->clk); ep93xx_pwm_config() 117 clk_disable(ep93xx_pwm->clk); ep93xx_pwm_config() 125 struct ep93xx_pwm *ep93xx_pwm = to_ep93xx_pwm(chip); ep93xx_pwm_polarity() local 132 ret = clk_enable(ep93xx_pwm->clk); ep93xx_pwm_polarity() 137 writew(0x1, ep93xx_pwm->base + EP93XX_PWMx_INVERT); ep93xx_pwm_polarity() 139 writew(0x0, ep93xx_pwm->base + EP93XX_PWMx_INVERT); ep93xx_pwm_polarity() 141 clk_disable(ep93xx_pwm->clk); ep93xx_pwm_polarity() 148 struct ep93xx_pwm *ep93xx_pwm = to_ep93xx_pwm(chip); ep93xx_pwm_enable() local 151 ret = clk_enable(ep93xx_pwm->clk); ep93xx_pwm_enable() 155 writew(0x1, ep93xx_pwm->base + EP93XX_PWMx_ENABLE); ep93xx_pwm_enable() 162 struct ep93xx_pwm *ep93xx_pwm = to_ep93xx_pwm(chip); ep93xx_pwm_disable() local 164 writew(0x0, ep93xx_pwm->base + EP93XX_PWMx_ENABLE); ep93xx_pwm_disable() 165 clk_disable(ep93xx_pwm->clk); ep93xx_pwm_disable() 180 struct ep93xx_pwm *ep93xx_pwm; ep93xx_pwm_probe() local 184 ep93xx_pwm = devm_kzalloc(&pdev->dev, sizeof(*ep93xx_pwm), GFP_KERNEL); ep93xx_pwm_probe() 185 if (!ep93xx_pwm) ep93xx_pwm_probe() 189 ep93xx_pwm->base = devm_ioremap_resource(&pdev->dev, res); ep93xx_pwm_probe() 190 if (IS_ERR(ep93xx_pwm->base)) ep93xx_pwm_probe() 191 return PTR_ERR(ep93xx_pwm->base); ep93xx_pwm_probe() 193 ep93xx_pwm->clk = devm_clk_get(&pdev->dev, "pwm_clk"); ep93xx_pwm_probe() 194 if (IS_ERR(ep93xx_pwm->clk)) ep93xx_pwm_probe() 195 return PTR_ERR(ep93xx_pwm->clk); ep93xx_pwm_probe() 197 ep93xx_pwm->chip.dev = &pdev->dev; ep93xx_pwm_probe() 198 ep93xx_pwm->chip.ops = &ep93xx_pwm_ops; ep93xx_pwm_probe() 199 ep93xx_pwm->chip.base = -1; ep93xx_pwm_probe() 200 ep93xx_pwm->chip.npwm = 1; ep93xx_pwm_probe() 202 ret = pwmchip_add(&ep93xx_pwm->chip); ep93xx_pwm_probe() 206 platform_set_drvdata(pdev, ep93xx_pwm); ep93xx_pwm_probe() 212 struct ep93xx_pwm *ep93xx_pwm = platform_get_drvdata(pdev); ep93xx_pwm_remove() local 214 return pwmchip_remove(&ep93xx_pwm->chip); ep93xx_pwm_remove()
|
Completed in 143 milliseconds