STRUCT BQ257XX_CHIP_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct bq257xx_chip_info(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” yes we're in the kernel docs now, and yes you're gonna slay this. this page is literally all about the chip-specific routines for the bq257xx charger family. it's giving "one struct to rule all the chip variants" energy. πŸŽ€


✨ NAME ✨

struct bq257xx_chip_info β€” chip specific routines

like, the whole vibe of this struct is: every chip gets its own little set of routines and defaults, and this is where they live. no cap. πŸ¦‹


🌸 SYNOPSIS 🌸

struct bq257xx_chip_info {
    int default_iindpm_uA;
    int (*bq257xx_hw_init)(struct bq257xx_chg *pdata);
    void (*bq257xx_hw_shutdown)(struct bq257xx_chg *pdata);
    int (*bq257xx_get_state)(struct bq257xx_chg *pdata);
    int (*bq257xx_get_ichg)(struct bq257xx_chg *pdata, int *intval);
    int (*bq257xx_set_ichg)(struct bq257xx_chg *pdata, int ichg);
    int (*bq257xx_get_vbatreg)(struct bq257xx_chg *pdata, int *intval);
    int (*bq257xx_set_vbatreg)(struct bq257xx_chg *pdata, int vbatreg);
    int (*bq257xx_get_iindpm)(struct bq257xx_chg *pdata, int *intval);
    int (*bq257xx_set_iindpm)(struct bq257xx_chg *pdata, int iindpm);
    int (*bq257xx_get_cur)(struct bq257xx_chg *pdata, int *intval);
    int (*bq257xx_get_vbat)(struct bq257xx_chg *pdata, int *intval);
    int (*bq257xx_get_min_vsys)(struct bq257xx_chg *pdata, int *intval);
 };

look at her. one int, a whole bunch of function pointers, and every single one of them takes a struct bq257xx_chg *pdata. she's consistent, she's organized, she's iconic. πŸ‘‘


πŸ’… Members πŸ’…

okay so let's go member by member, bestie, because there are twelve of these and we're doing all of them. no skipping. 🫢

  • default_iindpm_uA β€” the default input current limit, measured in microamps. this is the "just vibing out of the box" number. ⭐
  • bq257xx_hw_init β€” the init function for the hw. it's the wake-up-and-get-ready moment for the hardware. 🌸
  • bq257xx_hw_shutdown β€” the shutdown function for hw. when it's time to log off, this is the one that closes the laptop. πŸ’€
  • bq257xx_get_state β€” gets and updates the state of the hardware. not just a read β€” an update too. she does both. main character energy. ✨
  • bq257xx_get_ichg β€” get the maximum charge current, in uA.
  • bq257xx_set_ichg β€” set the maximum charge current, in uA.
  • bq257xx_get_vbatreg β€” get the maximum charge voltage, in uV.
  • bq257xx_set_vbatreg β€” set the maximum charge voltage, in uV.
  • bq257xx_get_iindpm β€” get the maximum input current, in uA.
  • bq257xx_set_iindpm β€” set the maximum input current, in uA.
  • bq257xx_get_cur β€” get the battery current from the ADC, in uA.
  • bq257xx_get_vbat β€” get the battery voltage from the ADC, in uV.
  • bq257xx_get_min_vsys β€” get the minimum system voltage, in uV.

see how the get/set pairs are just mirroring each other? it's giving symmetry, it's giving balance, it's giving chef's kiss. and yeah, notice the units: current is uA (microamps), voltage is uV (microvolts). don't mix 'em up, bestie β€” iykyk. 🧚


πŸ”₯ SEE ALSO πŸ”₯

so like, if you wanna go deeper (and you know you do), go look at the kernel file <pink>./drivers/power/supply/bq257xx_charger.c</pink> β€” that's where the magic lives. πŸͺ„

and then there's the whole squad, the full friend group, the entire group chat:

go read all of them. yes, all of them. i'll wait. πŸ’œ


ok and one last thing bestie β€” this whole page lives under <cyan>./drivers/power/supply</cyan>, and it's dated October 2026. so go forth, read your structs, and remember: every chip deserves a routine. periodt. πŸ’…πŸŽ€πŸ¦‹
πŸ“¦ where this page comes from