drivers/mmc/host/sdhci-acpi.c
Source file repositories/reference/linux-study-clean/drivers/mmc/host/sdhci-acpi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mmc/host/sdhci-acpi.c- Extension
.c- Size
- 29415 bytes
- Lines
- 1062
- 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/bitfield.hlinux/init.hlinux/export.hlinux/module.hlinux/device.hlinux/pinctrl/pinconf-generic.hlinux/platform_device.hlinux/ioport.hlinux/io.hlinux/dma-mapping.hlinux/compiler.hlinux/stddef.hlinux/bitops.hlinux/types.hlinux/err.hlinux/interrupt.hlinux/acpi.hlinux/pm.hlinux/pm_runtime.hlinux/delay.hlinux/dmi.hlinux/mmc/host.hlinux/mmc/pm.hlinux/mmc/slot-gpio.hlinux/platform_data/x86/soc.hasm/iosf_mbi.hsdhci.h
Detected Declarations
struct sdhci_acpi_chipstruct sdhci_acpi_slotstruct sdhci_acpi_hoststruct intel_hoststruct amd_sdhci_hoststruct sdhci_acpi_uid_slotfunction sdhci_acpi_flagfunction __intel_dsmfunction intel_dsmfunction intel_dsm_initfunction intel_start_signal_voltage_switchfunction sdhci_acpi_int_hw_resetfunction sdhci_acpi_byt_settingfunction sdhci_acpi_byt_deferfunction sdhci_acpi_byt_settingfunction bxt_get_cdfunction intel_probe_slotfunction intel_setup_hostfunction sdhci_acpi_qcom_handlerfunction qcom_probe_slotfunction qcom_free_slotfunction amd_select_drive_strengthfunction sdhci_acpi_amd_hs400_dllfunction amd_set_iosfunction amd_sdhci_execute_tuningfunction amd_sdhci_resetfunction sdhci_acpi_emmc_amd_probe_slotfunction sdhci_acpi_probefunction sdhci_acpi_removefunction sdhci_acpi_reset_signal_voltage_if_neededfunction sdhci_acpi_suspendfunction sdhci_acpi_resumefunction sdhci_acpi_runtime_suspendfunction sdhci_acpi_runtime_resume
Annotated Snippet
struct sdhci_acpi_chip {
const struct sdhci_ops *ops;
unsigned int quirks;
unsigned int quirks2;
unsigned long caps;
unsigned int caps2;
mmc_pm_flag_t pm_caps;
};
struct sdhci_acpi_slot {
const struct sdhci_acpi_chip *chip;
unsigned int quirks;
unsigned int quirks2;
unsigned long caps;
unsigned int caps2;
mmc_pm_flag_t pm_caps;
unsigned int flags;
size_t priv_size;
int (*probe_slot)(struct platform_device *, struct acpi_device *);
int (*remove_slot)(struct platform_device *);
int (*free_slot)(struct platform_device *pdev);
int (*setup_host)(struct platform_device *pdev);
};
struct sdhci_acpi_host {
struct sdhci_host *host;
const struct sdhci_acpi_slot *slot;
struct platform_device *pdev;
bool use_runtime_pm;
bool is_intel;
bool reset_signal_volt_on_suspend;
unsigned long private[] ____cacheline_aligned;
};
enum {
DMI_QUIRK_RESET_SD_SIGNAL_VOLT_ON_SUSP = BIT(0),
DMI_QUIRK_SD_NO_WRITE_PROTECT = BIT(1),
DMI_QUIRK_SD_CD_ACTIVE_HIGH = BIT(2),
DMI_QUIRK_SD_CD_ENABLE_PULL_UP = BIT(3),
};
static inline void *sdhci_acpi_priv(struct sdhci_acpi_host *c)
{
return (void *)c->private;
}
static inline bool sdhci_acpi_flag(struct sdhci_acpi_host *c, unsigned int flag)
{
return c->slot && (c->slot->flags & flag);
}
#define INTEL_DSM_HS_CAPS_SDR25 BIT(0)
#define INTEL_DSM_HS_CAPS_DDR50 BIT(1)
#define INTEL_DSM_HS_CAPS_SDR50 BIT(2)
#define INTEL_DSM_HS_CAPS_SDR104 BIT(3)
enum {
INTEL_DSM_FNS = 0,
INTEL_DSM_V18_SWITCH = 3,
INTEL_DSM_V33_SWITCH = 4,
INTEL_DSM_HS_CAPS = 8,
};
struct intel_host {
u32 dsm_fns;
u32 hs_caps;
};
static const guid_t intel_dsm_guid =
GUID_INIT(0xF6C13EA5, 0x65CD, 0x461F,
0xAB, 0x7A, 0x29, 0xF7, 0xE8, 0xD5, 0xBD, 0x61);
static int __intel_dsm(struct intel_host *intel_host, struct device *dev,
unsigned int fn, u32 *result)
{
union acpi_object *obj;
int err = 0;
obj = acpi_evaluate_dsm(ACPI_HANDLE(dev), &intel_dsm_guid, 0, fn, NULL);
if (!obj)
return -EOPNOTSUPP;
if (obj->type == ACPI_TYPE_INTEGER) {
*result = obj->integer.value;
} else if (obj->type == ACPI_TYPE_BUFFER && obj->buffer.length > 0) {
size_t len = min_t(size_t, obj->buffer.length, 4);
*result = 0;
memcpy(result, obj->buffer.pointer, len);
} else {
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/init.h`, `linux/export.h`, `linux/module.h`, `linux/device.h`, `linux/pinctrl/pinconf-generic.h`, `linux/platform_device.h`, `linux/ioport.h`.
- Detected declarations: `struct sdhci_acpi_chip`, `struct sdhci_acpi_slot`, `struct sdhci_acpi_host`, `struct intel_host`, `struct amd_sdhci_host`, `struct sdhci_acpi_uid_slot`, `function sdhci_acpi_flag`, `function __intel_dsm`, `function intel_dsm`, `function intel_dsm_init`.
- 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.