Lines Matching refs:pwm
11 #include <linux/pwm.h>
30 static int bfin_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
35 if (pwm->hwpwm >= ARRAY_SIZE(pwm_to_gptimer_per))
42 priv->pin = pwm_to_gptimer_per[pwm->hwpwm];
50 pwm_set_chip_data(pwm, priv);
55 static void bfin_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
57 struct bfin_pwm *priv = pwm_get_chip_data(pwm);
65 static int bfin_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
68 struct bfin_pwm *priv = pwm_get_chip_data(pwm);
90 static int bfin_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
92 struct bfin_pwm *priv = pwm_get_chip_data(pwm);
99 static void bfin_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
101 struct bfin_pwm *priv = pwm_get_chip_data(pwm);
117 struct bfin_pwm_chip *pwm;
120 pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL);
121 if (!pwm) {
126 platform_set_drvdata(pdev, pwm);
128 pwm->chip.dev = &pdev->dev;
129 pwm->chip.ops = &bfin_pwm_ops;
130 pwm->chip.base = -1;
131 pwm->chip.npwm = 12;
133 ret = pwmchip_add(&pwm->chip);
144 struct bfin_pwm_chip *pwm = platform_get_drvdata(pdev);
146 return pwmchip_remove(&pwm->chip);
151 .name = "bfin-pwm",