summaryrefslogtreecommitdiff
path: root/sys/dev/sysmon
diff options
context:
space:
mode:
authorjmcneill <jmcneill@NetBSD.org>2007-12-09 20:27:42 +0000
committerjmcneill <jmcneill@NetBSD.org>2007-12-09 20:27:42 +0000
commit4c1d81b2b5fa658e9fd5e7151eb40ba71ba676da (patch)
tree3f8b0d6c63745bde8809b8c6f9e4f6b1514f335e /sys/dev/sysmon
parent3947df41d16da8b387239b9b87789bfbe950a3b2 (diff)
Merge jmcneill-pm branch.
Diffstat (limited to 'sys/dev/sysmon')
-rw-r--r--sys/dev/sysmon/sysmon_power.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/sysmon/sysmon_power.c b/sys/dev/sysmon/sysmon_power.c
index e975082a0a7..d75539bc6dc 100644
--- a/sys/dev/sysmon/sysmon_power.c
+++ b/sys/dev/sysmon/sysmon_power.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_power.c,v 1.32 2007/12/05 17:19:54 pooka Exp $ */
+/* $NetBSD: sysmon_power.c,v 1.33 2007/12/09 20:28:23 jmcneill Exp $ */
/*-
* Copyright (c) 2007 Juan Romero Pardines.
@@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.32 2007/12/05 17:19:54 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.33 2007/12/09 20:28:23 jmcneill Exp $");
#include "opt_compat_netbsd.h"
#include <sys/param.h>
@@ -896,6 +896,23 @@ sysmon_pswitch_event(struct sysmon_pswitch *smpsw, int event)
KASSERT(smpsw != NULL);
+ /*
+ * For pnp specific events, we don't care if the power daemon
+ * is running or not
+ */
+ if (smpsw->smpsw_type == PSWITCH_TYPE_LID) {
+ switch (event) {
+ case PSWITCH_EVENT_PRESSED:
+ pmf_event_inject(NULL, PMFE_CHASSIS_LID_CLOSE);
+ break;
+ case PSWITCH_EVENT_RELEASED:
+ pmf_event_inject(NULL, PMFE_CHASSIS_LID_OPEN);
+ break;
+ default:
+ break;
+ }
+ }
+
if (sysmon_power_daemon != NULL) {
/*
* Create a new dictionary for the event.