ab8500_fg_get_property(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ab8500_fg_get_property(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸ’… this one's all about ab8500_fg_get_property(9) and honestly it's giving "tiny function, big battery energy" πŸ”‹βœ¨


πŸŽ€ NAME πŸŽ€

ab8500_fg_get_property β€” get the fg properties πŸ’–


🌸 SYNOPSIS 🌸

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

like, three args, one int coming back at you, no cap 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • psy β€” pointer to the power_supply structure. this is the main character of the struct world πŸ‘‘
  • psp β€” pointer to the power_supply_property structure. yeah, the property one, iykyk
  • val β€” pointer to the power_supply_propval union. this is where the good stuff lands πŸ’«

πŸ’œ DESCRIPTION πŸ’œ

so the way that this works: this function gets called when an application tries to get the fg properties by reading the sysfs files. literally just somebody peeking through sysfs and this bad boy answers the door πŸ™ˆ

here's the whole menu of what it can hand back, and ngl this part ate:

  • voltage_now β€” battery voltage ⚑
  • current_now β€” battery instant current
  • current_avg β€” battery average current
  • charge_full_design β€” capacity where battery is considered full πŸ“
  • charge_now β€” battery capacity in nAh
  • capacity β€” capacity in percent πŸ’―
  • capacity_level β€” capacity level
returns error code in case of failure, else 0 on success. so 0 = slay, anything else = something's off 😭

🌈 SEE ALSO 🌈

kernel file ./drivers/power/supply/ab8500_fg.c β€” that's the source of truth bestie, go read it πŸ’€


and that's the whole vibe check bestie, you're officially fg-fluent πŸ§šβ€β™€οΈ

πŸ’Œ cute little sign-off: this page lives in ./drivers/power/supply and it's dated October 2026 β€” periodt. mwah πŸ’‹βœ¨
πŸ“¦ where this page comes from