bq25792_read16(9)
π bq25792_read16 β the "just read the register bestie" page π
okay so you found the Kernel API Manual page for bq25792_read16(9) and honestly? it's a little cutie. it does exactly one thing and it does it slayfully. let's get into it π«Ά
β¨ NAME β¨
bq25792_read16 β Read a 16-bit value from device register
that's it. that's the whole job. iconic behavior, zero notes π
πΈ SYNOPSIS πΈ
int bq25792_read16 (struct bq257xx_chg *pdata , unsigned int reg , u16
*val );
like, look at her. four things and a return type. a whole vibe β¨
π ARGUMENTS π
bestie you gotta pass all three or it's not gonna work, no cap:
pdataβ the driver platform data π«Ά this is yourstruct bq257xx_chg *and she's carrying everything the driver needs to know about herself.regβ the register address you're reading from π like, which little slot in the chip are we peeking at today.valβ pointer to store the register value π it's au16 *, and this is where the answer lands once the read goes through.
π DESCRIPTION π
so here's the tea: bq25792_read16 reads a 16-bit big-endian value from the BQ25792 device via regmap, and then converts it to CPU byte order for you. π§
that's the whole flow β grab the raw big-endian bytes from the chip, hand them back in whatever byte order your CPU actually speaks. the conversion is the main character here, ok? the way that endianness would otherwise ruin your entire day π
π₯ RETURN π₯
- returns 0 on success β
- returns error on failure to read π
so like, check the return value. please. for me. π
π SEE ALSO π
this is the part where the page just. keeps. going. and we love her for it. every single one of these, fr fr:
Kernel file ./drivers/power/supply/bq257xx_charger.c struct bq257xx_chip_info(9), struct bq257xx_chg(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), 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)
like. an entire friend group. go say hi π
quick vibe check: this page is from ./drivers/power/supply and it's dated October 2026 π¦
k bye, go read some registers 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