STRUCT AX_SPI(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct ax_spi β€” bestie, this is the definition that defines a spi driver instance ✨ like it's literally the blueprint for one whole SPI driver living its main character life 🫢


✨ SYNOPSIS ✨

struct ax_spi {
    void __iomem *regs;
    struct clk *ref_clk;
    struct clk *pclk;
    unsigned int clk_rate;
    u32 speed_hz;
    const u8 *tx_buf;
    u8 *rx_buf;
    int tx_bytes;
    int rx_bytes;
    unsigned int tx_fifo_depth;
    u32 current_rx_fifo_word;
    int bytes_left_in_current_rx_word;
    u32 current_rx_fifo_word_for_irq;
    int bytes_left_in_current_rx_word_for_irq;
    int rx_discard;
    int rx_copy_remaining;
 };

Ok so quick vibe check β€” this is the struct ax_spi from the Kernel API Manual, section 9. Every single field is iconic in its own way, so let's go through them one by one, no skips, no cap πŸ’…


πŸŽ€ Members πŸŽ€

  • regs β€” the virtual address of the SPI controller registers. Like, where the hardware actually lives in memory, spiritually 🏠
  • ref_clk β€” pointer to the peripheral clock. Its lil clock bestie ⏰
  • pclk β€” pointer to the APB clock. Yeah, second clock, she's also invited πŸŽ€
  • clk_rate β€” reference clock rate in Hz. Numbers, we love her πŸ”’
  • speed_hz β€” the current SPI bus clock speed in Hz. Current being the keyword, she can change πŸ‘‘
  • tx_buf β€” pointer to the TX buffer. Sending out the good stuff πŸ“€
  • rx_buf β€” pointer to the RX buffer. Receiving it right back πŸ“₯
  • tx_bytes β€” number of bytes left to transfer. The countdown is real 😭
  • rx_bytes β€” number of bytes requested. Not left β€” requested, important distinction bestie 🫢
  • tx_fifo_depth β€” depth of the TX FIFO. How deep the queue goes, lowkey fascinating 🌊
  • current_rx_fifo_word β€” buffers the 32-bit word read from RXFIFO. One whole word, kept safe 🧚
  • bytes_left_in_current_rx_word β€” bytes to be extracted from the current 32-bit word. Extraction era πŸ”
  • current_rx_fifo_word_for_irq β€” buffers the 32-bit word read from RXFIFO for IRQ. Same energy, IRQ edition ⚑
  • bytes_left_in_current_rx_word_for_irq β€” IRQ bytes to be extracted from the current 32-bit word. Yes the name is long, she earned it πŸ’€
  • rx_discard β€” number of bytes to discard. Bye, not needed πŸ™ˆ
  • rx_copy_remaining β€” number of bytes to copy. The keeper bytes πŸ“

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/spi/spi-axiado.h β€” go read her, she's right there πŸ“–

And that's the whole page, fr fr πŸ’œ huge slay to ./drivers/spi for shipping this one β€” October 2026, struct ax_spi(9), signing off πŸŽ€βœ¨

πŸ“¦ where this page comes from