Guest User

Untitled

a guest
Dec 11th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
  2. index 2ba5c3a..07ca51a 100644
  3. --- a/drivers/pwm/pwm-imx.c
  4. +++ b/drivers/pwm/pwm-imx.c
  5. @@ -16,6 +16,7 @@
  6. #include <linux/clk.h>
  7. #include <linux/delay.h>
  8. #include <linux/io.h>
  9. +#include <linux/pinctrl/consumer.h>
  10. #include <linux/pwm.h>
  11. #include <linux/of.h>
  12. #include <linux/of_device.h>
  13. @@ -320,10 +321,27 @@ static int imx_pwm_remove(struct platform_device *pdev)
  14. return pwmchip_remove(&imx->chip);
  15. }
  16.  
  17. +#ifdef CONFIG_PM_SLEEP
  18. +static int imx_pwm_suspend(struct device *dev)
  19. +{
  20. + return pinctrl_pm_select_sleep_state(dev);
  21. +}
  22. +
  23. +static int imx_pwm_resume(struct device *dev)
  24. +{
  25. + return pinctrl_pm_select_default_state(dev);
  26. +}
  27. +#endif
  28. +
  29. +static const struct dev_pm_ops imx_pwm_pm_ops = {
  30. + SET_SYSTEM_SLEEP_PM_OPS(imx_pwm_suspend, imx_pwm_resume)
  31. +};
  32. +
  33. static struct platform_driver imx_pwm_driver = {
  34. .driver = {
  35. .name = "imx-pwm",
  36. .of_match_table = imx_pwm_dt_ids,
  37. + .pm = &imx_pwm_pm_ops,
  38. },
  39. .probe = imx_pwm_probe,
  40. .remove = imx_pwm_remove,
  41. --
Advertisement
Add Comment
Please, Sign In to add comment