STRUCT SPMI_DRIVER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct spmi_driver(9) πŸ’–

okay so this is from the Kernel API Manual bestie, and it's literally all about struct spmi_driver β€” the SPMI slave device driver. buckle up, it's short but it's iconic πŸŽ€


🌸 NAME 🌸

struct spmi_driver β€” the SPMI slave device driver. that's it, that's the whole vibe πŸ’…


✨ SYNOPSIS ✨

here's the whole struct, bestie, look at her:

struct spmi_driver {
    struct device_driver driver;
    int (*probe)(struct spmi_device *sdev);
    void (*remove)(struct spmi_device *sdev);
    void (*shutdown)(struct spmi_device *sdev);
 };

πŸŽ€ Members πŸŽ€

  • driver β€” the actual struct device_driver inside. SPMI device drivers should initialize the name and owner field of this structure. don't skip it fr, it's giving "forgot to set owner" energy and nobody wants that πŸ™ˆ
  • probe β€” this one binds this driver to a SPMI device. signature is int (*probe)(struct spmi_device *sdev), okurrr ✨
  • remove β€” unbinds this driver from the SPMI device. void (*remove)(struct spmi_device *sdev), the breakup arc πŸ’”
  • shutdown β€” shuts down this driver. void (*shutdown)(struct spmi_device *sdev), goodbye bestie 🫢

πŸ’« Description πŸ’«

so like, if PM runtime support is desired for a slave (yes that's the actual phrasing, PM runtime support, main character energy for real), a device driver can call pm_runtime_put from their probe routine β€” and then a balancing pm_runtime_get in remove. keep them balanced bestie, it's the law πŸ”₯

PM runtime support for a slave is implemented by issuing a SLEEP command to the slave on runtime_suspend, which transitions the slave into the SLEEP state 😴✨

then on runtime_resume, a WAKEUP command is sent to the slave to bring it back to ACTIVE. wake up babe, new state just dropped β˜€οΈπŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

go read them, iykyk πŸ“šπŸ’œ


and that's the whole page bestie 🧚 lived in ./include/linux, dated October 2026, straight out of the Kernel API Manual β€” mwah, slay, periodt πŸ’…πŸ’–πŸŒŸ

πŸ“¦ where this page comes from