bq25792_get_cur(9)
π 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
0on 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.cstruct 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 π):
bq25703_get_cur(9)bq25703_get_ichg_cur(9)bq25792_get_ichg_cur(9)bq25703_set_ichg_cur(9)bq25792_set_ichg_cur(9)
charge voltage gworls:
iindpm nation:
vbat babies:
hw init/shutdown duo:
the property girlies:
the event/interrupt/probe crew (main character energy, honestly):
bq257xx_external_power_changed(9)bq257xx_irq_handler_thread(9)bq257xx_parse_dt(9)bq257xx_charger_probe(9)bq257xx_charger_shutdown(9)
π reminder thatintvalis a pointer β if you hand over garbage, that's on you, not on the function. pass a realintyou 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
- 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