Files
kernel_realme_salaa/include/linux/powersuspend.h
yank555-lu 62741bc1cc kernel/power: POWERSUSPEND v1.8 - squash
kernel/power/powersuspend: new PM kernel driver for Android w/o early…

…_suspend v1.5 (faux123/Yank555.lu)

powersuspend: new PM kernel driver for Android w/o early_suspend

Android early_suspend/late_resume PM kernel driver framework has been
deprecated by Google. This new powersuspend PM kernel driver is a replacement
for it and existing early_suspend drivers can be easily adapted to use this
new replacement driver

Signed-off-by: Paul Reioux <reioux@gmail.com>
powersuspend: fix logci derps :p

Signed-off-by: Paul Reioux <reioux@gmail.com>
kernel/power/powersuspend: remove userspace dependency from powersuspend

make powersuspend not depend on a userspace initiator anymore, but use a hook
in autosleep instead.

Signed-off-by: Paul Reioux <reioux@gmail.com>
kernel/power/powersuspend: add back userpace control w/ default kernel control

make kernel / userspace mode switchable

Signed-off-by: Paul Reioux <reioux@gmail.com>
kernel/power/powersuspend: default to userspace for now

Signed-off-by: Paul Reioux <reioux@gmail.com>
kernel/power/powersuspend: LCD screen on/off hooks (Yank555.lu)

- add an alternative hook for screen on / off detection in the display
  pannel driver
- sleeps  ~0.1s sooner, wakes up ~1s later then autosleep
- clean up source formatting a bit (Paul Reioux)

Signed-off-by: Paul Reioux <reioux@gmail.com>
mdss_dsi_panel.c: add powersuspend hooks

Signed-off-by: Paul Reioux <reioux@gmail.com>
kernel/power/powersuspend: cumulative update to version 1.5

- fix hybrid-kernel mode cannot be set through sysfs

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.4 (Yank555.lu)

- add hybrid-kernel mode (autosleep and panel, first wins)
- default to hybrid-kernel mode
- harmonize debug message with my other stuff
- include all 3 modes as default, so it's only commenting out to change

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.3 (Yank555.lu)

- fix stupid typo
- add an alternative hook for screen on / off detection in the display panel driver
(sleeps ~0.1s sooner, wakes up ~1s later then autosleep)

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.2 (Yank555.lu)

- make kernel / userspace mode switchable

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.1 (Yank555.lu)

- make powersuspend not depend on a userspace initiator anymore, but use a hook in autosleep instead.

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend (faux123)

Android early_suspend/late_resume PM kernel driver framework has been
deprecated by Google. This new powersuspend PM kernel driver is a replacement
for it and existing early_suspend drivers can be easily adapted to use this
new replacement driver

Signed-off-by: Paul Reioux <reioux@gmail.com>
drivers/video/msm/mdss/mdss_dsi_panel.c: update powersuspend hook calls

fix typo!

Change-Id: If9ee91d5ff2ba2d7623865758d0d8cdf582c341c
Signed-off-by: Paul Reioux <reioux@gmail.com>

Removed mdss_dsi_panel.c panel hooks not for exynos/decon display

Signed-off-by: UpInTheAir <upintheair.xda@gmail.com>
Conflicts:
	drivers/video/msm/mdss/mdss_dsi_panel.c

 kernel/power/powersuspend: new PM kernel driver for Android w/o early…

…_suspend v1.6 (faux123/Yank555.lu)

- autosleep hook removed, not working on shamu
- autosleep and hybrid modes removed
- panel mode is now default
- debug output switchable in defconfig

 kernel/power/powersuspend: v1.6.1 add autosleep & hybrid modes

hybrid mode is default

Signed-off-by: UpInTheAir <upintheair.xda@gmail.com>

 kernel/power/powersuspend: new PM kernel driver for Android w/o early…

…_suspend v1.7 (faux123/Yank555.lu)

- do only run state change if change actually requests a new state

Change-Id: I3f3989ce939cd4d60831fb05dc8790cf10bcbd17

Signed-off-by: UpInTheAir <upintheair.xda@gmail.com>
Conflicts:
	kernel/power/powersuspend.c

 kernel/power/powersuspend: new PM kernel driver for Android w/o early…

…_suspend v1.7 (faux123/Yank555.lu)

- fix a #ifdef / #endif derp

Thanx to AuxXxilium (Christian Schulthess) for pointing this out to me !

Change-Id: I5827ea36a69e4a42d6a9196749ccac12c8bee746
Signed-off-by: yank555-lu <yank555.lu@gmail.com>

 powersuspend: add power_suspended boolean for global access

Some routines just need the boolean for whether powersuspend is active or not.

Rather than hooking to the powersuspend on every occasions,
add power_suspended boolean for global access.

Signed-off-by: arter97 <qkrwngud825@gmail.com>

Signed-off-by: UpInTheAir <upintheair.xda@gmail.com>
Conflicts:
	kernel/power/powersuspend.c

 powersuspend: Replaced deprecated singlethread workqueue with updated…

… schedule_work

 powersuspend: add debug sysfs trigger to see how driver work

Signed-off-by: UpInTheAir <upintheair.skyhigh@gmail.com>

 powersuspend: disable debugging by default

Signed-off-by: UpInTheAir <upintheair.skyhigh@gmail.com>

 fix powersuspend compile error

Signed-off-by: morogoku <morogoku@hotmail.com>
2026-01-18 10:58:06 +00:00

48 lines
1.4 KiB
C

/* include/linux/powersuspend.h
*
* Copyright (C) 2007-2008 Google, Inc.
* Copyright (C) 2013 Paul Reioux
*
* Modified by Jean-Pierre Rasquin <yank555.lu@gmail.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _LINUX_POWERSUSPEND_H
#define _LINUX_POWERSUSPEND_H
#include <linux/list.h>
#define POWER_SUSPEND_INACTIVE 0
#define POWER_SUSPEND_ACTIVE 1
#define POWER_SUSPEND_AUTOSLEEP 0 // Use kernel autosleep as hook
#define POWER_SUSPEND_USERSPACE 1 // Use fauxclock as trigger
#define POWER_SUSPEND_PANEL 2 // Use display panel state as hook
#define POWER_SUSPEND_HYBRID 3 // Use display panel state and autosleep as hook
struct power_suspend {
struct list_head link;
void (*suspend)(struct power_suspend *h);
void (*resume)(struct power_suspend *h);
};
void register_power_suspend(struct power_suspend *handler);
void unregister_power_suspend(struct power_suspend *handler);
void set_power_suspend_state_autosleep_hook(int new_state);
void set_power_suspend_state_panel_hook(int new_state);
extern bool power_suspended;
#endif