Lines Matching refs:pwm

8  * This driver is a complete rewrite of the former pwm-twl6030.c authorded by:
31 #include <linux/pwm.h>
74 static int twl4030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm,
97 base = pwm->hwpwm * 2 + TWL4030_PWMA_REG;
103 dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label);
108 static int twl4030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm)
117 dev_err(chip->dev, "%s: Failed to read LEDEN\n", pwm->label);
121 val |= TWL4030_LED_TOGGLE(pwm->hwpwm, TWL4030_LED_PINS);
125 dev_err(chip->dev, "%s: Failed to enable PWM\n", pwm->label);
133 struct pwm_device *pwm)
142 dev_err(chip->dev, "%s: Failed to read LEDEN\n", pwm->label);
146 val &= ~TWL4030_LED_TOGGLE(pwm->hwpwm, TWL4030_LED_PINS);
150 dev_err(chip->dev, "%s: Failed to disable PWM\n", pwm->label);
156 static int twl4030_pwmled_apply(struct pwm_chip *chip, struct pwm_device *pwm,
165 if (pwm->state.enabled)
166 twl4030_pwmled_disable(chip, pwm);
173 * pwm->state.period && state->duty_cycle == pwm->state.duty_cycle
176 * pwm->state might not be configured in hardware.
178 ret = twl4030_pwmled_config(pwm->chip, pwm,
183 if (!pwm->state.enabled)
184 ret = twl4030_pwmled_enable(chip, pwm);
195 static int twl6030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm,
207 dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label);
212 static int twl6030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm)
222 pwm->label);
231 dev_err(chip->dev, "%s: Failed to enable PWM\n", pwm->label);
239 struct pwm_device *pwm)
249 pwm->label);
258 dev_err(chip->dev, "%s: Failed to disable PWM\n", pwm->label);
264 static int twl6030_pwmled_apply(struct pwm_chip *chip, struct pwm_device *pwm,
269 if (state->polarity != pwm->state.polarity)
273 if (pwm->state.enabled)
274 twl6030_pwmled_disable(chip, pwm);
279 err = twl6030_pwmled_config(pwm->chip, pwm,
284 if (!pwm->state.enabled)
285 err = twl6030_pwmled_enable(chip, pwm);
290 static int twl6030_pwmled_request(struct pwm_chip *chip, struct pwm_device *pwm)
300 pwm->label);
309 dev_err(chip->dev, "%s: Failed to request PWM\n", pwm->label);
316 static void twl6030_pwmled_free(struct pwm_chip *chip, struct pwm_device *pwm)
326 pwm->label);
335 dev_err(chip->dev, "%s: Failed to free PWM\n", pwm->label);