STRUCT VARIANT_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 the MCICLOCK register.
  • clkreg_enable β€” enable value for the MMCICLOCK register.
  • 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 the MMCIDATALENGTH register.
  • fifosize β€” number of bytes that can be written when MMCI_TXFIFOEMPTY is asserted (likewise for RX).
  • fifohalfsize β€” number of bytes that can be written when MCI_TXFIFOHALFEMPTY is 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 for MMCIPOWER register.
  • f_max β€” maximum clk frequency supported by the controller.
  • signal_direction β€” input/out direction of bus signals can be indicated.
  • pwrreg_clkgate β€” MMCIPOWER register 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 the MMCISTATUS register indicating that the card is busy.
  • busy_detect_mask β€” bitmask identifying the bit in the MMCIMASK0 to mask for getting busy end detection interrupts.
  • pwrreg_nopower β€” bits in MMCIPOWER don'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 a MMCIMASK1 register.
  • irq_pio_mask β€” bitmask used to manage interrupt pio transfert in mmcimask register.
  • start_err β€” bitmask identifying the STARTBITERR bit inside MMCISTATUS register.
  • opendrain β€” bitmask identifying the OPENDRAIN bit inside MMCIPOWER register.
  • 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