bq25792_get_vbat(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– bq25792_get_vbat(9) πŸ’–

okay so this is a page from the Kernel API Manual, and bestie, it's literally a one-job function and it ate. let's get into it ✨


🌸 NAME 🌸

bq25792_get_vbat β€” get the reported voltage from the battery πŸ”‹ like, the whole entire point of this function is to tell you what the battery's voltage is. that's it, that's the vibe.


πŸŽ€ SYNOPSIS πŸŽ€

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

she takes two things and hands you back an int. iconic behavior tbh πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • pdata β€” driver platform data. it's the driver's whole little context situation, you just pass it along 🫢
  • intval β€” pointer to store the battery voltage value. you gotta give her somewhere to put the number, ok? she's not gonna invent a place to stash it πŸ™ˆ

✨ DESCRIPTION ✨

so what she actually does: she reads the current ADC value β€” that's the analog-to-digital converter reading, not vibes β€” representing the battery voltage, and returns it in microvolts. πŸ”₯

that's the whole function. reads the ADC, gives you the battery voltage, in microvolts. no cap, that's it. keep the microvolts in mind though, because if you were expecting volts you are gonna be so confused when the number comes back huge 😭


πŸ’€ RETURN πŸ’€

  • Returns 0 on success πŸŽ‰
  • or error on failure to read value πŸ˜” (yes that's vague, that's what the page says, don't come for me)

πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, fr fr. and also the kernel file herself:

Kernel file ./drivers/power/supply/bq257xx_charger.c


and that's the page!! πŸŽ€ it lives over in ./drivers/power/supply, dated October 2026 β€” mwah, love that for her, drink water bestie πŸ’œπŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from