If no AC line devices are found, go ahead and notify devd that the system
is on AC power (i.e. not a laptop). This allows power_profile to run once for desktop systems as well, for instance, to set C3 or CPU frequency. MFC after: 2 weeks
This commit is contained in:
parent
7dcb6ea4f6
commit
895e60b801
@ -66,6 +66,7 @@ static int acpi_acad_attach(device_t);
|
||||
static int acpi_acad_ioctl(u_long, caddr_t, void *);
|
||||
static int acpi_acad_sysctl(SYSCTL_HANDLER_ARGS);
|
||||
static void acpi_acad_init_acline(void *arg);
|
||||
static void acpi_acad_ac_only(void *arg);
|
||||
|
||||
static device_method_t acpi_acad_methods[] = {
|
||||
/* Device interface */
|
||||
@ -87,6 +88,8 @@ MODULE_DEPEND(acpi_acad, acpi, 1, 1, 1);
|
||||
|
||||
ACPI_SERIAL_DECL(acad, "ACPI AC adapter");
|
||||
|
||||
SYSINIT(acad, SI_SUB_KTHREAD_IDLE, SI_ORDER_FIRST, acpi_acad_ac_only, NULL);
|
||||
|
||||
static void
|
||||
acpi_acad_get_status(void *context)
|
||||
{
|
||||
@ -244,6 +247,21 @@ acpi_acad_init_acline(void *arg)
|
||||
"acline initialization done, tried %d times\n", retry + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If no AC line devices detected after boot, create an "online" event
|
||||
* so that userland code can adjust power settings accordingly. The default
|
||||
* power profile is "performance" so we don't need to repeat that here.
|
||||
*/
|
||||
static void
|
||||
acpi_acad_ac_only(void __unused *arg)
|
||||
{
|
||||
|
||||
if (devclass_get_count(acpi_acad_devclass) > 0)
|
||||
return;
|
||||
|
||||
acpi_UserNotify("ACAD", ACPI_ROOT_OBJECT, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Public interfaces.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user