Lines Matching full:pwm

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