STRUCT CHIP_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct chip_data(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual, section 9 β€” this is the page for struct chip_data, and honestly it's giving "small struct, big responsibilities". πŸ‘‘


✨ NAME ✨

struct chip_data β€” literally exists to maintain the runtime state of SSP for each client chip. that's the whole job. that's the mission. 🫢


🌸 SYNOPSIS 🌸

struct chip_data {
    u32 cr0;
    u16 cr1;
    u16 dmacr;
    u16 cpsr;
    u8 n_bytes;
    bool enable_dma;
    enum ssp_reading read;
    enum ssp_writing write;
    int xfer_type;
 };

like, look at her. nine fields. every single one of them matters. no filler. πŸ’…


πŸŽ€ Members πŸŽ€

okay so let's go field by field, bestie, no skipping, we respect all of them:

  • cr0 β€” the value of control register CR0 of SSP. and heads up: on later ST variants this register is 32 bits wide rather than just 16. so don't go assuming 16, iykyk.
  • cr1 β€” the value of control register CR1 of SSP. simple. iconic. no notes. ✨
  • dmacr β€” the value of the DMA control Register of SSP.
  • cpsr β€” the value of the Clock prescale register.
  • n_bytes β€” how many bytes (power of 2) are reqd for a given data width of the client. power of 2, bestie, don't come in here with 3. 😭
  • enable_dma β€” whether to enable DMA or not. a bool. yes or no. that's it, that's the field.
  • read β€” a function ptr to be used to read when doing xfer for this chip. it's enum ssp_reading, so the read path is part of the vibe.
  • write β€” a function ptr to be used to write when doing xfer for this chip. matching enum ssp_writing energy. πŸ’œ
  • xfer_type β€” polling / interrupt / DMA. pick your fighter. πŸ”₯

πŸ¦‹ Description πŸ¦‹

so the runtime state of the SSP controller is maintained per chip, and it would be set according to the current message that would be served. that's the entire plot. state, per chip, matching whatever message is being served right now. main character energy tbh. 🌟


🌈 SEE ALSO 🌈

go look in the kernel file ./drivers/spi/spi-pl022.c β€” that's where the family lives, fr fr:

all of them. every single one. we do not gatekeep the SEE ALSO section. πŸ’«


and that's the page!! πŸ“ this one comes to you from ./drivers/spi, dated October 2026, and it's the struct chip_data(9) entry in the Kernel API Manual. mwah, go read the pl022 docs next, ily, bye!! πŸ’–πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from