diff options
author | nyan <nyan@FreeBSD.org> | 2002-03-08 11:38:00 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2002-03-08 11:38:00 +0000 |
commit | a36826905cb959c8259cfbe2e8e5015c838dcd8b (patch) | |
tree | 73ded394264063354884e09268f3d5e69c530934 /sys/pc98 | |
parent | 0b0678b19306167e152ea68ecd76211842ff3b1a (diff) | |
download | FreeBSD-src-a36826905cb959c8259cfbe2e8e5015c838dcd8b.zip FreeBSD-src-a36826905cb959c8259cfbe2e8e5015c838dcd8b.tar.gz |
MFi386: revision 1.125
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/apm/apm.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/pc98/apm/apm.c b/sys/pc98/apm/apm.c index 925d616..3313512 100644 --- a/sys/pc98/apm/apm.c +++ b/sys/pc98/apm/apm.c @@ -1000,6 +1000,24 @@ apm_record_event(struct apm_softc *sc, u_int event_type) return (sc->sc_flags & SCFLAG_OCTL) ? 0 : 1; /* user may handle */ } +/* Power profile */ +static void +apm_power_profile(struct apm_softc *sc) +{ + int state; + struct apm_info info; + static int apm_acline = 0; + + if (apm_get_info(&info)) + return; + + if (apm_acline != info.ai_acline) { + apm_acline = info.ai_acline; + state = apm_acline ? POWER_PROFILE_PERFORMANCE : POWER_PROFILE_ECONOMY; + power_profile_set_state(state); + } +} + /* Process APM event */ static void apm_processevent(void) @@ -1069,6 +1087,7 @@ apm_processevent(void) break; OPMEV_DEBUGMESSAGE(PMEV_POWERSTATECHANGE); apm_record_event(sc, apm_event); + apm_power_profile(sc); break; OPMEV_DEBUGMESSAGE(PMEV_UPDATETIME); apm_record_event(sc, apm_event); @@ -1076,6 +1095,7 @@ apm_processevent(void) break; OPMEV_DEBUGMESSAGE(PMEV_CAPABILITIESCHANGE); apm_record_event(sc, apm_event); + apm_power_profile(sc); break; case PMEV_NOEVENT: break; |