Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
- index 2ba5c3a..07ca51a 100644
- --- a/drivers/pwm/pwm-imx.c
- +++ b/drivers/pwm/pwm-imx.c
- @@ -16,6 +16,7 @@
- #include <linux/clk.h>
- #include <linux/delay.h>
- #include <linux/io.h>
- +#include <linux/pinctrl/consumer.h>
- #include <linux/pwm.h>
- #include <linux/of.h>
- #include <linux/of_device.h>
- @@ -320,10 +321,27 @@ static int imx_pwm_remove(struct platform_device *pdev)
- return pwmchip_remove(&imx->chip);
- }
- +#ifdef CONFIG_PM_SLEEP
- +static int imx_pwm_suspend(struct device *dev)
- +{
- + return pinctrl_pm_select_sleep_state(dev);
- +}
- +
- +static int imx_pwm_resume(struct device *dev)
- +{
- + return pinctrl_pm_select_default_state(dev);
- +}
- +#endif
- +
- +static const struct dev_pm_ops imx_pwm_pm_ops = {
- + SET_SYSTEM_SLEEP_PM_OPS(imx_pwm_suspend, imx_pwm_resume)
- +};
- +
- static struct platform_driver imx_pwm_driver = {
- .driver = {
- .name = "imx-pwm",
- .of_match_table = imx_pwm_dt_ids,
- + .pm = &imx_pwm_pm_ops,
- },
- .probe = imx_pwm_probe,
- .remove = imx_pwm_remove,
- --
Advertisement
Add Comment
Please, Sign In to add comment