Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a5fa56c authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by Thierry Reding
Browse files

pwm: rcar: Remove suspend/resume support



According to the Documentation/pwm.txt, all PWM consumers should
implement power management instead of the PWM driver. So, this
patch removes suspend/resume support.

Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarSimon Horman <horms+renesas@verge.net.au>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 7fd4edc5
Loading
Loading
Loading
Loading
+0 −39
Original line number Original line Diff line number Diff line
@@ -254,50 +254,11 @@ static const struct of_device_id rcar_pwm_of_table[] = {
};
};
MODULE_DEVICE_TABLE(of, rcar_pwm_of_table);
MODULE_DEVICE_TABLE(of, rcar_pwm_of_table);


#ifdef CONFIG_PM_SLEEP
static struct pwm_device *rcar_pwm_dev_to_pwm_dev(struct device *dev)
{
	struct rcar_pwm_chip *rcar_pwm = dev_get_drvdata(dev);
	struct pwm_chip *chip = &rcar_pwm->chip;

	return &chip->pwms[0];
}

static int rcar_pwm_suspend(struct device *dev)
{
	struct pwm_device *pwm = rcar_pwm_dev_to_pwm_dev(dev);

	if (!test_bit(PWMF_REQUESTED, &pwm->flags))
		return 0;

	pm_runtime_put(dev);

	return 0;
}

static int rcar_pwm_resume(struct device *dev)
{
	struct pwm_device *pwm = rcar_pwm_dev_to_pwm_dev(dev);
	struct pwm_state state;

	if (!test_bit(PWMF_REQUESTED, &pwm->flags))
		return 0;

	pm_runtime_get_sync(dev);

	pwm_get_state(pwm, &state);

	return rcar_pwm_apply(pwm->chip, pwm, &state);
}
#endif /* CONFIG_PM_SLEEP */
static SIMPLE_DEV_PM_OPS(rcar_pwm_pm_ops, rcar_pwm_suspend, rcar_pwm_resume);

static struct platform_driver rcar_pwm_driver = {
static struct platform_driver rcar_pwm_driver = {
	.probe = rcar_pwm_probe,
	.probe = rcar_pwm_probe,
	.remove = rcar_pwm_remove,
	.remove = rcar_pwm_remove,
	.driver = {
	.driver = {
		.name = "pwm-rcar",
		.name = "pwm-rcar",
		.pm	= &rcar_pwm_pm_ops,
		.of_match_table = of_match_ptr(rcar_pwm_of_table),
		.of_match_table = of_match_ptr(rcar_pwm_of_table),
	}
	}
};
};