From 4c1d81b2b5fa658e9fd5e7151eb40ba71ba676da Mon Sep 17 00:00:00 2001 From: jmcneill Date: Sun, 9 Dec 2007 20:27:42 +0000 Subject: Merge jmcneill-pm branch. --- sys/dev/sysmon/sysmon_power.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'sys/dev/sysmon') 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 -__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 @@ -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. -- cgit