diff options
Diffstat (limited to 'kernel/power/main.c')
| -rw-r--r-- | kernel/power/main.c | 29 | 
1 files changed, 28 insertions, 1 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index 1c16f9167de..d77663bfede 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -313,7 +313,7 @@ static ssize_t state_show(struct kobject *kobj, struct kobj_attribute *attr,  static suspend_state_t decode_state(const char *buf, size_t n)  {  #ifdef CONFIG_SUSPEND -	suspend_state_t state = PM_SUSPEND_STANDBY; +	suspend_state_t state = PM_SUSPEND_MIN;  	const char * const *s;  #endif  	char *p; @@ -553,6 +553,30 @@ power_attr(pm_trace_dev_match);  #endif /* CONFIG_PM_TRACE */ +#ifdef CONFIG_FREEZER +static ssize_t pm_freeze_timeout_show(struct kobject *kobj, +				      struct kobj_attribute *attr, char *buf) +{ +	return sprintf(buf, "%u\n", freeze_timeout_msecs); +} + +static ssize_t pm_freeze_timeout_store(struct kobject *kobj, +				       struct kobj_attribute *attr, +				       const char *buf, size_t n) +{ +	unsigned long val; + +	if (kstrtoul(buf, 10, &val)) +		return -EINVAL; + +	freeze_timeout_msecs = val; +	return n; +} + +power_attr(pm_freeze_timeout); + +#endif	/* CONFIG_FREEZER*/ +  static struct attribute * g[] = {  	&state_attr.attr,  #ifdef CONFIG_PM_TRACE @@ -576,6 +600,9 @@ static struct attribute * g[] = {  	&pm_print_times_attr.attr,  #endif  #endif +#ifdef CONFIG_FREEZER +	&pm_freeze_timeout_attr.attr, +#endif  	NULL,  };  |