int pre_hibernate(void) { int err = 0; hib_ftrace_buffer(0); /* check free memory status. */ if (bad_memory_status()) { err = -1; goto ERR; } /* Adding userspace program stuffs here before hibernation start */ /* ... */ /* end of adding userspace program stuffs */ /* CAUTION: put any stuff of actions before this line !! */ if (!err) { /* flag to prevent suspend to ram */ system_is_hibernating = true; /* hotplug disable */ hib_hotplug_mode(0); } ERR: pm_wake_unlock("IPOD_HIB_WAKELOCK"); return err; }
static ssize_t wake_unlock_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) { int error = pm_wake_unlock(buf); return error ? error : n; }
int pre_hibernate(void) { int err = 0; // flag to prevent suspend to ram system_is_hibernating = true; pm_wake_unlock("IPOD_HIB_WAKELOCK"); // user space program stuffs before hibernation start return err; }