STRUCT SPI_MEM_DIRMAP_DESC(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐ŸŽ€ NAME ๐ŸŽ€

okay so bestie, this is struct spi_mem_dirmap_desc(9) from the Kernel API Manual: the direct mapping descriptor. thatโ€™s the name, and yes itโ€™s giving โ€œtiny struct, big responsibilitiesโ€ energy ๐Ÿ’…โœจ


โœจ SYNOPSIS โœจ

hereโ€™s the literal shape of it, no cap:

struct spi_mem_dirmap_desc {
    struct spi_mem *mem;
    struct spi_mem_dirmap_info info;
    unsigned int nodirmap;
    void *priv;
 };

๐Ÿซถ Members ๐Ÿซถ

  • mem โ€” the SPI memory device this direct mapping is attached to. literally the memory device this mapping is glued to ๐Ÿซถ
  • info โ€” information passed at direct mapping creation time. iykyk, itโ€™s the creation-time info ๐ŸŒธ
  • nodirmap โ€” set to 1 if the SPI controller does not implement ->mem_ops->dirmap_create or when this function returned an error. if nodirmap is true, all spi_mem_dirmap_{read,write}() calls will use spi_mem_exec_op to access the memory. this is a degraded mode that allows spi_mem drivers to use the same code no matter whether the controller supports direct mapping or not ๐Ÿ”ฅ
  • priv โ€” field pointing to controller specific data. thatโ€™s the controllerโ€™s own little private stash ๐ŸŽ€

๐ŸŒธ Description ๐ŸŒธ

Common part of a direct mapping descriptor. this object is created by spi_mem_dirmap_create and controller implementation of ->create_dirmap can create/attach direct mapping resources to the descriptor in the ->priv field. periodt ๐Ÿ’–

itโ€™s literally the shared common piece, and the controller gets to hang its own resources off ->priv โ€” iconic behavior, honestly โœจ


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

Kernel file ./include/linux/spi/spi-mem.h is the main character here, and the whole squad is:

  • enum spi_mem_data_dir(9)
  • struct spi_mem_op(9)
  • struct spi_mem_dirmap_info(9)
  • struct spi_mem(9)
  • spi_mem_set_drvdata(9)
  • spi_mem_get_drvdata(9)
  • struct spi_controller_mem_ops(9)
  • struct spi_controller_mem_caps(9)
  • struct spi_mem_driver(9)

okay thatโ€™s the whole vibe check, bestie! big kisses from source file ./include/linux/spi, dated October 2026, and this little page signs off as struct spi_mem_dirmap_desc(9) ๐Ÿ’–โœจ๐ŸŒˆ

๐Ÿ“ฆ where this page comes from