drivers/mmc/host/tmio_mmc.h
Source file repositories/reference/linux-study-clean/drivers/mmc/host/tmio_mmc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/mmc/host/tmio_mmc.h- Extension
.h- Size
- 9724 bytes
- Lines
- 297
- Domain
- Driver Families
- Bucket
- drivers/mmc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/dmaengine.hlinux/highmem.hlinux/io.hlinux/mutex.hlinux/pagemap.hlinux/scatterlist.hlinux/spinlock.hlinux/interrupt.hlinux/workqueue.h
Detected Declarations
struct tmio_mmc_datastruct tmio_mmc_hoststruct tmio_mmc_dma_opsstruct tmio_mmc_hostfunction sd_ctrl_read16function sd_ctrl_read16_repfunction sd_ctrl_read16_and_16_as_32function sd_ctrl_read32function sd_ctrl_read32_repfunction sd_ctrl_read64_repfunction sd_ctrl_write64_repfunction sd_ctrl_write16function sd_ctrl_write16_repfunction sd_ctrl_write32_as_16_and_16function sd_ctrl_write32function sd_ctrl_write32_rep
Annotated Snippet
struct tmio_mmc_dma_ops {
void (*start)(struct tmio_mmc_host *host, struct mmc_data *data);
void (*enable)(struct tmio_mmc_host *host, bool enable);
void (*request)(struct tmio_mmc_host *host,
struct tmio_mmc_data *pdata);
void (*release)(struct tmio_mmc_host *host);
void (*abort)(struct tmio_mmc_host *host);
void (*dataend)(struct tmio_mmc_host *host);
/* optional */
void (*end)(struct tmio_mmc_host *host); /* held host->lock */
bool (*dma_irq)(struct tmio_mmc_host *host);
};
struct tmio_mmc_host {
void __iomem *ctl;
struct mmc_command *cmd;
struct mmc_request *mrq;
struct mmc_data *data;
struct mmc_host *mmc;
struct mmc_host_ops ops;
/* pio related stuff */
struct scatterlist *sg_ptr;
struct scatterlist *sg_orig;
unsigned int sg_len;
unsigned int sg_off;
unsigned int bus_shift;
struct platform_device *pdev;
struct tmio_mmc_data *pdata;
/* DMA support */
bool dma_on;
struct dma_chan *chan_rx;
struct dma_chan *chan_tx;
struct work_struct dma_issue;
struct scatterlist bounce_sg;
u8 *bounce_buf;
/* Track lost interrupts */
struct delayed_work delayed_reset_work;
struct work_struct done;
/* Cache */
u32 sdcard_irq_mask;
u32 sdio_irq_mask;
unsigned int clk_cache;
u32 sdcard_irq_setbit_mask;
u32 sdcard_irq_mask_all;
spinlock_t lock; /* protect host private data */
unsigned long last_req_ts;
struct mutex ios_lock; /* protect set_ios() context */
bool native_hotplug;
bool sdio_irq_enabled;
/* Mandatory callback */
int (*clk_enable)(struct tmio_mmc_host *host);
void (*set_clock)(struct tmio_mmc_host *host, unsigned int clock);
/* Optional callbacks */
void (*clk_disable)(struct tmio_mmc_host *host);
int (*multi_io_quirk)(struct mmc_card *card,
unsigned int direction, int blk_size);
int (*write16_hook)(struct tmio_mmc_host *host, int addr);
void (*reset)(struct tmio_mmc_host *host, bool preserve);
bool (*check_retune)(struct tmio_mmc_host *host, struct mmc_request *mrq);
void (*fixup_request)(struct tmio_mmc_host *host, struct mmc_request *mrq);
unsigned int (*get_timeout_cycles)(struct tmio_mmc_host *host);
void (*sdio_irq)(struct tmio_mmc_host *host);
const struct tmio_mmc_dma_ops *dma_ops;
};
struct tmio_mmc_host *tmio_mmc_host_alloc(struct platform_device *pdev,
struct tmio_mmc_data *pdata);
int tmio_mmc_host_probe(struct tmio_mmc_host *host);
void tmio_mmc_host_remove(struct tmio_mmc_host *host);
void tmio_mmc_do_data_irq(struct tmio_mmc_host *host);
void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
void tmio_mmc_disable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
irqreturn_t tmio_mmc_irq(int irq, void *devid);
int tmio_mmc_host_runtime_suspend(struct device *dev);
int tmio_mmc_host_runtime_resume(struct device *dev);
static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr)
{
Annotation
- Immediate include surface: `linux/dmaengine.h`, `linux/highmem.h`, `linux/io.h`, `linux/mutex.h`, `linux/pagemap.h`, `linux/scatterlist.h`, `linux/spinlock.h`, `linux/interrupt.h`.
- Detected declarations: `struct tmio_mmc_data`, `struct tmio_mmc_host`, `struct tmio_mmc_dma_ops`, `struct tmio_mmc_host`, `function sd_ctrl_read16`, `function sd_ctrl_read16_rep`, `function sd_ctrl_read16_and_16_as_32`, `function sd_ctrl_read32`, `function sd_ctrl_read32_rep`, `function sd_ctrl_read64_rep`.
- Atlas domain: Driver Families / drivers/mmc.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.