21 #include <linux/module.h>
25 #include <linux/slab.h>
27 #define LED_PWM_CTRL1 0xF4
28 #define LED_PWM_CTRL2 0xF5
31 #define PWM_CTRL1_MAX 255
34 #define PWM_CTRL2_DIS_PD (1 << 6)
37 #define PWM_CTRL2_CURR_02 (2 << 4)
40 #define PWM_CTRL2_SRC_VAC (1 << 2)
43 #define PWM_CTRL2_MODE_HW (0 << 0)
44 #define PWM_CTRL2_MODE_SW (1 << 0)
45 #define PWM_CTRL2_MODE_DIS (2 << 0)
47 #define PWM_CTRL2_MODE_MASK 0x3
64 dev_err(chip->
dev,
"%s: Failed to configure PWM, Error %d\n",
73 int duty_ns,
int period_ns)
80 pr_err(
"%s: Failed to configure PWM, Error %d\n",
95 dev_err(chip->
dev,
"%s: Failed to enable PWM, Error %d\n",
106 dev_err(chip->
dev,
"%s: Failed to enable PWM, Error %d\n",
122 dev_err(chip->
dev,
"%s: Failed to disable PWM, Error %d\n",
132 dev_err(chip->
dev,
"%s: Failed to disable PWM, Error %d\n",
137 static const struct pwm_ops twl6030_pwm_ops = {
138 .request = twl6030_pwm_request,
139 .config = twl6030_pwm_config,
140 .enable = twl6030_pwm_enable,
141 .disable = twl6030_pwm_disable,
153 twl6030->
chip.dev = &pdev->
dev;
154 twl6030->
chip.ops = &twl6030_pwm_ops;
155 twl6030->
chip.base = -1;
156 twl6030->
chip.npwm = 1;
162 platform_set_drvdata(pdev, twl6030);
176 .name =
"twl6030-pwm",
178 .probe = twl6030_pwm_probe,