Lines Matching defs:pwm
3 * drivers/pwm/pwm-tegra.c
8 * Based on arch/arm/plat-mxc/pwm.c by Sascha Hauer <s.hauer@pengutronix.de>
45 #include <linux/pwm.h>
97 static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
196 if (!pwm_is_enabled(pwm)) {
203 pwm_writel(pc, pwm->hwpwm, val);
208 if (!pwm_is_enabled(pwm))
214 static int tegra_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
224 val = pwm_readl(pc, pwm->hwpwm);
226 pwm_writel(pc, pwm->hwpwm, val);
231 static void tegra_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
236 val = pwm_readl(pc, pwm->hwpwm);
238 pwm_writel(pc, pwm->hwpwm, val);
243 static int tegra_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
247 bool enabled = pwm->state.enabled;
254 tegra_pwm_disable(chip, pwm);
259 err = tegra_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period);
264 err = tegra_pwm_enable(chip, pwm);
323 pc->rst = devm_reset_control_get_exclusive(&pdev->dev, "pwm");
413 { .compatible = "nvidia,tegra20-pwm", .data = &tegra20_pwm_soc },
414 { .compatible = "nvidia,tegra186-pwm", .data = &tegra186_pwm_soc },
415 { .compatible = "nvidia,tegra194-pwm", .data = &tegra194_pwm_soc },
429 .name = "tegra-pwm",
442 MODULE_ALIAS("platform:tegra-pwm");