bq25792_write16(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… bq25792_write16(9) β€” like, the Kernel API Manual, bestie ✨

okay so picture this: it's a (9) kernel API page, right, and it's all about bq25792_write16, which is genuinely the most "small but mighty" function ever. sending 16 whole bits to a charger chip. iconic behavior only. πŸŽ€


✨ NAME ✨

bq25792_write16 β€” bestie, this is the one that writes a 16-bit value to a device register. that's the whole vibe check. πŸ’–


🌸 SYNOPSIS 🌸

int bq25792_write16 (struct bq257xx_chg *pdata , unsigned int reg , u16 val );

like yes, it returns an int, and yes it takes those three things. look at her go 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • pdata β€” the driver platform data. it's the struct bq257xx_chg * situation, the whole context of who we're talking to. main character energy fr fr.
  • reg β€” the register address you're writing to. an unsigned int, bestie. pick wisely πŸ’…
  • val β€” the 16-bit value you're writing (u16), and it's in CPU byte order btw. keep that in mind, it matters later πŸ‘€

πŸ’œ DESCRIPTION πŸ’œ

so what does she actually do? she converts that value you gave her to big-endian, and then she writes that 16-bit value out to the BQ25792 device via regmap. that's it. that's the whole job. no cap, no extra steps, just endian conversion and a regmap write. and honestly? slay. ⭐


πŸ”₯ RETURN πŸ”₯

  • returns 0 on success πŸŽ‰
  • or an error on failure to write 😭

that's the entire deal. zero means we ate. error means we did not.


🌈 SEE ALSO 🌈

okay this is the part where the whole friend group shows up, so let me introduce everyone. starting with the actual home base:

Kernel file ./drivers/power/supply/bq257xx_charger.c, plus:

the way that's a whole squad 😭🫢 go read them all, iykyk.


lowkey a reminder for future you: the value goes in as CPU byte order and gets flipped to big-endian before it hits the device. don't forget or it's giving chaos πŸ™ˆ

and that's the page! footer check: this one lives in ./drivers/power/supply, dated October 2026, and it's bq25792_write16(9) all day every day. bye bestie, go write some bytes πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from