ab8500_fg_c...led_capacity(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ab8500_fg_calculate_scaled_capacity(9) ✨

okay so real talk, bestie β€” this is a page from the Kernel API Manual, and today's main character is ab8500_fg_calculate_scaled_capacity. it's giving "small function, big job" energy, and honestly? we're obsessed πŸ’…


🌸 NAME 🌸

ab8500_fg_calculate_scaled_capacity β€” the capacity-scaling girlie of the ab8500 fuel gauge. that's it, that's the vibe. lowkey her whole personality is "make the numbers look right for the people upstairs." πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int ab8500_fg_calculate_scaled_capacity (struct ab8500_fg *di );

like, she takes one pointer and hands you back an int. clean, simple, iconic. no cap. ✨


πŸ’– ARGUMENTS πŸ’–

  • di β€” a pointer to the ab8500_fg structure. that's the fuel-gauge bestie herself, the whole struct, the main character. she needs it, so hand it over 🫢

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea, and it's actually important tea β˜• β€” ab8500_fg_calculate_scaled_capacity calculates the capacity that gets shown to the upper layers. like, the stuff that people (and by people i mean the rest of the kernel and eventually your little battery icon) actually see.

and the way it does that? it scales the capacity so that 100% is the reference β€” pulled from the actual capacity at the moment the charger gets removed, when charging is hanging out in maintenance mode. yeah. that exact moment. that's the moment she cares about. ⚑

so: charger out, maintenance mode, actual capacity in hand β†’ boom, now that's your 100% reference, and everything else gets scaled around it. periodt. πŸ’€πŸ”₯


🌈 SEE ALSO 🌈

okay this is the part where the page just. keeps. going. it's a whole group chat of related symbols and honestly? i respect the commitment πŸ’œ. the kernel file lives at ./drivers/power/supply/ab8500_fg.c and the struct squad rolls deep:

iykyk β€” if you're poking at the ab8500 fuel gauge, you're gonna meet all of these eventually 🧚


fr fr, don't skip the DESCRIPTION β€” the whole "100% reference from the actual capacity on charger removal in maintenance mode" thing is the entire point of this function. miss it and the scaling will confuse you, no cap 😭

and that's the page!! this lil slice of kernel-api goodness is served up from ./drivers/power/supply, dated October 2026, and it's literally the ab8500 fuel gauge's finest hour. go forth, scale that capacity, and slay πŸ’–β­πŸŽ€

πŸ“¦ where this page comes from