STRUCT PL022(9)
π struct pl022(9) β Kernel API Manual π«Ά
okay so bestie, welcome to the β¨ private SSP driver data structure β¨ β this is struct pl022, and it's literally the main character of the PL022 SPI party. every field in here is part of the driver's own little world, no cap. let's get into it π
β¨ NAME β¨
struct pl022 β this is the private SSP driver data structure. that's it, that's the whole vibe. it's giving "backstage pass to the driver," iykyk π
πΈ SYNOPSIS πΈ
struct pl022 {
struct amba_device *adev;
struct vendor_data *vendor;
resource_size_t phybase;
void __iomem *virtbase;
struct clk *clk;
struct spi_controller *host;
struct pl022_ssp_controller *host_info;
struct spi_transfer *cur_transfer;
struct chip_data *cur_chip;
void *tx;
void *tx_end;
void *rx;
void *rx_end;
enum ssp_reading read;
enum ssp_writing write;
u32 exp_fifo_level;
enum ssp_rx_level_trig rx_lev_trig;
enum ssp_tx_level_trig tx_lev_trig;
#ifdef CONFIG_DMA_ENGINE;
struct dma_chan *dma_rx_channel;
struct dma_chan *dma_tx_channel;
struct sg_table sgt_rx;
struct sg_table sgt_tx;
char *dummypage;
bool dma_running;
#endif;
int cur_cs;
};
like, look at her. so organized. so demure. π₯
π¦ Members π¦
okay now the β¨cast of charactersβ¨, one by one, no skips:
adevβ the AMBA device model hookup π«Άvendorβ vendor data for the IP block, every IP block's got lorephybaseβ the physical memory where the SSP device resides, like its actual home addressvirtbaseβ the virtual memory where the SSP is mapped, aka the address it uses when it's out in the worldclkβ the outgoing clock<italic>"SPICLK"</italic>for the SPI bus β°hostβ the SPI framework hookuphost_infoβ controller-specific data from machine setupcur_transferβ pointer to currentspi_transfercur_chipβ pointer to current clients chip (assigned fromcontroller_state)txβ current position in TX buffer to be readtx_endβ end position in TX buffer to be readrxβ current position in RX buffer to be writtenrx_endβ end position in RX buffer to be writtenreadβ the type of read currently going onwriteβ the type of write currently going onexp_fifo_levelβ expected FIFO levelrx_lev_trigβ receive FIFO watermark level which triggers IRQ π¨tx_lev_trigβ transmit FIFO watermark level which triggers IRQ π¨dma_rx_channelβ optional channel for RX DMAdma_tx_channelβ optional channel for TX DMAsgt_rxβ scattertable for the RX transfersgt_txβ scattertable for the TX transferdummypageβ a dummy page used for driving data on the bus with DMA πdma_runningβ indicates whether DMA is in operationcur_csβ current chip select index
quick reminder bestie: the DMA fields (dma_rx_channel,dma_tx_channel,sgt_rx,sgt_tx,dummypage,dma_running) only exist whenCONFIG_DMA_ENGINEis defined β they're tucked inside that#ifdef, so no cap, they're conditional π
π SEE ALSO π
go touch some grass in the kernel file ./drivers/spi/spi-pl022.c, and while you're there say hi to:
struct vendor_data(9), struct chip_data(9), internal_cs_control(9), flush(9), restore_state(9), load_ssp_default_config(9), configure_dma(9), pl022_interrupt_handler(9), pl022_setup(9), pl022_cleanup(9)
all iconic, all linked, periodt π
and that's the whole page, bestie! π§ this one lives over in ./drivers/spi and the version we're looking at is from October 2026 β mwah, go read the source, 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