power_supply...perty_direct(9)
π 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 anenum power_supply_property. pick your fighter β¨valβ the value going in, aconst 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:
power_supply_get_by_name(9)power_supply_get_system_batteries(9)power_supply_put_system_batteries(9)power_supply_put(9)power_supply_get_by_reference(9)devm_power_supply_get_by_reference(9)power_supply_temp2resist_simple(9)power_supply_vbat2ri(9)power_supply_ocv2cap_simple(9)power_supply_get_property_direct(9)power_supply_register(9)devm_power_supply_register(9)power_supply_unregister(9)
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
- 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