9 #include <linux/module.h>
12 #include <linux/slab.h>
25 static const unsigned short pwm_to_gptimer_per[] = {
42 priv->
pin = pwm_to_gptimer_per[pwm->
hwpwm];
66 int duty_ns,
int period_ns)
69 unsigned long period, duty;
70 unsigned long long val;
76 val = (
unsigned long long)period * duty_ns;
94 enable_gptimer(priv->
pin);
103 disable_gptimer(priv->
pin);
106 static struct pwm_ops bfin_pwm_ops = {
107 .request = bfin_pwm_request,
108 .free = bfin_pwm_free,
109 .config = bfin_pwm_config,
110 .enable = bfin_pwm_enable,
111 .disable = bfin_pwm_disable,
122 dev_err(&pdev->
dev,
"failed to allocate memory\n");
126 platform_set_drvdata(pdev, pwm);
129 pwm->
chip.ops = &bfin_pwm_ops;
135 dev_err(&pdev->
dev,
"pwmchip_add() failed: %d\n", ret);
153 .probe = bfin_pwm_probe,