1.\" $NetBSD: nhpow.4,v 1.1 2012/01/15 14:40:15 phx Exp $ 2.\" 3.\" Copyright (c) 2012 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Frank Wille. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd January 15, 2012 31.Dt NHPOW 4 sandpoint 32.Os 33.Sh NAME 34.Nm nhpow 35.Nd driver for the NH-230/231 board control GPIO pins 36.Sh SYNOPSIS 37.Cd "nhpow0 at mainbus0" 38.Cd "gpio* at nhpow0" 39.Sh DESCRIPTION 40This driver initializes the LEDs and the fan speed during boot and 41establishes a reboot and power-off hook in the kernel. 42.Pp 43.Nm 44also detects a soft power-off condition, which is triggered by holding 45the front panel power button pressed for several seconds. 46This driver can optionally invoke 47.Xr powerd 8 48to get a finer control over the system shutdown procedure. 49It is capable of reporting a power-button-pressed event. 50Refer to the 51.Xr powerd 8 52manual section for more details. 53.Pp 54The 55.Nm 56driver provides access to its 8 bidirectional GPIO pins through the 57.Xr gpio 4 58controller interface. 59The pins have the following meaning when being written: 60.Bl -column "Pin" "Active level" "Function" -offset indent 61.It Sy "Pin" Ta Sy "Active level" Ta Sy "Function" 62.It Li "0" Ta "high" Ta "System power off" 63.It Li "1" Ta "high" Ta "Assert system reset to all devices" 64.It Li "2" Ta "low" Ta "Status LED" 65.It Li "3" Ta "high" Ta "High speed fan" 66.It Li "4" Ta "low" Ta "Debug LED 1" 67.It Li "5" Ta "low" Ta "Debug LED 2" 68.It Li "6" Ta "low" Ta "USB port 1 LED" 69.It Li "7" Ta "low" Ta "USB port 2 LED" 70.El 71.Pp 72When reading, the pins have the following meaning: 73.Bl -column "Pin" "Active level" "Function" -offset indent 74.It Sy "Pin" Ta Sy "Active level" Ta Sy "Function" 75.It Li "0" Ta "low" Ta "Power button pressed" 76.It Li "1" Ta "low" Ta "Reset/install button pressed" 77.It Li "4" Ta "high" Ta "H/W version bit 0" 78.It Li "5" Ta "high" Ta "H/W version bit 1" 79.It Li "6" Ta "high" Ta "H/W version bit 2" 80.It Li "7" Ta "high" Ta "H/W version bit 3" 81.El 82.Pp 83.Nm 84attaches automatically for all 85.Tn NH-230/231 86compatible products: 87.Bl -bullet -compact 88.It 89Allnet 6250 90.It 91Allnet 6260 92.It 93Encore ENNHD-1000 94.It 95Fujitsu-Siemens AMS150 96.It 97Fujitsu-Siemens SBLAN2 98.It 99Longshine LCS-8311 100.It 101Netronix NH-230 102.It 103Netronix NH-231 104.It 105Planex NAS-01G 106.El 107.Sh SYSCTL VARIABLES 108The following 109.Xr sysctl 3 110variables are available: 111.Bl -tag -width indent 112.It machdep.nhpow.fan 113Sets the fan speed to high (1) or low (0). 114.El 115.Sh FILES 116.Bl -tag -width /dev/powerX -compact 117.It Pa /dev/power 118event notify channel to 119.Xr powerd 8 . 120.El 121.Sh SEE ALSO 122.Xr gpio 4 , 123.Xr gpioctl 8 , 124.Xr powerd 8 , 125.Xr sysctl 8 126.Sh HISTORY 127The 128.Nm 129driver first appeared in 130.Nx 6.0 . 131.Sh AUTHORS 132The 133.Nm 134driver was written by 135.An Frank Wille . 136