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.
73 static int twl4030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm, in twl4030_pwmled_config() argument
89 * When on cycle == off cycle the PWM will be always on in twl4030_pwmled_config()
96 base = pwm->hwpwm * 2 + TWL4030_PWMA_REG; in twl4030_pwmled_config()
102 dev_err(pwmchip_parent(chip), "%s: Failed to configure PWM\n", pwm->label); in twl4030_pwmled_config()
107 static int twl4030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm) in twl4030_pwmled_enable() argument
116 dev_err(pwmchip_parent(chip), "%s: Failed to read LEDEN\n", pwm->label); in twl4030_pwmled_enable()
120 val |= TWL4030_LED_TOGGLE(pwm->hwpwm, TWL4030_LED_PINS); in twl4030_pwmled_enable()
124 dev_err(pwmchip_parent(chip), "%s: Failed to enable PWM\n", pwm->label); in twl4030_pwmled_enable()
132 struct pwm_device *pwm) in twl4030_pwmled_disable() argument
141 dev_err(pwmchip_parent(chip), "%s: Failed to read LEDEN\n", pwm->label); in twl4030_pwmled_disable()
145 val &= ~TWL4030_LED_TOGGLE(pwm->hwpwm, TWL4030_LED_PINS); in twl4030_pwmled_disable()
149 dev_err(pwmchip_parent(chip), "%s: Failed to disable PWM\n", pwm->label); in twl4030_pwmled_disable()
155 static int twl4030_pwmled_apply(struct pwm_chip *chip, struct pwm_device *pwm, in twl4030_pwmled_apply() argument
164 if (pwm->state.enabled) in twl4030_pwmled_apply()
165 twl4030_pwmled_disable(chip, pwm); in twl4030_pwmled_apply()
172 * pwm->state.period && state->duty_cycle == pwm->state.duty_cycle in twl4030_pwmled_apply()
175 * pwm->state might not be configured in hardware. in twl4030_pwmled_apply()
177 ret = twl4030_pwmled_config(chip, pwm, in twl4030_pwmled_apply()
182 if (!pwm->state.enabled) in twl4030_pwmled_apply()
183 ret = twl4030_pwmled_enable(chip, pwm); in twl4030_pwmled_apply()
193 static int twl6030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm, in twl6030_pwmled_config() argument
205 dev_err(pwmchip_parent(chip), "%s: Failed to configure PWM\n", pwm->label); in twl6030_pwmled_config()
210 static int twl6030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm) in twl6030_pwmled_enable() argument
220 pwm->label); in twl6030_pwmled_enable()
229 dev_err(pwmchip_parent(chip), "%s: Failed to enable PWM\n", pwm->label); in twl6030_pwmled_enable()
237 struct pwm_device *pwm) in twl6030_pwmled_disable() argument
247 pwm->label); in twl6030_pwmled_disable()
256 dev_err(pwmchip_parent(chip), "%s: Failed to disable PWM\n", pwm->label); in twl6030_pwmled_disable()
262 static int twl6030_pwmled_apply(struct pwm_chip *chip, struct pwm_device *pwm, in twl6030_pwmled_apply() argument
267 if (state->polarity != pwm->state.polarity) in twl6030_pwmled_apply()
271 if (pwm->state.enabled) in twl6030_pwmled_apply()
272 twl6030_pwmled_disable(chip, pwm); in twl6030_pwmled_apply()
277 err = twl6030_pwmled_config(chip, pwm, in twl6030_pwmled_apply()
282 if (!pwm->state.enabled) in twl6030_pwmled_apply()
283 err = twl6030_pwmled_enable(chip, pwm); in twl6030_pwmled_apply()
288 static int twl6030_pwmled_request(struct pwm_chip *chip, struct pwm_device *pwm) in twl6030_pwmled_request() argument
298 pwm->label); in twl6030_pwmled_request()
307 dev_err(pwmchip_parent(chip), "%s: Failed to request PWM\n", pwm->label); in twl6030_pwmled_request()
314 static void twl6030_pwmled_free(struct pwm_chip *chip, struct pwm_device *pwm) in twl6030_pwmled_free() argument
324 pwm->label); in twl6030_pwmled_free()
333 dev_err(pwmchip_parent(chip), "%s: Failed to free PWM\n", pwm->label); in twl6030_pwmled_free()
391 MODULE_DESCRIPTION("PWM driver for TWL4030 and TWL6030 LED outputs");