1*9490d37cSjmc.\" $OpenBSD: power.4,v 1.5 2007/05/31 19:19:54 jmc Exp $ 224e4efaeSmickey.\" 324e4efaeSmickey.\" Copyright (c) 2003 Michael Shalayeff 424e4efaeSmickey.\" All rights reserved. 524e4efaeSmickey.\" 624e4efaeSmickey.\" Redistribution and use in source and binary forms, with or without 724e4efaeSmickey.\" modification, are permitted provided that the following conditions 824e4efaeSmickey.\" are met: 924e4efaeSmickey.\" 1. Redistributions of source code must retain the above copyright 1024e4efaeSmickey.\" notice, this list of conditions and the following disclaimer. 1124e4efaeSmickey.\" 2. Redistributions in binary form must reproduce the above copyright 1224e4efaeSmickey.\" notice, this list of conditions and the following disclaimer in the 1324e4efaeSmickey.\" documentation and/or other materials provided with the distribution. 1424e4efaeSmickey.\" 1524e4efaeSmickey.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1624e4efaeSmickey.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1724e4efaeSmickey.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1824e4efaeSmickey.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 1924e4efaeSmickey.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2024e4efaeSmickey.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF MIND, 2124e4efaeSmickey.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2224e4efaeSmickey.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2324e4efaeSmickey.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2424e4efaeSmickey.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2524e4efaeSmickey.\" 26*9490d37cSjmc.Dd $Mdocdate: May 31 2007 $ 2724e4efaeSmickey.Dt POWER 4 hppa 2824e4efaeSmickey.Os 2924e4efaeSmickey.Sh NAME 3024e4efaeSmickey.Nm power 3184e19619Sjmc.Nd power button and power fail support 3224e4efaeSmickey.Sh SYNOPSIS 3324e4efaeSmickey.Cd "power0 at mainbus?" 3484e19619Sjmc.Sh DESCRIPTION 3524e4efaeSmickey.Tn HP PA-RISC 3624e4efaeSmickeymachines support power failure detection in different forms: 3784e19619Sjmc.Pp 3884e19619Sjmc.Bl -bullet -offset indent -compact 3924e4efaeSmickey.It 4024e4efaeSmickey.Dq soft 4184e19619Sjmcpower button 4224e4efaeSmickey.It 4384e19619Sjmcpower failure interrupt 4424e4efaeSmickey.El 4524e4efaeSmickey.Pp 4624e4efaeSmickeyThe 4724e4efaeSmickey.Nm 482856fbaeSjmcdriver tries its best to determine the power failure condition 4984e19619Sjmcthat is a result of a power button being depressed or a power supply 5024e4efaeSmickeysystem failure or a similar condition. 5184e19619SjmcUpon detection of any of the aforementioned conditions, it tries to gracefully 5284e19619Sjmc.Pq if possible 5384e19619Sjmcshutdown the system through a call to the 5424e4efaeSmickey.Xr boot 9 5524e4efaeSmickeyfunction. 5624e4efaeSmickey.Pp 5784e19619SjmcOn systems equipped with the 5824e4efaeSmickey.Xr lasi 4 5984e19619Sjmcbus adapter, we find a 6024e4efaeSmickey.Dq soft 6184e19619Sjmcpower button which upon depression gives us a signal in the 6224e4efaeSmickey.Dq power register 6324e4efaeSmickeyand thus polling periodically we detect the event. 6484e19619SjmcSince that bit comes directly from the power button without any dampening, 6584e19619Sjmcwe perform a second long delay; 6684e19619Sjmcthus quick transitions off and on will 6724e4efaeSmickey.Em not 6824e4efaeSmickeyresult in a shutdown. 6924e4efaeSmickey.Pp 7084e19619SjmcOn modern systems, an interruption is signalled upon the power 7184e19619Sjmcbutton depression and thus this avoids polling and does not require 7284e19619Sjmc.Pq as does being implemented in hardware 7384e19619Sjmcdampening. 7424e4efaeSmickey.Sh SEE ALSO 7524e4efaeSmickey.Xr intro 4 , 7624e4efaeSmickey.Xr lasi 4 , 77e301b8dbSmickey.Xr pdc 4 , 7824e4efaeSmickey.Xr boot 9 7924e4efaeSmickey.Sh HISTORY 8024e4efaeSmickeyThe 8124e4efaeSmickey.Nm 8224e4efaeSmickeydriver 8324e4efaeSmickeyappeared in 8424e4efaeSmickey.Ox 3.4 . 85