Lines Matching defs:pwm
7 * Based on drivers/pwm/pwm-tegra.c, Copyright (c) 2010, NVIDIA Corporation
19 #include <linux/pwm.h>
91 static int img_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
135 val &= ~(PWM_CTRL_CFG_DIV_MASK << PWM_CTRL_CFG_DIV_SHIFT(pwm->hwpwm));
137 PWM_CTRL_CFG_DIV_SHIFT(pwm->hwpwm);
142 img_pwm_writel(imgchip, PWM_CH_CFG(pwm->hwpwm), val);
150 static int img_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
161 val |= BIT(pwm->hwpwm);
166 PERIP_PWM_PDM_CONTROL_CH_SHIFT(pwm->hwpwm));
171 static void img_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
177 val &= ~BIT(pwm->hwpwm);
184 static int img_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
193 if (pwm->state.enabled)
194 img_pwm_disable(chip, pwm);
199 err = img_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period);
203 if (!pwm->state.enabled)
204 err = img_pwm_enable(chip, pwm);
220 .compatible = "img,pistachio-pwm",
250 dev_err(dev, "could not prepare or enable pwm clock\n");
419 .name = "img-pwm",