STRUCT SMB_CHIP(9)
π STRUCT SMB_CHIP π
okay so bestie, welcome to the kernel API manual page for struct smb_chip β yep, that's the smb chip structure itself, and honestly she's kind of iconic. this is from the struct smb_chip(9) page, and we're gonna go through her field by field because every single member matters, no cap. π«Ά
β¨ NAME β¨
struct smb_chip β the smb chip structure, aka the main character of this whole file π
πΈ SYNOPSIS πΈ
like, here's literally what she looks like, bestie β copy it exactly, don't @ me:
struct smb_chip {
struct device *dev;
const char *name;
unsigned int base;
struct regmap *regmap;
struct power_supply_battery_info *batt_info;
struct delayed_work status_change_work;
int cable_irq;
bool wakeup_enabled;
struct iio_channel *usb_in_i_chan;
struct iio_channel *usb_in_v_chan;
struct power_supply *chg_psy;
};
π¦ Members π¦
okay so let's go through the squad one by one, because each of these is doing her own little job and we stan π
devβ the device reference forpower_supply. she's the link back to the device, periodt πnameβ the platform device name. literally just her name tag at the party β¨baseβ the base address for smb registers. this is where the registers live, fr fr πregmapβ the register map. yep, the actual map to the registers, lowkey essential πΊοΈbatt_infoβ battery data from DT (that's device tree, iykyk) πstatus_change_workβ the worker that handles plug/unplug events. she's the one clocking in every time you plug in your charger, highkey important πcable_irqβ the USB plugin IRQ. the interrupt that fires when the cable gets involved πwakeup_enabledβ tells you if thecable_irqwill cause a wakeup.boolenergy β yes or no, that's it πusb_in_i_chanβ theUSB_INcurrent measurement channel. she measures the current, no big deal β‘usb_in_v_chanβ theUSB_INvoltage measurement channel. and she measures the voltage, matching-set energy π₯chg_psyβ the charger power supply instance. the charger's actual presence in the power supply world π
π SEE ALSO π
- Kernel file
./drivers/power/supply/qcom_smbx.cβ go read the source, bestie, the lore is all in there π§
aaaand that's the whole page! π this gorgeous thing comes from the ./drivers/power/supply corner of the kernel, dated October 2026, and yes she's still struct smb_chip(9) β slay, go forth and read your registers responsibly βπ
π¦ 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