bq25792_get_cur(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– bq25792_get_cur β€” get the reported current from the battery πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ this one's a tiny little function but it's literally carrying the whole "how much juice is flowing" vibe check for your battery. no cap.


πŸŽ€ NAME πŸŽ€

bq25792_get_cur β€” Get the reported current from the battery

like, the battery. the current. it's giving "tell me what's happening in there" 🫢


✨ SYNOPSIS ✨

int bq25792_get_cur (struct bq257xx_chg *pdata , int *intval );

that's it. two args. slay. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • pdata β€” the driver platform data 🧚 (yeah, the whole charger situation lives in here)
  • intval β€” a pointer where we're gonna stash the battery current value πŸ“

🌸 DESCRIPTION 🌸

so what it does: it reads the current ADC value straight from the device β€” the one that represents the battery's charge or discharge current β€” and hands it back to you in microamps. πŸ”₯

that's the whole plot. no plot twists. it's just reading the ADC and converting the vibe into microamps for you. iconic.


πŸ’œ RETURN πŸ’œ

  • Returns 0 on success ✨
  • or an error on failure to read 😭 (like if the read just did not happen, that's a fail, fr fr)

🌈 SEE ALSO 🌈

okay this list is LONG, buckle up bestie, we're going shopping πŸ›’ β€” first the kernel file and the structs:

  • ./drivers/power/supply/bq257xx_charger.c
  • struct bq257xx_chip_info(9)
  • struct bq257xx_chg(9)

then the low-level register readers/writers:

then all the state getters:

min vsys crew:

the current siblings (hi bestie πŸ‘‹):

charge voltage gworls:

iindpm nation:

vbat babies:

hw init/shutdown duo:

the property girlies:

the event/interrupt/probe crew (main character energy, honestly):


πŸ’€ reminder that intval is a pointer β€” if you hand over garbage, that's on you, not on the function. pass a real int you actually own, mkay? πŸ™ˆ

and that's the whole page!! πŸŽ€ this lil guy lives in ./drivers/power/supply, the notes are from October 2026, and yes β€” the page itself is literally named bq25792_get_cur(9). go read the source, ily, bye πŸ’–βœ¨πŸ«Ά

πŸ“¦ where this page comes from