power_supply...perty_direct(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… power_supply...perty_direct(9) πŸ’…

ok so bestie, welcome to the Kernel API Manual β€” today's main character is power_supply_set_property_direct, and she's lowkey iconic for one very specific reason (we'll get there, promise 🫢).


✨ NAME ✨

power_supply_set_property_direct β€” write a power supply property without checking for extensions πŸŽ€

like, no extension-vibe-check at the door. just straight in. periodt.


🌸 SYNOPSIS 🌸

int power_supply_set_property_direct (struct power_supply *psy , enum
power_supply_property psp , const union power_supply_propval *val );

that's the whole signature, no cap. three args, one int coming back at you πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • psy β€” the power supply itself. the actual girl. the one we're writing to πŸ’…
  • psp β€” the power supply property you wanna write, as an enum power_supply_property. pick your fighter ✨
  • val β€” the value going in, a const union power_supply_propval *. this is the tea being spilled πŸ“

πŸ‘‘ DESCRIPTION πŸ‘‘

ok so here's the whole point: this function writes a power supply property without taking into account any power supply extensions registered on the given power supply. like, it does not care. it does not ask. it does not check. it just writes πŸ”₯

and why would you want that? ngl, this is mostly useful for power supply extensions that want to access their own power supply β€” because if you used power_supply_set_property directly instead, you'd run into a potential deadlock πŸ˜­πŸ’€

so yeah, this isn't just a flex β€” it's the deadlock-avoiding route for extensions touching their own supply. use the direct one, bestie.

⭐ RETURN ⭐

0 on success, or a negative error code on failure. that's it, that's the whole story πŸ™ˆ


🌈 SEE ALSO 🌈

kernel file ./drivers/power/supply/power_supply_core.c β€” go read her, she ate πŸ‘‘

and the whole friend group:


anyway that's the page πŸ’œ this one ships from ./drivers/power/supply, dated October 2026, and it's filed under power_supply...perty_direct(9) in the Kernel API Manual β€” mwah, stan her, bye bestie 🧚✨

πŸ“¦ where this page comes from