STRUCT HID_BATTERY(9)
β¨ struct hid_battery(9) β¨
okay so bestie, welcome to the <pink>Kernel API Manual</pink> π
this whole page is about struct hid_battery β and it literally represents a single battery power supply π like, one (1) battery, living its main character life inside HID land π
πΈ SYNOPSIS πΈ
struct hid_battery {
struct hid_device *dev;
struct power_supply *ps;
__s32 min;
__s32 max;
__s32 report_type;
__s32 report_id;
__s32 report_offset;
__s32 charge_status;
enum hid_battery_status status;
__s32 capacity;
bool avoid_query;
bool present;
ktime_t ratelimit_time;
struct list_head list;
};
no cap, that's the whole vibe right there π now let's do a member-by-member vibe check π΅οΈββοΈ
π¦ Members π¦
devβ pointer to the parenthid_deviceπ like, who's your parent bestie, that's who this ispsβ the power supply instance β‘ that's the actual power-supply object doing the workminβ minimum battery value from HID descriptor π the floor, the bare minimum, we've all been theremaxβ maximum battery value from HID descriptor π the ceiling, the full-glow momentreport_typeβ HID report type (input/feature) π like, which flavor of report is thisreport_idβ HID report ID for this battery π·οΈ gotta know which report belongs to this battery specificallyreport_offsetβ bit offset of the capacity field within its report π§ that's where in the report the capacity field is chillin'charge_statusβ current charging status π like, are we charging or not, bestiestatusβ battery reporting status π the status of the battery's reporting, yep that's the whole bitcapacityβ current battery capacity (0-100) π― literally a percentage, iconic range, no notesavoid_queryβ if true, avoid querying battery (e.g., for stylus) π so like if it'strue, don't go querying the battery β think stylus situationspresentβ if true, battery is present (may be dynamic) β¨ key word: may be dynamic, so it can change on you, don't get too attachedratelimit_timeβ rate limiting for battery reports β³ yes queen, throttle those reportslistβ list node for linking intohid_device's battery list π that's the link-up energy, adding this battery into thehid_device's battery list
π SEE ALSO π
- Kernel file
./include/linux/hid.hπ HID quirks(9)struct hid_driver(9)struct hid_ll_driver(9)module_hid_driver(9)hid_device_io_start(9)hid_device_io_stop(9)hid_map_usage(9)hid_map_usage_clear(9)hid_parse(9)hid_hw_power(9)hid_hw_idle(9)hid_hw_may_wakeup(9)hid_hw_wait(9)hid_report_len(9)
bestie heads up: every one of those is written (9) which means kernel API section 9 β that's the section, not part of the name π«Ά
okay that's the whole page, mwah π this came from ./include/linux, dated October 2026, and it's filed under struct hid_battery(9) β slay, go read the kernel source, ily, bye π§β¨π
π¦ 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