usb_acpi_set_power_state(9)
β¨ usb_acpi_set_power_state(9) β¨
okay so this is a page from the Kernel API Manual and honestly? it's a little baddie for controlling your usb port's power. welcome bestie π
πΈ NAME πΈ
usb_acpi_set_power_state β it literally controls a usb port's power via the acpi power resource. that's the whole vibe. π
π¦ SYNOPSIS π¦
int usb_acpi_set_power_state (struct usb_device *hdev , int index , bool
enable );
yes bestie, she takes three things and she gives you back an int. no cap.
π ARGUMENTS π
hdevβ the USB device that belongs to the usb hub. like, the actual device in question, okay? π«Άindexβ the port index, and it's zero-based (so the first one is0, not1, don't come for me, that's just how it is). π₯enableβ the power state that's expected to be set. it's abool, so it's giving yes/no energy. β¨
π DESCRIPTION π
Heads up, bestie, this is important: before you invoke this function, you gotta use usb_acpi_power_manageable to check whether the usb port even has an acpi power resource. like, do the vibe check first. π
It returns 0 on success β and otherwise a negative errno. so if you get a negative number back, something did not slay. π
π SEE ALSO π
- Kernel file
./drivers/usb/core/usb-acpi.cπ usb_acpi_power_manageable(9)β the one you check with first, remember? πusb_acpi_port_lpm_incapable(9)usb_acpi_add_usb4_devlink(9)
fr fr read the DESCRIPTION again before you call this. the usb_acpi_power_manageable check is not optional, it's main character energy. β
okay that's the whole page, bestie!! π this one lives in ./drivers/usb/core, and it's dated October 2026 β and yeah, she's still usb_acpi_set_power_state(9) through and through. periodt. π§ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms