• Home
  • Raw
  • Download

Lines Matching full:pwm

3  * drivers/pwm/pwm-pxa.c
5 * simple driver for PWM (Pulse Width Modulator) controller
18 #include <linux/pwm.h>
26 /* PWM has_secondary_pwm? */
27 { "pxa25x-pwm", 0 },
28 { "pxa27x-pwm", HAS_SECONDARY_PWM },
29 { "pxa168-pwm", 0 },
30 { "pxa910-pwm", 0 },
35 /* PWM registers and bits definitions */
60 static int pxa_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in pxa_pwm_config() argument
69 offset = pwm->hwpwm ? 0x10 : 0; in pxa_pwm_config()
89 /* NOTE: the clock to PWM has to be enabled first in pxa_pwm_config()
104 static int pxa_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in pxa_pwm_enable() argument
111 static void pxa_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in pxa_pwm_disable() argument
127 * Device tree users must create one device instance for each PWM channel.
129 * code that this is a single channel pxa25x-pwm. Currently all devices are
133 { .compatible = "marvell,pxa250-pwm", .data = &pwm_id_table[0]},
134 { .compatible = "marvell,pxa270-pwm", .data = &pwm_id_table[0]},
135 { .compatible = "marvell,pxa168-pwm", .data = &pwm_id_table[0]},
136 { .compatible = "marvell,pxa910-pwm", .data = &pwm_id_table[0]},
154 struct pwm_device *pwm; in pxa_pwm_of_xlate() local
156 pwm = pwm_request_from_chip(pc, 0, NULL); in pxa_pwm_of_xlate()
157 if (IS_ERR(pwm)) in pxa_pwm_of_xlate()
158 return pwm; in pxa_pwm_of_xlate()
160 pwm->args.period = args->args[0]; in pxa_pwm_of_xlate()
162 return pwm; in pxa_pwm_of_xlate()
168 struct pxa_pwm_chip *pwm; in pwm_probe() local
178 pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL); in pwm_probe()
179 if (pwm == NULL) in pwm_probe()
182 pwm->clk = devm_clk_get(&pdev->dev, NULL); in pwm_probe()
183 if (IS_ERR(pwm->clk)) in pwm_probe()
184 return PTR_ERR(pwm->clk); in pwm_probe()
186 pwm->chip.dev = &pdev->dev; in pwm_probe()
187 pwm->chip.ops = &pxa_pwm_ops; in pwm_probe()
188 pwm->chip.base = -1; in pwm_probe()
189 pwm->chip.npwm = (id->driver_data & HAS_SECONDARY_PWM) ? 2 : 1; in pwm_probe()
192 pwm->chip.of_xlate = pxa_pwm_of_xlate; in pwm_probe()
193 pwm->chip.of_pwm_n_cells = 1; in pwm_probe()
197 pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r); in pwm_probe()
198 if (IS_ERR(pwm->mmio_base)) in pwm_probe()
199 return PTR_ERR(pwm->mmio_base); in pwm_probe()
201 ret = pwmchip_add(&pwm->chip); in pwm_probe()
207 platform_set_drvdata(pdev, pwm); in pwm_probe()
224 .name = "pxa25x-pwm",