spi_mem_dirmap_create(9)
π spi_mem_dirmap_create(9) β a Kernel API Manual moment β¨
okay so bestie, welcome to the group chat that is the Kernel API Manual, and today's main character is spi_mem_dirmap_create π no cap, this one's a baddie.
πΈ NAME πΈ
spi_mem_dirmap_create β create a direct mapping descriptor π«
β¨ SYNOPSIS β¨
struct spi_mem_dirmap_desc * spi_mem_dirmap_create (struct spi_mem *mem
, const struct spi_mem_dirmap_info *info );
like, look at that signature. it's giving "i know exactly what i'm doing." π«Ά
π¦ ARGUMENTS π¦
memβ the SPI mem device this direct mapping should be created for. literally the whole reason we're here πinfoβ the direct mapping information. all the little deets π
π DESCRIPTION π
okay so this function is out here creating a direct mapping descriptor, and that descriptor can then be used to access the memory via spi_mem_dirmap_read or spi_mem_dirmap_write. iconique behavior, honestly π
and here's the part that ate: if the SPI controller driver does not support direct mapping, this function falls back to an implementation using spi_mem_exec_op β so the caller doesn't have to bother implementing a fallback on their own. like?? it did that so you didn't have to ππ
considerate king energy fr fr.
β RETURN β
- a valid pointer in case of success π
ERR_PTRotherwise π
bestie, always check your pointers. this is not a drill. π
π SEE ALSO π
the kernel file, living over at ./drivers/spi/spi-mem.c ποΈ
and the whole friend group:
spi_controller_dma_map_mem_op_data(9)spi_controller_dma_unmap_mem_op_data(9)spi_mem_supports_op(9)spi_mem_exec_op(9)spi_mem_get_name(9)spi_mem_set_dqs(9)spi_mem_has_dqs(9)spi_mem_adjust_op_size(9)spi_mem_adjust_op_freq(9)spi_mem_calc_op_duration(9)spi_mem_dirmap_destroy(9)devm_spi_mem_dirmap_create(9)devm_spi_mem_dirmap_destroy(9)spi_mem_dirmap_read(9)spi_mem_dirmap_write(9)spi_mem_poll_status(9)spi_mem_driver_register_with_owner(9)spi_mem_driver_unregister(9)
and that's the tea β this page lives in ./drivers/spi, dated October 2026, and it's spi_mem_dirmap_create(9) forever and ever π mwah π go read your docs bestie, ily π§π
π¦ 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