drivers/mmc/host/usdhi6rol0.c
Source file repositories/reference/linux-study-clean/drivers/mmc/host/usdhi6rol0.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mmc/host/usdhi6rol0.c- Extension
.c- Size
- 49586 bytes
- Lines
- 1906
- 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/clk.hlinux/delay.hlinux/device.hlinux/dma-mapping.hlinux/dmaengine.hlinux/highmem.hlinux/interrupt.hlinux/io.hlinux/log2.hlinux/mmc/host.hlinux/mmc/mmc.hlinux/mmc/sd.hlinux/mmc/sdio.hlinux/module.hlinux/pagemap.hlinux/pinctrl/consumer.hlinux/platform_device.hlinux/scatterlist.hlinux/string.hlinux/time.hlinux/virtio.hlinux/workqueue.h
Detected Declarations
struct usdhi6_pagestruct usdhi6_hostenum usdhi6_wait_forfunction usdhi6_writefunction usdhi6_write16function usdhi6_readfunction usdhi6_read16function usdhi6_irq_enablefunction usdhi6_wait_for_respfunction usdhi6_wait_for_brwefunction usdhi6_only_cdfunction usdhi6_mask_allfunction usdhi6_error_codefunction cardfunction usdhi6_sg_prepfunction usdhi6_sg_unmapfunction usdhi6_sg_advancefunction usdhi6_dma_releasefunction usdhi6_dma_stop_unmapfunction usdhi6_dma_completefunction usdhi6_dma_setupfunction usdhi6_dma_startfunction usdhi6_dma_killfunction usdhi6_dma_check_errorfunction usdhi6_dma_kickfunction usdhi6_dma_requestfunction usdhi6_clk_setfunction usdhi6_set_powerfunction usdhi6_resetfunction usdhi6_set_iosfunction usdhi6_timeout_setfunction usdhi6_request_donefunction usdhi6_cmd_flagsfunction usdhi6_rq_startfunction usdhi6_requestfunction usdhi6_get_cdfunction usdhi6_get_rofunction usdhi6_enable_sdio_irqfunction usdhi6_set_pinstatesfunction usdhi6_sig_volt_switchfunction usdhi6_card_busyfunction usdhi6_resp_cmd12function usdhi6_resp_readfunction usdhi6_blk_readfunction usdhi6_blk_writefunction usdhi6_stop_cmdfunction usdhi6_end_cmdfunction usdhi6_read_block
Annotated Snippet
struct usdhi6_page {
struct page *page;
void *mapped; /* mapped page */
};
struct usdhi6_host {
struct mmc_host *mmc;
struct mmc_request *mrq;
void __iomem *base;
struct clk *clk;
/* SG memory handling */
/* Common for multiple and single block requests */
struct usdhi6_page pg; /* current page from an SG */
void *blk_page; /* either a mapped page, or the bounce buffer */
size_t offset; /* offset within a page, including sg->offset */
/* Blocks, crossing a page boundary */
size_t head_len;
struct usdhi6_page head_pg;
/* A bounce buffer for unaligned blocks or blocks, crossing a page boundary */
struct scatterlist bounce_sg;
u8 bounce_buf[512];
/* Multiple block requests only */
struct scatterlist *sg; /* current SG segment */
int page_idx; /* page index within an SG segment */
enum usdhi6_wait_for wait;
u32 status_mask;
u32 status2_mask;
u32 sdio_mask;
u32 io_error;
u32 irq_status;
unsigned long imclk;
unsigned long rate;
bool app_cmd;
/* Timeout handling */
struct delayed_work timeout_work;
unsigned long timeout;
/* DMA support */
struct dma_chan *chan_rx;
struct dma_chan *chan_tx;
bool dma_active;
/* Pin control */
struct pinctrl *pinctrl;
struct pinctrl_state *pins_uhs;
};
/* I/O primitives */
static void usdhi6_write(struct usdhi6_host *host, u32 reg, u32 data)
{
iowrite32(data, host->base + reg);
dev_vdbg(mmc_dev(host->mmc), "%s(0x%p + 0x%x) = 0x%x\n", __func__,
host->base, reg, data);
}
static void usdhi6_write16(struct usdhi6_host *host, u32 reg, u16 data)
{
iowrite16(data, host->base + reg);
dev_vdbg(mmc_dev(host->mmc), "%s(0x%p + 0x%x) = 0x%x\n", __func__,
host->base, reg, data);
}
static u32 usdhi6_read(struct usdhi6_host *host, u32 reg)
{
u32 data = ioread32(host->base + reg);
dev_vdbg(mmc_dev(host->mmc), "%s(0x%p + 0x%x) = 0x%x\n", __func__,
host->base, reg, data);
return data;
}
static u16 usdhi6_read16(struct usdhi6_host *host, u32 reg)
{
u16 data = ioread16(host->base + reg);
dev_vdbg(mmc_dev(host->mmc), "%s(0x%p + 0x%x) = 0x%x\n", __func__,
host->base, reg, data);
return data;
}
static void usdhi6_irq_enable(struct usdhi6_host *host, u32 info1, u32 info2)
{
host->status_mask = USDHI6_SD_INFO1_IRQ & ~info1;
host->status2_mask = USDHI6_SD_INFO2_IRQ & ~info2;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/device.h`, `linux/dma-mapping.h`, `linux/dmaengine.h`, `linux/highmem.h`, `linux/interrupt.h`, `linux/io.h`.
- Detected declarations: `struct usdhi6_page`, `struct usdhi6_host`, `enum usdhi6_wait_for`, `function usdhi6_write`, `function usdhi6_write16`, `function usdhi6_read`, `function usdhi6_read16`, `function usdhi6_irq_enable`, `function usdhi6_wait_for_resp`, `function usdhi6_wait_for_brwe`.
- 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.