drivers/mmc/host/sdhci-omap.c
Source file repositories/reference/linux-study-clean/drivers/mmc/host/sdhci-omap.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mmc/host/sdhci-omap.c- Extension
.c- Size
- 39436 bytes
- Lines
- 1483
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/mmc/mmc.hlinux/mmc/slot-gpio.hlinux/module.hlinux/of.hlinux/of_irq.hlinux/platform_device.hlinux/pm_runtime.hlinux/pm_wakeirq.hlinux/regulator/consumer.hlinux/pinctrl/consumer.hlinux/sys_soc.hlinux/thermal.hsdhci-pltfm.h
Detected Declarations
struct sdhci_omap_datastruct sdhci_omap_hostfunction sdhci_omap_readlfunction sdhci_omap_writelfunction sdhci_omap_set_pbiasfunction sdhci_omap_enable_iovfunction sdhci_omap_conf_bus_powerfunction sdhci_omap_enable_sdio_irqfunction sdhci_omap_set_dllfunction sdhci_omap_disable_tuningfunction sdhci_omap_execute_tuningfunction interruptsfunction sdhci_omap_card_busyfunction sdhci_omap_start_signal_voltage_switchfunction sdhci_omap_set_timingfunction sdhci_omap_set_power_modefunction sdhci_omap_set_bus_modefunction sdhci_omap_set_iosfunction sdhci_omap_calc_divisorfunction sdhci_omap_start_clockfunction sdhci_omap_stop_clockfunction sdhci_omap_set_clockfunction sdhci_omap_set_powerfunction sdhci_omap_has_admafunction sdhci_omap_enable_dmafunction sdhci_omap_get_min_clockfunction sdhci_omap_set_bus_widthfunction sdhci_omap_init_74_clocksfunction sdhci_omap_set_uhs_signalingfunction sdhci_omap_resetfunction sdhci_omap_irqfunction sdhci_omap_set_timeoutfunction sdhci_omap_regulator_get_capsfunction sdhci_omap_set_capabilitiesfunction sdhci_omap_config_iodelay_pinctrl_statefunction sdhci_omap_probefunction sdhci_omap_removefunction sdhci_omap_context_savefunction sdhci_omap_context_restorefunction sdhci_omap_runtime_suspendfunction sdhci_omap_runtime_resume
Annotated Snippet
struct sdhci_omap_data {
int omap_offset; /* Offset for omap regs from base */
u32 offset; /* Offset for SDHCI regs from base */
u8 flags;
};
struct sdhci_omap_host {
char *version;
void __iomem *base;
struct device *dev;
struct regulator *pbias;
bool pbias_enabled;
struct sdhci_host *host;
u8 bus_mode;
u8 power_mode;
u8 timing;
u8 flags;
struct pinctrl *pinctrl;
struct pinctrl_state **pinctrl_state;
int wakeirq;
bool is_tuning;
/* Offset for omap specific registers from base */
int omap_offset;
/* Omap specific context save */
u32 con;
u32 hctl;
u32 sysctl;
u32 capa;
u32 ie;
u32 ise;
};
static void sdhci_omap_start_clock(struct sdhci_omap_host *omap_host);
static void sdhci_omap_stop_clock(struct sdhci_omap_host *omap_host);
static inline u32 sdhci_omap_readl(struct sdhci_omap_host *host,
unsigned int offset)
{
return readl(host->base + host->omap_offset + offset);
}
static inline void sdhci_omap_writel(struct sdhci_omap_host *host,
unsigned int offset, u32 data)
{
writel(data, host->base + host->omap_offset + offset);
}
static int sdhci_omap_set_pbias(struct sdhci_omap_host *omap_host,
bool power_on, unsigned int iov)
{
int ret;
struct device *dev = omap_host->dev;
if (IS_ERR(omap_host->pbias))
return 0;
if (power_on) {
ret = regulator_set_voltage(omap_host->pbias, iov, iov);
if (ret) {
dev_err(dev, "pbias set voltage failed\n");
return ret;
}
if (omap_host->pbias_enabled)
return 0;
ret = regulator_enable(omap_host->pbias);
if (ret) {
dev_err(dev, "pbias reg enable fail\n");
return ret;
}
omap_host->pbias_enabled = true;
} else {
if (!omap_host->pbias_enabled)
return 0;
ret = regulator_disable(omap_host->pbias);
if (ret) {
dev_err(dev, "pbias reg disable fail\n");
return ret;
}
omap_host->pbias_enabled = false;
}
return 0;
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/mmc/mmc.h`, `linux/mmc/slot-gpio.h`, `linux/module.h`, `linux/of.h`, `linux/of_irq.h`, `linux/platform_device.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct sdhci_omap_data`, `struct sdhci_omap_host`, `function sdhci_omap_readl`, `function sdhci_omap_writel`, `function sdhci_omap_set_pbias`, `function sdhci_omap_enable_iov`, `function sdhci_omap_conf_bus_power`, `function sdhci_omap_enable_sdio_irq`, `function sdhci_omap_set_dll`, `function sdhci_omap_disable_tuning`.
- Atlas domain: Driver Families / drivers/mmc.
- Implementation status: source implementation candidate.
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.