bq25792_write16(9)
π 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 thestruct 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. anunsigned 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
0on 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:
struct bq257xx_chip_info(9)struct bq257xx_chg(9)bq25792_read16(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)
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
- 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