STRUCT CHARGER_REGULATOR(9)
π struct charger_regulator(9) β¨
okay so bestie, this is a page from the Kernel API Manual, and it's all about struct charger_regulator β the lil struct that handles the regulator side of the charger-manager situation. no cap, it's giving "supporting character who's actually kinda important" energy π
πΈ NAME πΈ
struct charger_regulator β and that's... literally it. the one-liner description? empty. blank. a whole void π the original page leaves it hanging, so we're leaving it hanging too. no spoilers, no invented lore, i don't make the rules π«Ά
π SYNOPSIS π
here's the struct in all its glory, copied character-for-character because i would never mess with the code:
struct charger_regulator {
const char *regulator_name;
struct regulator *consumer;
int externally_control;
struct charger_cable *cables;
int num_cables;
struct attribute_group attr_grp;
struct device_attribute attr_name;
struct device_attribute attr_state;
struct device_attribute attr_externally_control;
struct attribute *attrs[4];
struct charger_manager *cm;
};
look at attrs[4] just sitting there with its hardcoded little size. iconic. tiny. perfect. π₯
β¨ MEMBERS β¨
time for the cast list, let's go member by member π
regulator_nameβ the name of regulator for using charger. that's the label you use to find your regulator, bestie πconsumerβ the regulator consumer for the charger. this is the actual consumer handle the charger is holding onto πexternally_controlβ set this if the charger-manager cannot control the charger, and in that case the charger will be maintained with disabled state. so yeah, it's the "hands off, someone else is driving" flag, and the consequence is real: disabled state, maintained. periodt πcablesβ the array of charger cables to enable/disable charger and set current limit according to constraint data ofstruct charger_cableif only charger cable included in the array of charger cables is attached/detached. yes it's a long one, read it twice, it's literally all load-bearing π§num_cablesβ the number of charger cables. keeping count, always πattr_nameβ the"name"sysfs entry π¦attr_stateβ the"state"sysfs entry π¦attr_externally_controlβ the"externally_control"sysfs entry π¦attrsβ arrays pointing toattr_name/state/externally_controlforattr_g. (that's how it's written on the page βattr_g, not spelled out any further, so we're not gonna guess π)
quick note bestie:attr_grpandcmare definitely in the struct up there, but the Members list on this page doesn't describe them. so i'm not making up descriptions β that would be a vibe violation fr fr β
π¦ SEE ALSO π¦
go read these next, bestie, i'm obsessed with the cross-referencing:
- Kernel file
./include/linux/power/charger-manager.h struct charger_cable(9)struct charger_desc(9)struct charger_manager(9)
and that's a wrap, mwah π this page lives out of ./include/linux/power and it's dated October 2026. blown a kiss to the kernel docs team, they ate π«Άβ¨π
π¦ 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