STRUCT BQ2515X_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct bq2515x_device(9) πŸ’…

okay bestie, so this is a page straight outta the Kernel API Manual β€” it's the whole entire blueprint for struct bq2515x_device, the main character struct for the bq2515x charger driver. it lives in the kernel, it's C, and it's honestly kind of a vibe. let's get into it ✨


πŸ¦‹ NAME πŸ¦‹

struct bq2515x_device β€” and that's it. that's the whole description. just a lonely little dash at the end, no summary, no nothing. it's giving mysterious. πŸ’€ we respect the silence tho.


✨ SYNOPSIS ✨

here's the whole struct, copy-paste exact, no edits, we do not touch the sacred text:

struct bq2515x_device {
    struct power_supply *mains;
    struct power_supply *battery;
    struct regmap *regmap;
    struct device *dev;
    struct gpio_desc *reset_gpio;
    struct gpio_desc *powerdown_gpio;
    struct gpio_desc *ac_detect_gpio;
    struct gpio_desc *ce_gpio;
    const struct bq2515x_info *info;
    char model_name[I2C_NAME_SIZE];
    bool mains_online;
    struct bq2515x_init_data init_data;
 };

lowkey a lot of pointers, but every single one of them is pulling its weight 🫢


🌸 Members 🌸

okay now the good part β€” breakin' down every field like we're doing a group chat roll call:

  • mains β€” the mains properties. that's the mains power supply chest, bestie πŸ’–
  • battery β€” the battery properties. yeah, this one's the battery-side supply, we stan ⭐
  • regmap β€” the register map structure. this is the lil map that tells you where all the registers live πŸ—ΊοΈ
  • dev β€” the device structure. classic. every driver's gotta have one πŸ‘‘
  • reset_gpio β€” the manual reset (MR) pin. press it, reset it, slay πŸ”„
  • powerdown_gpio β€” the low power mode pin. nap time energy 😴
  • ac_detect_gpio β€” the power good (PG) pin. tells you when things are, in fact, good βœ…
  • ce_gpio β€” the charge enable (CE) pin. permission to charge granted, go off πŸ”₯
  • info β€” the device info. all the deets πŸŽ€
  • model_name β€” a string value describing the device model. it's a char array of size I2C_NAME_SIZE, so it knows exactly who it is πŸ’…
  • mains_online β€” a boolean value indicating power supply online. true = we're so back, false = it's over 😭
  • init_data β€” the charger initialization data structure. the starter pack, the origin story 🌱
real talk: every one of these has a type too β€” struct power_supply *, struct regmap *, struct device *, struct gpio_desc *, const struct bq2515x_info *, char model_name[I2C_NAME_SIZE], bool, and struct bq2515x_init_data. no cap, don't forget the types when you're actually writing the code 🧚

πŸ” SEE ALSO πŸ”

go read these next, they're literally the sequel:

  • ./drivers/power/supply/bq2515x_charger.c β€” the actual kernel file, the source of truth πŸ’œ
  • struct bq2515x_init_data(9)
  • struct bq2515x_info(9)

aaand that's the page!! πŸŽ€

little sign-off moment: this blessed documentation came out of ./drivers/power/supply and is dated October 2026 β€” no cap, that's the version and the date, we're just living in the future apparently 🌈⭐ bye bestie, go charge something πŸ’–

πŸ“¦ where this page comes from