STRUCT SPI_MEM_DIRMAP_INFO(9)
π struct spi_mem_dirmap_info(9) π
okay so bestie, we're in the Kernel API Manual today and the star of the show is struct spi_mem_dirmap_info β literally the "Direct mapping information" struct. no cap, this is the glow-up era of SPI memory docs β¨
πΈ NAME πΈ
struct spi_mem_dirmap_info β Direct mapping information. that's it, that's the whole name, and honestly? it ate. π
β¨ SYNOPSIS β¨
here's the whole struct, copy it exactly, don't touch a single character, i'm watching π
struct spi_mem_dirmap_info {
struct spi_mem_op *op_tmpl;
struct spi_mem_op primary_op_tmpl;
struct spi_mem_op secondary_op_tmpl;
u64 offset;
u64 length;
};
π«Ά Members π«Ά
op_tmplβ the operation template that the direct mapping should use when the memory device gets accessed. this is the main character of the whole struct, fr fr πsecondary_op_tmplβ a secondary template, and it may be used as an alternative to the primary template. who decides? the upper layer, so don't @ us πoffsetβ the absolute offset this direct mapping is pointing to πlengthβ the length in byte of this direct mapping. yes, byte, singular, that's how the manpage says it and i'm not about to fight it π
lowkey side note: you'll clock primary_op_tmpl chilling in the struct up there in the synopsis, but this manpage's Members list doesn't give it its own blurb. i'm not gonna invent lore for it β iykyk π
π Description π
so what are these information for? the controller-specific implementation uses them to know two things: which portion of memory is directly mapped, and which spi_mem_op it should use to access the device. two vibes, one struct, we love efficient communication π
and here's the β οΈ caution β οΈ part, so listen up: a direct mapping is only valid for one direction (read or write). one. direction. periodt. and that direction is directly encoded in the ->op_tmpl.data.dir field β so it's not hiding, it's just sitting there in plain sight π
π₯ SEE ALSO π₯
go read these next, bestie, they're all in the same friend group:
- Kernel file
./include/linux/spi/spi-mem.h enum spi_mem_data_dir(9)struct spi_mem_op(9)struct spi_mem_dirmap_desc(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 page, we're done here π¦ this iconic little writeup lives in ./include/linux/spi and it's dated October 2026 β mwah, sending you off with a struct spi_mem_dirmap_info(9) and a kiss ππ§ββοΈβ
π¦ 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