diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2019-01-25 14:49:53 +0100 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2019-02-18 04:54:22 +0000 |
commit | 2c5198b5deb9d32049e848cfb60c4c5949bbcdfb (patch) | |
tree | 5882d2fa92b4bb88e161d37dcf39cae0addaf094 /drivers | |
parent | 50162a91958ab6eca749d9fc86306e435263ed9a (diff) | |
download | linux-exynos-2c5198b5deb9d32049e848cfb60c4c5949bbcdfb.tar.gz linux-exynos-2c5198b5deb9d32049e848cfb60c4c5949bbcdfb.tar.bz2 linux-exynos-2c5198b5deb9d32049e848cfb60c4c5949bbcdfb.zip |
devfreq: Suspend all devices on system shutdown
This way devfreq core ensures that all its devices will be set to safe
operation points before reboot operation. There are board on which some
aggressive power saving operation points are behind the capabilities of
the bootloader to properly reset the hardware and boot the board. This
way one can avoid board crash early after reboot.
Similar pattern is used in CPUfreq subsystem.
Reported-by: Markus Reichl <m.reichl@fivetechno.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I45467c8e02f7fedf90d1dfd5080e6143a8cb69f7
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/devfreq/devfreq.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 5db7249b89d9..2a08edca35ad 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -23,6 +23,7 @@ #include <linux/devfreq.h> #include <linux/workqueue.h> #include <linux/platform_device.h> +#include <linux/syscore_ops.h> #include <linux/list.h> #include <linux/printk.h> #include <linux/hrtimer.h> @@ -1421,6 +1422,10 @@ static struct attribute *devfreq_attrs[] = { }; ATTRIBUTE_GROUPS(devfreq); +static struct syscore_ops devfreq_syscore_ops = { + .shutdown = devfreq_suspend, +}; + static int __init devfreq_init(void) { devfreq_class = class_create(THIS_MODULE, "devfreq"); @@ -1437,6 +1442,8 @@ static int __init devfreq_init(void) } devfreq_class->dev_groups = devfreq_groups; + register_syscore_ops(&devfreq_syscore_ops); + return 0; } subsys_initcall(devfreq_init); |