STRUCT BQ2515X_DEVICE(9)
π 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β themainsproperties. that's the mains power supply chest, bestie πbatteryβ thebatteryproperties. 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 achararray of sizeI2C_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, andstruct 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
- 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