#include <linux/bitfield.h>
#include <linux/init.h>
#include <linux/export.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/platform_device.h>
#include <linux/ioport.h>
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/compiler.h>
#include <linux/stddef.h>
#include <linux/bitops.h>
#include <linux/types.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/acpi.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/mmc/host.h>
#include <linux/mmc/pm.h>
#include <linux/mmc/slot-gpio.h>
#ifdef CONFIG_X86
#include <linux/platform_data/x86/soc.h>
#include <asm/iosf_mbi.h>
#endif
#include "sdhci.h"
enum { … };
struct sdhci_acpi_chip { … };
struct sdhci_acpi_slot { … };
struct sdhci_acpi_host { … };
enum { … };
static inline void *sdhci_acpi_priv(struct sdhci_acpi_host *c)
{ … }
static inline bool sdhci_acpi_flag(struct sdhci_acpi_host *c, unsigned int flag)
{ … }
#define INTEL_DSM_HS_CAPS_SDR25 …
#define INTEL_DSM_HS_CAPS_DDR50 …
#define INTEL_DSM_HS_CAPS_SDR50 …
#define INTEL_DSM_HS_CAPS_SDR104 …
enum { … };
struct intel_host { … };
static const guid_t intel_dsm_guid = …;
static int __intel_dsm(struct intel_host *intel_host, struct device *dev,
unsigned int fn, u32 *result)
{ … }
static int intel_dsm(struct intel_host *intel_host, struct device *dev,
unsigned int fn, u32 *result)
{ … }
static void intel_dsm_init(struct intel_host *intel_host, struct device *dev,
struct mmc_host *mmc)
{ … }
static int intel_start_signal_voltage_switch(struct mmc_host *mmc,
struct mmc_ios *ios)
{ … }
static void sdhci_acpi_int_hw_reset(struct sdhci_host *host)
{ … }
static const struct sdhci_ops sdhci_acpi_ops_dflt = …;
static const struct sdhci_ops sdhci_acpi_ops_int = …;
static const struct sdhci_acpi_chip sdhci_acpi_chip_int = …;
#ifdef CONFIG_X86
#define BYT_IOSF_SCCEP …
#define BYT_IOSF_OCP_NETCTRL0 …
#define BYT_IOSF_OCP_TIMEOUT_BASE …
static void sdhci_acpi_byt_setting(struct device *dev)
{ … }
static bool sdhci_acpi_byt_defer(struct device *dev)
{ … }
#else
static inline void sdhci_acpi_byt_setting(struct device *dev)
{
}
static inline bool sdhci_acpi_byt_defer(struct device *dev)
{
return false;
}
#endif
static int bxt_get_cd(struct mmc_host *mmc)
{ … }
static int intel_probe_slot(struct platform_device *pdev, struct acpi_device *adev)
{ … }
static int intel_setup_host(struct platform_device *pdev)
{ … }
static const struct sdhci_acpi_slot sdhci_acpi_slot_int_emmc = …;
static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = …;
static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sd = …;
#define VENDOR_SPECIFIC_PWRCTL_CLEAR_REG …
#define VENDOR_SPECIFIC_PWRCTL_CTL_REG …
static irqreturn_t sdhci_acpi_qcom_handler(int irq, void *ptr)
{ … }
static int qcom_probe_slot(struct platform_device *pdev, struct acpi_device *adev)
{ … }
static int qcom_free_slot(struct platform_device *pdev)
{ … }
static const struct sdhci_acpi_slot sdhci_acpi_slot_qcom_sd_3v = …;
static const struct sdhci_acpi_slot sdhci_acpi_slot_qcom_sd = …;
struct amd_sdhci_host { … };
#define SDHCI_AMD_RESET_DLL_REGISTER …
static int amd_select_drive_strength(struct mmc_card *card,
unsigned int max_dtr, int host_drv,
int card_drv, int *host_driver_strength)
{ … }
static void sdhci_acpi_amd_hs400_dll(struct sdhci_host *host, bool enable)
{ … }
static void amd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{ … }
static int amd_sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
{ … }
static void amd_sdhci_reset(struct sdhci_host *host, u8 mask)
{ … }
static const struct sdhci_ops sdhci_acpi_ops_amd = …;
static const struct sdhci_acpi_chip sdhci_acpi_chip_amd = …;
static int sdhci_acpi_emmc_amd_probe_slot(struct platform_device *pdev,
struct acpi_device *adev)
{ … }
static const struct sdhci_acpi_slot sdhci_acpi_slot_amd_emmc = …;
struct sdhci_acpi_uid_slot { … };
static const struct sdhci_acpi_uid_slot sdhci_acpi_uids[] = …;
static const struct acpi_device_id sdhci_acpi_ids[] = …;
MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids);
static const struct dmi_system_id sdhci_acpi_quirks[] = …;
static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(struct acpi_device *adev)
{ … }
static int sdhci_acpi_probe(struct platform_device *pdev)
{ … }
static void sdhci_acpi_remove(struct platform_device *pdev)
{ … }
static void __maybe_unused sdhci_acpi_reset_signal_voltage_if_needed(
struct device *dev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int sdhci_acpi_suspend(struct device *dev)
{ … }
static int sdhci_acpi_resume(struct device *dev)
{ … }
#endif
#ifdef CONFIG_PM
static int sdhci_acpi_runtime_suspend(struct device *dev)
{ … }
static int sdhci_acpi_runtime_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops sdhci_acpi_pm_ops = …;
static struct platform_driver sdhci_acpi_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;