diff options
author | Qipeng Zha <qipeng.zha@intel.com> | 2015-10-26 12:58:27 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2015-11-06 14:34:13 +0100 |
commit | f080be27d7d9333e4815655a2cedab91c3aa7acc (patch) | |
tree | 102b1929216c09c2e26e7ecc9dc93e023c549635 /drivers/pwm/pwm-lpss-platform.c | |
parent | 03f00e5311d5d0d3ac716121865cb967259980ca (diff) | |
download | talos-obmc-linux-f080be27d7d9333e4815655a2cedab91c3aa7acc.tar.gz talos-obmc-linux-f080be27d7d9333e4815655a2cedab91c3aa7acc.zip |
pwm: lpss: Add support for runtime PM
To be able to save some power when PWM is not in use, add support for
runtime PM for this driver. This also allows the platform to transition to
low power S0ix states when the system is idle.
Signed-off-by: Huiquan Zhong <huiquan.zhong@intel.com>
Signed-off-by: Qipeng Zha <qipeng.zha@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-lpss-platform.c')
-rw-r--r-- | drivers/pwm/pwm-lpss-platform.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-lpss-platform.c b/drivers/pwm/pwm-lpss-platform.c index a914aacf6757..54433fc6d1a4 100644 --- a/drivers/pwm/pwm-lpss-platform.c +++ b/drivers/pwm/pwm-lpss-platform.c @@ -14,6 +14,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include "pwm-lpss.h" @@ -36,6 +37,10 @@ static int pwm_lpss_probe_platform(struct platform_device *pdev) return PTR_ERR(lpwm); platform_set_drvdata(pdev, lpwm); + + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); + return 0; } @@ -43,6 +48,7 @@ static int pwm_lpss_remove_platform(struct platform_device *pdev) { struct pwm_lpss_chip *lpwm = platform_get_drvdata(pdev); + pm_runtime_disable(&pdev->dev); return pwm_lpss_remove(lpwm); } |