bq25792_get_vbat(9)
π 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
0on 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
struct bq257xx_chip_info(9)struct bq257xx_chg(9)bq25792_read16(9)bq25792_write16(9)bq25703_get_state(9)bq25792_get_state(9)bq25703_get_min_vsys(9)bq25792_get_min_vsys(9)bq25703_set_min_vsys(9)bq25792_set_min_vsys(9)bq25703_get_cur(9)bq25792_get_cur(9)bq25703_get_ichg_cur(9)bq25792_get_ichg_cur(9)bq25703_set_ichg_cur(9)bq25792_set_ichg_cur(9)bq25703_get_chrg_volt(9)bq25792_get_chrg_volt(9)bq25703_set_chrg_volt(9)bq25792_set_chrg_volt(9)bq25703_get_iindpm(9)bq25792_get_iindpm(9)bq25703_set_iindpm(9)bq25792_set_iindpm(9)bq25703_get_vbat(9)bq25703_hw_init(9)bq25792_hw_init(9)bq25703_hw_shutdown(9)bq25792_hw_shutdown(9)bq257xx_set_charger_property(9)bq257xx_get_charger_property(9)bq257xx_property_is_writeable(9)bq257xx_external_power_changed(9)bq257xx_irq_handler_thread(9)bq257xx_parse_dt(9)bq257xx_charger_probe(9)bq257xx_charger_shutdown(9)
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
- 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