usb_acpi_set_power_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 is 0, not 1, don't come for me, that's just how it is). πŸ”₯
  • enable β€” the power state that's expected to be set. it's a bool, 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 🌈


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