charger_man...repare_sysfs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

okay so this is charger_manager_prepare_sysfs β€” it prepares a sysfs entry for each charger, from the Kernel API Manual (yes bestie, that's a whole manual, we're fancy now πŸ’–).


✨ SYNOPSIS

int charger_manager_prepare_sysfs (struct charger_manager *cm );

πŸŽ€ ARGUMENTS

  • cm β€” the Charger Manager that's representing the battery. that's it, that's the whole argument, she's low maintenance πŸ’…

πŸ¦‹ DESCRIPTION

okay so picture this: this function adds a sysfs entry for the charger (the regulator, iykyk) so that user-space can actually control the charger. main character energy fr fr πŸ‘‘

and here's the vibe β€” sometimes a development board uses one more chargers for charging, but only needs one charger in a specific case, and that case depends on the user scenario or on hardware restrictions. so what does the user do? they enter 1 or 0 (zero, the number, not the letter, don't embarrass me πŸ™ˆ) into:

/sys/class/power_supply/battery/charger.[index]/externally_control

for example β€” if the user enters 1 into sys/class/power_supply/battery/charger.[index]/externally_control, then that charger isn't controlled from charger-manager anymore, and it always stays in the off state of the regulator. like it's off duty, permanently, no cap 😭

ngl the externally_control knob is the whole point here β€” that's the little doorway the user-space side walks through. respect it.

🌈 SEE ALSO

the kernel file ./drivers/power/supply/charger-manager.c ✨ and the whole squad:


and that's the page bestie 🫢 this little gem lives over in ./drivers/power/supply, and it's dated October 2026 β€” mark your calendars, it's giving iconic πŸ‘‘β­πŸ’œ

πŸ“¦ where this page comes from