STRUCT SMB_CHIP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 for power_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 the cable_irq will cause a wakeup. bool energy β€” yes or no, that's it 🌈
  • usb_in_i_chan β€” the USB_IN current measurement channel. she measures the current, no big deal ⚑
  • usb_in_v_chan β€” the USB_IN voltage 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