bq25792_read16(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 your struct 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 a u16 *, 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