bq25703_get_vbat(9)
π bq25703_get_vbat β get that battery voltage, bestie π
okay so this is a section 9 Kernel API Manual page (bq25703_get_vbat(9)), and it's literally just one little function that goes and fetches the battery voltage for you. short page, but it's a whole vibe π¦
β¨ NAME β¨
bq25703_get_vbat β Get the reported voltage from the battery π
πΈ SYNOPSIS πΈ
int bq25703_get_vbat (struct bq257xx_chg *pdata , int *intval );
like, that's the whole thing. two args, returns an int. no cap π
π ARGUMENTS π
pdataβ driver platform data. it's yourstruct bq257xx_chg *bestie, the whole charger context basically π«Άintvalβ value of reported battery voltage. pointer to anint, and this is where the voltage lands when the call is done β¨
π DESCRIPTION π
Read value of battery voltage into intval. that's it, that's the function π it literally reads the battery voltage and drops it into your intval β very much giving "small function, big responsibility" main character energy π
β RETURN β
Returns 0 on success or error if unable to read value. so like, check the return before you trust the number, bestie β 0 is the slay case, anything else means the read didn't happen π
π§ SEE ALSO π§
the whole fam, iykyk:
- 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)bq25792_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, bestie!! π this lil baddie lives in ./drivers/power/supply, and the version of record here is dated October 2026 π go read it, love it, call it with a valid intval pointer β mwah π«Άβ¨
π¦ 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