]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/power/main.c
suspend: enable freeze timeout configuration through sys
[karo-tx-linux.git] / kernel / power / main.c
index b1c26a92ca9f75dc27151c13fb6865455e9942a6..d77663bfedeb071370f584f2bf1e42cd8332e5a4 100644 (file)
@@ -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
@@ -575,6 +599,9 @@ static struct attribute * g[] = {
 #ifdef CONFIG_PM_SLEEP_DEBUG
        &pm_print_times_attr.attr,
 #endif
+#endif
+#ifdef CONFIG_FREEZER
+       &pm_freeze_timeout_attr.attr,
 #endif
        NULL,
 };