STRUCT VARIANT_DATA(9)
β¨ NAME β¨
okay so, from the Kernel API Manual: struct variant_data(9) is literally the MMCI variant-specific quirks bag, bestie. It's giving "one struct to hold all the controller's special-case little eras," and we're obsessed π.
π¦ SYNOPSIS π¦
struct variant_data {
unsigned int clkreg;
unsigned int clkreg_enable;
unsigned int clkreg_8bit_bus_enable;
unsigned int clkreg_neg_edge_enable;
unsigned int cmdreg_cpsm_enable;
unsigned int cmdreg_lrsp_crc;
unsigned int cmdreg_srsp_crc;
unsigned int cmdreg_srsp;
unsigned int cmdreg_stop;
unsigned int datalength_bits;
unsigned int fifosize;
unsigned int fifohalfsize;
unsigned int data_cmd_enable;
unsigned int datactrl_mask_ddrmode;
unsigned int datactrl_mask_sdio;
unsigned int datactrl_blocksz;
u8 datactrl_any_blocksz:1;
u8 dma_power_of_2:1;
u8 datactrl_first:1;
u8 datacnt_useless:1;
u8 st_sdio:1;
u8 st_clkdiv:1;
u8 stm32_clkdiv:1;
u32 pwrreg_powerup;
u32 f_max;
u8 signal_direction:1;
u8 pwrreg_clkgate:1;
u8 busy_detect:1;
u8 busy_timeout:1;
u32 busy_dpsm_flag;
u32 busy_detect_flag;
u32 busy_detect_mask;
u8 pwrreg_nopower:1;
u8 explicit_mclk_control:1;
u8 qcom_fifo:1;
u8 qcom_dml:1;
u8 reversed_irq_handling:1;
u8 mmcimask1:1;
unsigned int irq_pio_mask;
u32 start_err;
u32 opendrain;
u8 dma_lli:1;
bool supports_sdio_irq;
u32 stm32_idmabsize_mask;
u32 stm32_idmabsize_align;
bool dma_flow_controller;
void (*init)(struct mmci_host *host);
};
π Members π
okay bestie, member-by-member tour, no cap π«Ά:
clkregβ default value for theMCICLOCKregister.clkreg_enableβ enable value for theMMCICLOCKregister.clkreg_8bit_bus_enableβ enable value for 8 bit bus.clkreg_neg_edge_enableβ enable value for inverted data/cmd output.cmdreg_cpsm_enableβ enable value for CPSM.cmdreg_lrsp_crcβ enable value for long response with crc.cmdreg_srsp_crcβ enable value for short response with crc.cmdreg_srspβ enable value for short response without crc.cmdreg_stopβ enable value for stop and abort transmission.datalength_bitsβ number of bits in theMMCIDATALENGTHregister.fifosizeβ number of bytes that can be written whenMMCI_TXFIFOEMPTYis asserted (likewise for RX).fifohalfsizeβ number of bytes that can be written whenMCI_TXFIFOHALFEMPTYis asserted (likewise for RX).data_cmd_enableβ enable value for data commands.datactrl_mask_ddrmodeβ ddr mode mask in datactrl register.datactrl_mask_sdioβ SDIO enable mask in datactrl register.datactrl_blockszβ block size in power of two.datactrl_any_blockszβ true if block any block sizes are accepted by hardware, such as with some SDIO traffic that send odd packets.dma_power_of_2β DMA only works with blocks that are a power of 2.datactrl_firstβ true if data must be setup before send command.datacnt_uselessβ true if you could not use datacnt register to read remaining data.st_sdioβ enable ST specific SDIO logic.st_clkdivβ true if using a ST-specific clock divider algorithm.stm32_clkdivβ true if using a STM32-specific clock divider algorithm.pwrreg_powerupβ power up value forMMCIPOWERregister.f_maxβ maximum clk frequency supported by the controller.signal_directionβ input/out direction of bus signals can be indicated.pwrreg_clkgateβMMCIPOWERregister must be used to gate the clock.busy_detectβ true if the variant supports busy detection on DAT0.busy_timeoutβ true if the variant starts data timer when the DPSM enter in Wait_R or Busy state.busy_dpsm_flagβ bitmask enabling busy detection in the DPSM.busy_detect_flagβ bitmask identifying the bit in theMMCISTATUSregister indicating that the card is busy.busy_detect_maskβ bitmask identifying the bit in theMMCIMASK0to mask for getting busy end detection interrupts.pwrreg_nopowerβ bits inMMCIPOWERdon't controls ext. power supply.explicit_mclk_controlβ enable explicit mclk control in driver.qcom_fifoβ enables qcom specific fifo pio read logic.qcom_dmlβ enables qcom specific dma glue for dma transfers.reversed_irq_handlingβ handle data irq before cmd irq.mmcimask1β true if variant have aMMCIMASK1register.irq_pio_maskβ bitmask used to manage interrupt pio transfert in mmcimask register.start_errβ bitmask identifying theSTARTBITERRbit insideMMCISTATUSregister.opendrainβ bitmask identifying theOPENDRAINbit insideMMCIPOWERregister.dma_lliβ true if variant has dma link list feature.supports_sdio_irqβ allow SD I/O card to interrupt the host.stm32_idmabsize_maskβ stm32 sdmmc idma buffer size.dma_flow_controllerβ use peripheral as flow controller for DMA.
π SEE ALSO π
Kernel file ./drivers/mmc/host/mmci.h enum mmci_busy_state(9)β go peek at these too, bestie π¦β¨.
that's the whole page, bestie β source/version: ./drivers/mmc/host, dated October 2026. ππ
π¦ 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