ACPI_HP(4)

πŸŽ€ ACPI_HP(4) πŸŽ€ β€” from the Kernel Interfaces Manual, bestie edition

okay so. sit down. hydrate. we're talking about acpi_hp, which is literally the ACPI extras driver for HP laptops. yes THAT kind of driver. the one that actually talks to your weird little BIOS buttons. let's go πŸ’–


✨ NAME ✨

acpi_hp β€” ACPI extras driver for HP laptops. that's it. that's the vibe. πŸ‘‘


✨ SYNOPSIS ✨

so you wanna bake this driver into your kernel? iconic. drop this line into your kernel config file, fr fr:

device acpi_hp

or, if you'd rather load it as a module at boot time (which, lowkey, is the chill way), put this line into loader.conf(5):

acpi_hp_load="YES"

either way you're eating good πŸ“


✨ DESCRIPTION ✨

the acpi_hp driver provides support for the ACPI-controlled features you'll find on HP laptops that rock a WMI enabled BIOS (think HP Compaq 8510p and 6510p, you know the ones).

its main character purpose? giving you an interface β€” reachable via sysctl(8), devd(8) and devfs(8) β€” so your applications can determine and change the status of all sorts of laptop components and BIOS settings. the way that it just... lets you poke things. obsessed. πŸ’…

πŸ¦‹ devd(8) Events πŸ¦‹

devd events that devd(8) catches hand you this info:

system     "ACPI"
subsystem  "HP"
type       The source of the event in the ACPI namespace.  The
           value depends on the model.
notify     Event code (see below).

and here are the event codes, no cap:

  • 0xc0 β€” WLAN on air status changed to 0 (not on air)
  • 0xc1 β€” WLAN on air status changed to 1 (on air)
  • 0xd0 β€” Bluetooth on air status changed to 0 (not on air)
  • 0xd1 β€” Bluetooth on air status changed to 1 (on air)
  • 0xe0 β€” WWAN on air status changed to 0 (not on air)
  • 0xe1 β€” WWAN on air status changed to 1 (on air)

🧚 devfs(8) Device 🧚

you can read /dev/hpcmi to peek at your current BIOS settings πŸ‘€. wanna change how much detail it spills? adjust the cmi_detail sysctl (it's described down below, keep scrolling bestie).


✨ SYSCTL VARIABLES ✨

here's everything that's currently implemented. buckle up, there's a lot, and it's all useful:

🌸 WLAN: 🌸

  • dev.acpi_hp.0.wlan_enabled β€” Toggle WLAN chip activity.
  • dev.acpi_hp.0.wlan_radio β€” (read-only) WLAN radio status (controlled by hardware switch)
  • dev.acpi_hp.0.wlan_on_air β€” (read-only) WLAN on air (chip enabled, hardware switch enabled + enabled in BIOS)
  • dev.acpi_hp.0.wlan_enabled_if_radio_on β€” If set to 1, the WLAN chip will be enabled if the radio is turned on
  • dev.acpi_hp.0.wlan_disable_if_radio_off β€” If set to 1, the WLAN chip will be disabled if the radio is turned off

🌸 Bluetooth: 🌸

  • dev.acpi_hp.0.bt_enabled β€” Toggle Bluetooth chip activity.
  • dev.acpi_hp.0.bt_radio β€” (read-only) Bluetooth radio status (controlled by hardware switch)
  • dev.acpi_hp.0.bt_on_air β€” (read-only) Bluetooth on air (chip enabled, hardware switch enabled + enabled in BIOS)
  • dev.acpi_hp.0.bt_enabled_if_radio_on β€” If set to 1, the Bluetooth chip will be enabled if the radio is turned on
  • dev.acpi_hp.0.bt_disable_if_radio_off β€” If set to 1, the Bluetooth chip will be disabled if the radio is turned off

🌸 WWAN: 🌸

  • dev.acpi_hp.0.wwan_enabled β€” Toggle WWAN chip activity.
  • dev.acpi_hp.0.wwan_radio β€” (read-only) WWAN radio status (controlled by hardware switch)
  • dev.acpi_hp.0.wwan_on_air β€” (read-only) WWAN on air (chip enabled, hardware switch enabled + enabled in BIOS)
  • dev.acpi_hp.0.wwan_enabled_if_radio_on β€” If set to 1, the WWAN chip will be enabled if the radio is turned on
  • dev.acpi_hp.0.wwan_disable_if_radio_off β€” If set to 1, the WWAN chip will be disabled if the radio is turned off

🌈 Misc: 🌈

  • dev.acpi_hp.0.als_enabled β€” Toggle ambient light sensor (ALS)
  • dev.acpi_hp.0.display β€” (read-only) Display status (bitmask)
  • dev.acpi_hp.0.hdd_temperature β€” (read-only) HDD temperature
  • dev.acpi_hp.0.is_docked β€” (read-only) Docking station status (1 if docked)
  • dev.acpi_hp.0.cmi_detail β€” Bitmask to control detail level in /dev/hpcmi output (values can be ORed).
    • 0x01 β€” Show path component of BIOS setting
    • 0x02 β€” Show a list of valid options for the BIOS setting
    • 0x04 β€” Show additional flags of BIOS setting (ReadOnly etc.)
    • 0x08 β€” Query highest BIOS entry instance. This is broken on many HP models and therefore disabled by default.
  • dev.acpi_hp.0.verbose β€” (read-only) Set verbosity level

and psst β€” defaults for all these sysctls can be set in sysctl.conf(5) πŸ’œ


✨ HARDWARE ✨

the acpi_hp driver has been reported to support this hardware:

  • HP Compaq 8510p
  • HP Compaq nx7300

and ngl, it should work on most HP laptops that feature a WMI enabled BIOS. fingers crossed 🀞


✨ FILES ✨

  • /dev/hpcmi β€” Interface to read BIOS settings

✨ EXAMPLES ✨

wanna disable the LAN interface when WLAN on air, and reenable it if it's not? add this to devd.conf(5), it's giving automation:

notify 0 {
        match "system"          "ACPI";
        match "subsystem"       "HP";
        match "notify"          "0xc0";
        action                  "ifconfig em0 up";
};

notify 0 {
        match "system"          "ACPI";
        match "subsystem"       "HP";
        match "notify"          "0xc1";
        action                  "ifconfig em0 down";
};

enable the ambient light sensor:

sysctl dev.acpi_hp.0.als_enabled=1

enable Bluetooth:

sysctl dev.acpi_hp.0.bt_enabled=1

get BIOS settings:

cat /dev/hpcmi

Serial Port                                Disable
Infrared Port                              Enable
Parallel Port                              Disable
Flash Media Reader                         Disable
USB Ports including Express Card slot      Enable
1394 Port                                  Enable
Cardbus Slot                               Disable
Express Card Slot                          Disable
(...)

and set the maximum detail level for /dev/hpcmi output:

sysctl dev.acpi_hp.0.cmi_detail=7

slay. go forth and read your BIOS settings 🫢


✨ SEE ALSO ✨

acpi(4), acpi_wmi(4), sysctl.conf(5), devd(8), devfs(8), sysctl(8)


✨ HISTORY ✨

the acpi_hp device driver first appeared in FreeBSD 8.0. a legend since day one ✨


✨ AUTHORS ✨

the acpi_hp driver was written by Michael Gmelin <freebsd@grem.de>. king behavior πŸ‘‘

it has been inspired by the hp-wmi driver, which implements a subset of these features (hotkeys) on Linux.

this manual page was written by Michael Gmelin <freebsd@grem.de>.


✨ BUGS ✨

⚠️ this driver is experimental, bestie. it has only been tested on i386 on an HP Compaq 8510p which featured all supported wireless devices (WWAN/BT/WLAN). Expect undefined results when operating on different hardware. not a drill, do not test my patience πŸ’€
  • Loading the driver is slow. Reading from /dev/hpcmi is even slower. 😭
  • Additional features like HP specific sensor readings or writing BIOS settings are not supported.

and that's the whole page, diva πŸ’– this was the ACPI_HP(4) page from the Debian manual set, dated June 19, 2015 β€” go be the main character of your own HP laptop's kernel, iykyk πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from