xref: /freebsd/share/man/man4/acpi_hp.4 (revision 1323ec57)
1.\" Copyright (c) 2009 Michael Gmelin
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd June 19, 2015
28.Dt ACPI_HP 4
29.Os
30.Sh NAME
31.Nm acpi_hp
32.Nd "ACPI extras driver for HP laptops"
33.Sh SYNOPSIS
34To compile this driver into the kernel,
35place the following line in your
36kernel configuration file:
37.Bd -ragged -offset indent
38.Cd "device acpi_hp"
39.Ed
40.Pp
41Alternatively, to load the driver as a
42module at boot time, place the following line in
43.Xr loader.conf 5 :
44.Bd -literal -offset indent
45acpi_hp_load="YES"
46.Ed
47.Sh DESCRIPTION
48The
49.Nm
50driver provides support for ACPI-controlled features found on HP laptops
51that use a WMI enabled BIOS (e.g., HP Compaq 8510p and 6510p).
52.Pp
53The main purpose of this driver is to provide an interface,
54accessible via
55.Xr sysctl 8 ,
56.Xr devd 8 and
57.Xr devfs 8 ,
58through which applications can determine and change the status of
59various laptop components and BIOS settings.
60.Ss Xr devd 8 Events
61Devd events received by
62.Xr devd 8
63provide the following information:
64.Pp
65.Bl -tag -width "subsystem" -offset indent -compact
66.It system
67.Qq Li ACPI
68.It subsystem
69.Qq Li HP
70.It type
71The source of the event in the ACPI namespace.
72The value depends on the model.
73.It notify
74Event code (see below).
75.El
76.Pp
77Event codes:
78.Pp
79.Bl -tag -width "0xc0" -offset indent -compact
80.It Li 0xc0
81WLAN on air status changed to 0 (not on air)
82.It Li 0xc1
83WLAN on air status changed to 1 (on air)
84.It Li 0xd0
85Bluetooth on air status changed to 0 (not on air)
86.It Li 0xd1
87Bluetooth on air status changed to 1 (on air)
88.It Li 0xe0
89WWAN on air status changed to 0 (not on air)
90.It Li 0xe1
91WWAN on air status changed to 1 (on air)
92.El
93.Ss Xr devfs 8 Device
94You can read /dev/hpcmi to see your current BIOS settings.
95The detail level can be adjusted by setting the sysctl
96.Va cmi_detail
97as described below.
98.Sh SYSCTL VARIABLES
99The following sysctls are currently implemented:
100.Ss WLAN:
101.Bl -tag -width indent
102.It Va dev.acpi_hp.0.wlan_enabled
103Toggle WLAN chip activity.
104.It Va dev.acpi_hp.0.wlan_radio
105(read-only)
106WLAN radio status (controlled by hardware switch)
107.It Va dev.acpi_hp.0.wlan_on_air
108(read-only)
109WLAN on air (chip enabled, hardware switch enabled + enabled in BIOS)
110.It Va dev.acpi_hp.0.wlan_enabled_if_radio_on
111If set to 1, the WLAN chip will be enabled if the radio is turned on
112.It Va dev.acpi_hp.0.wlan_disable_if_radio_off
113If set to 1, the WLAN chip will be disabled if the radio is turned off
114.El
115.Ss Bluetooth:
116.Bl -tag -width indent
117.It Va dev.acpi_hp.0.bt_enabled
118Toggle Bluetooth chip activity.
119.It Va dev.acpi_hp.0.bt_radio
120(read-only)
121Bluetooth radio status (controlled by hardware switch)
122.It Va dev.acpi_hp.0.bt_on_air
123(read-only)
124Bluetooth on air (chip enabled, hardware switch enabled + enabled in BIOS)
125.It Va dev.acpi_hp.0.bt_enabled_if_radio_on
126If set to 1, the Bluetooth chip will be enabled if the radio is turned on
127.It Va dev.acpi_hp.0.bt_disable_if_radio_off
128If set to 1, the Bluetooth chip will be disabled if the radio is turned off
129.El
130.Ss WWAN:
131.Bl -tag -width indent
132.It Va dev.acpi_hp.0.wwan_enabled
133Toggle WWAN chip activity.
134.It Va dev.acpi_hp.0.wwan_radio
135(read-only)
136WWAN radio status (controlled by hardware switch)
137.It Va dev.acpi_hp.0.wwan_on_air
138(read-only)
139WWAN on air (chip enabled, hardware switch enabled + enabled in BIOS)
140.It Va dev.acpi_hp.0.wwan_enabled_if_radio_on
141If set to 1, the WWAN chip will be enabled if the radio is turned on
142.It Va dev.acpi_hp.0.wwan_disable_if_radio_off
143If set to 1, the WWAN chip will be disabled if the radio is turned off
144.El
145.Ss Misc:
146.Bl -tag -width indent
147.It Va dev.acpi_hp.0.als_enabled
148Toggle ambient light sensor (ALS)
149.It Va dev.acpi_hp.0.display
150(read-only)
151Display status (bitmask)
152.It Va dev.acpi_hp.0.hdd_temperature
153(read-only)
154HDD temperature
155.It Va dev.acpi_hp.0.is_docked
156(read-only)
157Docking station status (1 if docked)
158.It Va dev.acpi_hp.0.cmi_detail
159Bitmask to control detail level in /dev/hpcmi output (values can be ORed).
160.Bl -tag -width "0x01" -offset indent -compact
161.It Li 0x01
162Show path component of BIOS setting
163.It Li 0x02
164Show a list of valid options for the BIOS setting
165.It Li 0x04
166Show additional flags of BIOS setting (ReadOnly etc.)
167.It Li 0x08
168Query highest BIOS entry instance.
169This is broken on many HP models and therefore disabled by default.
170.El
171.It Va dev.acpi_hp.0.verbose
172(read-only)
173Set verbosity level
174.El
175.Pp
176Defaults for these sysctls can be set in
177.Xr sysctl.conf 5 .
178.Sh HARDWARE
179The
180.Nm
181driver has been reported to support the following hardware:
182.Pp
183.Bl -bullet -compact
184.It
185HP Compaq 8510p
186.It
187HP Compaq nx7300
188.El
189.Pp
190It should work on most HP laptops that feature a WMI enabled BIOS.
191.Sh FILES
192.Bl -tag -width ".Pa /dev/hpcmi"
193.It Pa /dev/hpcmi
194Interface to read BIOS settings
195.El
196.Sh EXAMPLES
197The following can be added to
198.Xr devd.conf 5
199in order disable the LAN interface when WLAN on air and reenable if it is not:
200.Bd -literal -offset indent
201notify 0 {
202	match "system"          "ACPI";
203	match "subsystem"       "HP";
204	match "notify"          "0xc0";
205	action                  "ifconfig em0 up";
206};
207
208notify 0 {
209	match "system"          "ACPI";
210	match "subsystem"       "HP";
211	match "notify"          "0xc1";
212	action                  "ifconfig em0 down";
213};
214.Ed
215.Pp
216Enable the ambient light sensor:
217.Bd -literal -offset indent
218sysctl dev.acpi_hp.0.als_enabled=1
219.Ed
220.Pp
221Enable Bluetooth:
222.Bd -literal -offset indent
223sysctl dev.acpi_hp.0.bt_enabled=1
224.Ed
225.Pp
226Get BIOS settings:
227.Bd -literal -offset indent
228cat /dev/hpcmi
229
230Serial Port                                Disable
231Infrared Port                              Enable
232Parallel Port                              Disable
233Flash Media Reader                         Disable
234USB Ports including Express Card slot      Enable
2351394 Port                                  Enable
236Cardbus Slot                               Disable
237Express Card Slot                          Disable
238(...)
239.Ed
240.Pp
241Set maximum detail level for /dev/hpcmi output:
242.Bd -literal -offset indent
243sysctl dev.acpi_hp.0.cmi_detail=7
244.Ed
245.Sh SEE ALSO
246.Xr acpi 4 ,
247.Xr acpi_wmi 4 ,
248.Xr sysctl.conf 5 ,
249.Xr devd 8 ,
250.Xr devfs 8 ,
251.Xr sysctl 8
252.Sh HISTORY
253The
254.Nm
255device driver first appeared in
256.Fx 8.0 .
257.Sh AUTHORS
258.An -nosplit
259The
260.Nm
261driver was written by
262.An Michael Gmelin Aq Mt freebsd@grem.de .
263.Pp
264It has been inspired by hp-wmi driver, which implements a subset of these
265features (hotkeys) on Linux.
266.Bl -tag -width indent
267.It HP CMI whitepaper:
268https://h20331.www2.hp.com/Hpsub/downloads/cmi_whitepaper.pdf
269.It wmi-hp for Linux:
270https://www.kernel.org
271.It WMI and ACPI:
272http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx
273.El
274.Pp
275This manual page was written by
276.An Michael Gmelin Aq Mt freebsd@grem.de .
277.Sh BUGS
278This driver is experimental and has only been tested on i386 on an
279HP Compaq 8510p which featured all supported wireless devices (WWAN/BT/WLAN).
280Expect undefined results when operating on different hardware.
281.Pp
282Loading the driver is slow.
283Reading from
284.Pa /dev/hpcmi
285is even slower.
286.Pp
287Additional features like HP specific sensor readings or writing BIOS
288settings are not supported.
289