drivers/mmc/host/omap_hsmmc.c
Source file repositories/reference/linux-study-clean/drivers/mmc/host/omap_hsmmc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mmc/host/omap_hsmmc.c- Extension
.c- Size
- 53786 bytes
- Lines
- 2123
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/init.hlinux/kernel.hlinux/debugfs.hlinux/dmaengine.hlinux/seq_file.hlinux/sizes.hlinux/interrupt.hlinux/delay.hlinux/dma-mapping.hlinux/platform_device.hlinux/timer.hlinux/clk.hlinux/of.hlinux/of_irq.hlinux/of_device.hlinux/mmc/host.hlinux/mmc/core.hlinux/mmc/mmc.hlinux/mmc/slot-gpio.hlinux/io.hlinux/irq.hlinux/regulator/consumer.hlinux/pinctrl/consumer.hlinux/pm_runtime.hlinux/pm_wakeirq.hlinux/platform_data/hsmmc-omap.h
Detected Declarations
struct omap_hsmmc_nextstruct omap_hsmmc_hoststruct omap_mmc_of_datafunction omap_hsmmc_enable_supplyfunction omap_hsmmc_disable_supplyfunction omap_hsmmc_set_pbiasfunction omap_hsmmc_set_powerfunction omap_hsmmc_disable_boot_regulatorfunction omap_hsmmc_disable_boot_regulatorsfunction omap_hsmmc_reg_getfunction omap_hsmmc_start_clockfunction omap_hsmmc_stop_clockfunction omap_hsmmc_enable_irqfunction omap_hsmmc_disable_irqfunction calc_divisorfunction omap_hsmmc_set_clockfunction omap_hsmmc_set_bus_widthfunction omap_hsmmc_set_bus_modefunction omap_hsmmc_context_restorefunction contextfunction omap_hsmmc_context_savefunction omap_hsmmc_show_slot_namefunction omap_hsmmc_start_commandfunction omap_hsmmc_request_donefunction omap_hsmmc_xfer_donefunction omap_hsmmc_cmd_donefunction omap_hsmmc_dma_cleanupfunction omap_hsmmc_dbg_report_irqfunction omap_hsmmc_dbg_report_irqfunction hsmmc_command_incompletefunction omap_hsmmc_do_irqfunction omap_hsmmc_irqfunction set_sd_bus_powerfunction omap_hsmmc_switch_opcondfunction omap_hsmmc_dma_callbackfunction omap_hsmmc_pre_dma_transferfunction omap_hsmmc_setup_dma_transferfunction set_data_timeoutfunction omap_hsmmc_start_dma_transferfunction omap_hsmmc_prepare_datafunction omap_hsmmc_post_reqfunction omap_hsmmc_pre_reqfunction omap_hsmmc_requestfunction omap_hsmmc_set_iosfunction omap_hsmmc_enable_sdio_irqfunction omap_hsmmc_configure_wake_irqfunction omap_hsmmc_conf_bus_powerfunction omap_hsmmc_multi_io_quirk
Annotated Snippet
struct omap_hsmmc_next {
unsigned int dma_len;
s32 cookie;
};
struct omap_hsmmc_host {
struct device *dev;
struct mmc_host *mmc;
struct mmc_request *mrq;
struct mmc_command *cmd;
struct mmc_data *data;
struct clk *fclk;
struct clk *dbclk;
struct regulator *pbias;
bool pbias_enabled;
void __iomem *base;
bool vqmmc_enabled;
resource_size_t mapbase;
spinlock_t irq_lock; /* Prevent races with irq handler */
unsigned int dma_len;
unsigned int dma_sg_idx;
unsigned char bus_mode;
unsigned char power_mode;
int suspended;
u32 con;
u32 hctl;
u32 sysctl;
u32 capa;
int irq;
int wake_irq;
int use_dma, dma_ch;
struct dma_chan *tx_chan;
struct dma_chan *rx_chan;
int response_busy;
int context_loss;
int reqs_blocked;
int req_in_progress;
unsigned long clk_rate;
unsigned int flags;
#define AUTO_CMD23 (1 << 0) /* Auto CMD23 support */
#define HSMMC_SDIO_IRQ_ENABLED (1 << 1) /* SDIO irq enabled */
struct omap_hsmmc_next next_data;
struct omap_hsmmc_platform_data *pdata;
};
struct omap_mmc_of_data {
u32 reg_offset;
u8 controller_flags;
};
static void omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host);
static int omap_hsmmc_enable_supply(struct mmc_host *mmc)
{
int ret;
struct omap_hsmmc_host *host = mmc_priv(mmc);
struct mmc_ios *ios = &mmc->ios;
if (!IS_ERR(mmc->supply.vmmc)) {
ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
if (ret)
return ret;
}
/* Enable interface voltage rail, if needed */
if (!IS_ERR(mmc->supply.vqmmc) && !host->vqmmc_enabled) {
ret = regulator_enable(mmc->supply.vqmmc);
if (ret) {
dev_err(mmc_dev(mmc), "vmmc_aux reg enable failed\n");
goto err_vqmmc;
}
host->vqmmc_enabled = true;
}
return 0;
err_vqmmc:
if (!IS_ERR(mmc->supply.vmmc))
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
return ret;
}
static int omap_hsmmc_disable_supply(struct mmc_host *mmc)
{
int ret;
int status;
struct omap_hsmmc_host *host = mmc_priv(mmc);
if (!IS_ERR(mmc->supply.vqmmc) && host->vqmmc_enabled) {
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/kernel.h`, `linux/debugfs.h`, `linux/dmaengine.h`, `linux/seq_file.h`, `linux/sizes.h`, `linux/interrupt.h`.
- Detected declarations: `struct omap_hsmmc_next`, `struct omap_hsmmc_host`, `struct omap_mmc_of_data`, `function omap_hsmmc_enable_supply`, `function omap_hsmmc_disable_supply`, `function omap_hsmmc_set_pbias`, `function omap_hsmmc_set_power`, `function omap_hsmmc_disable_boot_regulator`, `function omap_hsmmc_disable_boot_regulators`, `function omap_hsmmc_reg_get`.
- Atlas domain: Driver Families / drivers/mmc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.