mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-23 11:18:54 +00:00
Add support for Power Button PMU events on non-ADB macs, such as aluminum
PowerBooks. MFC after: 2 weeks Relnotes: yes
This commit is contained in:
parent
ecc3c92f90
commit
a1afe0bf8e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274733
@ -734,15 +734,15 @@ pmu_intr(void *arg)
|
|||||||
/* if the lid was just closed, notify devd. */
|
/* if the lid was just closed, notify devd. */
|
||||||
if ((resp[2] & PMU_ENV_LID_CLOSED) && (!sc->lid_closed)) {
|
if ((resp[2] & PMU_ENV_LID_CLOSED) && (!sc->lid_closed)) {
|
||||||
sc->lid_closed = 1;
|
sc->lid_closed = 1;
|
||||||
if (devctl_process_running())
|
|
||||||
devctl_notify("PMU", "lid", "close", NULL);
|
devctl_notify("PMU", "lid", "close", NULL);
|
||||||
}
|
}
|
||||||
else if (!(resp[2] & PMU_ENV_LID_CLOSED) && (sc->lid_closed)) {
|
else if (!(resp[2] & PMU_ENV_LID_CLOSED) && (sc->lid_closed)) {
|
||||||
/* if the lid was just opened, notify devd. */
|
/* if the lid was just opened, notify devd. */
|
||||||
if (devctl_process_running())
|
|
||||||
devctl_notify("PMU", "lid", "open", NULL);
|
|
||||||
sc->lid_closed = 0;
|
sc->lid_closed = 0;
|
||||||
|
devctl_notify("PMU", "lid", "open", NULL);
|
||||||
}
|
}
|
||||||
|
if (resp[2] & PMU_ENV_POWER)
|
||||||
|
devctl_notify("PMU", "Button", "pressed", NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,6 +99,7 @@
|
|||||||
|
|
||||||
/* Bits from PMU_GET_LID_STATE or PMU_INT_ENVIRONMENT on core99 */
|
/* Bits from PMU_GET_LID_STATE or PMU_INT_ENVIRONMENT on core99 */
|
||||||
#define PMU_ENV_LID_CLOSED 0x01 /* The lid is closed */
|
#define PMU_ENV_LID_CLOSED 0x01 /* The lid is closed */
|
||||||
|
#define PMU_ENV_POWER 0x08 /* Power Button pressed */
|
||||||
|
|
||||||
/* PMU PMU_POWER_EVENTS commands */
|
/* PMU PMU_POWER_EVENTS commands */
|
||||||
enum {
|
enum {
|
||||||
|
Loading…
Reference in New Issue
Block a user