STRUCT S3C_SDHCI_PLATDATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct s3c_sdhci_platdata(9) β€” the Samsung SDHCI platform data glow-up ✨

okay bestie, so this is from the Kernel API Manual and it's literally the blueprint for how Samsung SDHCI controllers get configured. it's giving "backstage pass to the hardware" energy, and you're gonna understand every single field by the end. no cap. 🫢


🌸 SYNOPSIS 🌸

like, here's the whole struct in all its glory β€” copy it exactly, don't touch a single semicolon:

struct s3c_sdhci_platdata {
    unsigned int    max_width;
    unsigned int    host_caps;
    unsigned int    host_caps2;
    unsigned int    pm_caps;
    enum cd_types   cd_type;
    int ext_cd_gpio;
    bool ext_cd_gpio_invert;
    int (*ext_cd_init)(void (*notify_func)(struct platform_device *, int
state));
    int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *,
int state));
    void (*cfg_gpio)(struct platform_device *dev, int width);
 };

πŸŽ€ Members πŸŽ€

every field is a main character, so let's give them all their moment:

  • max_width β€” the max number of data bits this thing can handle. literally the width limit, periodt. πŸ’…
  • host_caps β€” the standard MMC host capabilities bit field. the O.G. capabilities slot.
  • host_caps2 β€” the second standard MMC host capabilities bit field. because one bit field was not enough, and honestly? slay. ✨
  • cd_type β€” the type of Card Detection method (peep the cd_types enum above, iykyk).
  • ext_cd_gpio β€” the gpio pin used for the external CD line, but only valid if cd_type == S3C_SDHCI_CD_GPIO. so don't come for this field unless that condition is met, bestie. πŸ™ˆ
  • ext_cd_gpio_invert β€” inverts the values for the external CD gpio line. flip it, reverse it, that's the vibe. πŸ”„
  • ext_cd_init β€” initializes the external card detect subsystem. it gets called on sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL. the notify_func argument is a callback to the sdhci-s3c driver that triggers the card detection event. and the callback arguments? dev is a pointer to the platform device of the host controller, and state is the new state of the card (0 - removed, 1 - inserted). so basically it's the "hey bestie, card's here or gone" hotline. πŸ“ž
  • ext_cd_cleanup β€” cleans up the external card detect subsystem. called on sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL. the notify_func argument is the same callback as for ext_cd_init. so it's the "we're done here, thanks for everything" moment. 🧹
  • cfg_gpio β€” configures the GPIO for a specific card bit-width. you give it dev and width and it does the pin magic. iconic. πŸ”§

🌈 Description 🌈

so like, this whole struct is initialisation data β€” specific to either the machine or the platform β€” for the device driver to use or call-back when it's configuring gpio or card speed information. think of it as the little instruction card the driver reads before it does its thing. it's not the driver itself, it's the vibe the driver needs. πŸ’«


πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./include/linux/platform_data/mmc-sdhci-s3c.h β€” go read it, it's literally right there and it's lowkey essential. πŸ“š

and that's the whole page, bestie. this gem comes from ./include/linux/platform_data and it's dated October 2026 β€” so yeah, it's giving future-forward kernel energy. stay slaying, and remember: always check your cd_type before touching ext_cd_gpio. πŸ«‘πŸ’œ

πŸ“¦ where this page comes from