Lines Matching refs:slot
53 struct sdhci_pci_slot *slot = chip->slots[i]; in sdhci_pci_init_wakeup() local
55 if (slot) { in sdhci_pci_init_wakeup()
56 pm_flags |= slot->host->mmc->pm_flags; in sdhci_pci_init_wakeup()
57 if (slot->host->mmc->caps & MMC_CAP_CD_WAKE) in sdhci_pci_init_wakeup()
77 struct sdhci_pci_slot *slot = chip->slots[i]; in sdhci_pci_suspend_host() local
80 if (!slot) in sdhci_pci_suspend_host()
83 host = slot->host; in sdhci_pci_suspend_host()
106 struct sdhci_pci_slot *slot; in sdhci_pci_resume_host() local
110 slot = chip->slots[i]; in sdhci_pci_resume_host()
111 if (!slot) in sdhci_pci_resume_host()
114 ret = sdhci_resume_host(slot->host); in sdhci_pci_resume_host()
118 mmc_gpio_set_cd_wake(slot->host->mmc, false); in sdhci_pci_resume_host()
150 struct sdhci_pci_slot *slot; in sdhci_pci_runtime_suspend_host() local
155 slot = chip->slots[i]; in sdhci_pci_runtime_suspend_host()
156 if (!slot) in sdhci_pci_runtime_suspend_host()
159 host = slot->host; in sdhci_pci_runtime_suspend_host()
180 struct sdhci_pci_slot *slot; in sdhci_pci_runtime_resume_host() local
184 slot = chip->slots[i]; in sdhci_pci_runtime_resume_host()
185 if (!slot) in sdhci_pci_runtime_resume_host()
188 ret = sdhci_runtime_resume_host(slot->host, 0); in sdhci_pci_runtime_resume_host()
259 static int ricoh_mmc_probe_slot(struct sdhci_pci_slot *slot) in ricoh_mmc_probe_slot() argument
261 slot->host->caps = in ricoh_mmc_probe_slot()
322 static int mrst_hc_probe_slot(struct sdhci_pci_slot *slot) in mrst_hc_probe_slot() argument
324 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in mrst_hc_probe_slot()
342 static int pch_hc_probe_slot(struct sdhci_pci_slot *slot) in pch_hc_probe_slot() argument
344 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in pch_hc_probe_slot()
348 static int mfd_emmc_probe_slot(struct sdhci_pci_slot *slot) in mfd_emmc_probe_slot() argument
350 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE; in mfd_emmc_probe_slot()
351 slot->host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC; in mfd_emmc_probe_slot()
355 static int mfd_sdio_probe_slot(struct sdhci_pci_slot *slot) in mfd_sdio_probe_slot() argument
357 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE; in mfd_sdio_probe_slot()
543 struct sdhci_pci_slot *slot = sdhci_priv(host); in intel_select_drive_strength() local
544 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_select_drive_strength()
573 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_intel_set_power() local
574 struct intel_host *intel_host = sdhci_pci_priv(slot); in sdhci_intel_set_power()
642 struct sdhci_pci_slot *slot = sdhci_priv(host); in intel_start_signal_voltage_switch() local
643 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_start_signal_voltage_switch()
691 static void byt_read_dsm(struct sdhci_pci_slot *slot) in byt_read_dsm() argument
693 struct intel_host *intel_host = sdhci_pci_priv(slot); in byt_read_dsm()
694 struct device *dev = &slot->chip->pdev->dev; in byt_read_dsm()
695 struct mmc_host *mmc = slot->host->mmc; in byt_read_dsm()
698 slot->chip->rpm_retune = intel_host->d3_retune; in byt_read_dsm()
728 static void intel_cache_ltr(struct sdhci_pci_slot *slot) in intel_cache_ltr() argument
730 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_cache_ltr()
731 struct sdhci_host *host = slot->host; in intel_cache_ltr()
740 struct sdhci_pci_slot *slot = chip->slots[0]; in intel_ltr_set() local
741 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_ltr_set()
742 struct sdhci_host *host = slot->host; in intel_ltr_set()
778 intel_cache_ltr(slot); in intel_ltr_set()
821 static void byt_probe_slot(struct sdhci_pci_slot *slot) in byt_probe_slot() argument
823 struct mmc_host_ops *ops = &slot->host->mmc_host_ops; in byt_probe_slot()
824 struct device *dev = &slot->chip->pdev->dev; in byt_probe_slot()
825 struct mmc_host *mmc = slot->host->mmc; in byt_probe_slot()
827 byt_read_dsm(slot); in byt_probe_slot()
829 byt_ocp_setting(slot->chip->pdev); in byt_probe_slot()
837 slot->chip->slots[mmc->slotno] = slot; in byt_probe_slot()
838 intel_ltr_expose(slot->chip); in byt_probe_slot()
842 static void byt_add_debugfs(struct sdhci_pci_slot *slot) in byt_add_debugfs() argument
844 struct intel_host *intel_host = sdhci_pci_priv(slot); in byt_add_debugfs()
845 struct mmc_host *mmc = slot->host->mmc; in byt_add_debugfs()
848 if (!intel_use_ltr(slot->chip)) in byt_add_debugfs()
854 intel_cache_ltr(slot); in byt_add_debugfs()
857 static int byt_add_host(struct sdhci_pci_slot *slot) in byt_add_host() argument
859 int ret = sdhci_add_host(slot->host); in byt_add_host()
862 byt_add_debugfs(slot); in byt_add_host()
866 static void byt_remove_slot(struct sdhci_pci_slot *slot, int dead) in byt_remove_slot() argument
868 struct mmc_host *mmc = slot->host->mmc; in byt_remove_slot()
871 intel_ltr_hide(slot->chip); in byt_remove_slot()
874 static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot) in byt_emmc_probe_slot() argument
876 byt_probe_slot(slot); in byt_emmc_probe_slot()
877 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | in byt_emmc_probe_slot()
881 slot->hw_reset = sdhci_pci_int_hw_reset; in byt_emmc_probe_slot()
882 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BSW_EMMC) in byt_emmc_probe_slot()
883 slot->host->timeout_clk = 1000; /* 1000 kHz i.e. 1 MHz */ in byt_emmc_probe_slot()
884 slot->host->mmc_host_ops.select_drive_strength = in byt_emmc_probe_slot()
889 static bool glk_broken_cqhci(struct sdhci_pci_slot *slot) in glk_broken_cqhci() argument
891 return slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_GLK_EMMC && in glk_broken_cqhci()
896 static int glk_emmc_probe_slot(struct sdhci_pci_slot *slot) in glk_emmc_probe_slot() argument
898 int ret = byt_emmc_probe_slot(slot); in glk_emmc_probe_slot()
900 if (!glk_broken_cqhci(slot)) in glk_emmc_probe_slot()
901 slot->host->mmc->caps2 |= MMC_CAP2_CQE; in glk_emmc_probe_slot()
903 if (slot->chip->pdev->device != PCI_DEVICE_ID_INTEL_GLK_EMMC) { in glk_emmc_probe_slot()
904 slot->host->mmc->caps2 |= MMC_CAP2_HS400_ES; in glk_emmc_probe_slot()
905 slot->host->mmc_host_ops.hs400_enhanced_strobe = in glk_emmc_probe_slot()
907 slot->host->mmc->caps2 |= MMC_CAP2_CQE_DCMD; in glk_emmc_probe_slot()
919 static int glk_emmc_add_host(struct sdhci_pci_slot *slot) in glk_emmc_add_host() argument
921 struct device *dev = &slot->chip->pdev->dev; in glk_emmc_add_host()
922 struct sdhci_host *host = slot->host; in glk_emmc_add_host()
953 byt_add_debugfs(slot); in glk_emmc_add_host()
970 struct sdhci_pci_slot *slot = chip->slots[0]; in glk_rpm_retune_wa() local
971 struct intel_host *intel_host = sdhci_pci_priv(slot); in glk_rpm_retune_wa()
972 struct sdhci_host *host = slot->host; in glk_rpm_retune_wa()
1034 static int ni_set_max_freq(struct sdhci_pci_slot *slot) in ni_set_max_freq() argument
1039 status = acpi_evaluate_integer(ACPI_HANDLE(&slot->chip->pdev->dev), in ni_set_max_freq()
1042 dev_err(&slot->chip->pdev->dev, in ni_set_max_freq()
1047 slot->host->mmc->f_max = max_freq * 1000000; in ni_set_max_freq()
1052 static inline int ni_set_max_freq(struct sdhci_pci_slot *slot) in ni_set_max_freq() argument
1058 static int ni_byt_sdio_probe_slot(struct sdhci_pci_slot *slot) in ni_byt_sdio_probe_slot() argument
1062 byt_probe_slot(slot); in ni_byt_sdio_probe_slot()
1064 err = ni_set_max_freq(slot); in ni_byt_sdio_probe_slot()
1068 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | in ni_byt_sdio_probe_slot()
1073 static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot) in byt_sdio_probe_slot() argument
1075 byt_probe_slot(slot); in byt_sdio_probe_slot()
1076 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | in byt_sdio_probe_slot()
1081 static void byt_needs_pwr_off(struct sdhci_pci_slot *slot) in byt_needs_pwr_off() argument
1083 struct intel_host *intel_host = sdhci_pci_priv(slot); in byt_needs_pwr_off()
1084 u8 reg = sdhci_readb(slot->host, SDHCI_POWER_CONTROL); in byt_needs_pwr_off()
1089 static int byt_sd_probe_slot(struct sdhci_pci_slot *slot) in byt_sd_probe_slot() argument
1091 byt_probe_slot(slot); in byt_sd_probe_slot()
1092 slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY | in byt_sd_probe_slot()
1094 slot->cd_idx = 0; in byt_sd_probe_slot()
1095 slot->cd_override_level = true; in byt_sd_probe_slot()
1096 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD || in byt_sd_probe_slot()
1097 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXTM_SD || in byt_sd_probe_slot()
1098 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_APL_SD || in byt_sd_probe_slot()
1099 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_GLK_SD) in byt_sd_probe_slot()
1100 slot->host->mmc_host_ops.get_cd = bxt_get_cd; in byt_sd_probe_slot()
1102 if (slot->chip->pdev->subsystem_vendor == PCI_VENDOR_ID_NI && in byt_sd_probe_slot()
1103 slot->chip->pdev->subsystem_device == PCI_SUBDEVICE_ID_NI_78E3) in byt_sd_probe_slot()
1104 slot->host->mmc->caps2 |= MMC_CAP2_AVOID_3_3V; in byt_sd_probe_slot()
1106 byt_needs_pwr_off(slot); in byt_sd_probe_slot()
1241 static void intel_mrfld_mmc_fix_up_power_slot(struct sdhci_pci_slot *slot) in intel_mrfld_mmc_fix_up_power_slot() argument
1245 device = ACPI_COMPANION(&slot->chip->pdev->dev); in intel_mrfld_mmc_fix_up_power_slot()
1255 static inline void intel_mrfld_mmc_fix_up_power_slot(struct sdhci_pci_slot *slot) {} in intel_mrfld_mmc_fix_up_power_slot() argument
1258 static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot) in intel_mrfld_mmc_probe_slot() argument
1260 unsigned int func = PCI_FUNC(slot->chip->pdev->devfn); in intel_mrfld_mmc_probe_slot()
1265 slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE | in intel_mrfld_mmc_probe_slot()
1270 slot->cd_idx = 0; in intel_mrfld_mmc_probe_slot()
1271 slot->cd_override_level = true; in intel_mrfld_mmc_probe_slot()
1277 slot->host->mmc_host_ops.get_cd = mrfld_get_cd; in intel_mrfld_mmc_probe_slot()
1278 slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; in intel_mrfld_mmc_probe_slot()
1282 slot->host->ocr_mask = MMC_VDD_20_21 | MMC_VDD_165_195; in intel_mrfld_mmc_probe_slot()
1283 slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE | in intel_mrfld_mmc_probe_slot()
1290 intel_mrfld_mmc_fix_up_power_slot(slot); in intel_mrfld_mmc_probe_slot()
1405 static int jmicron_probe_slot(struct sdhci_pci_slot *slot) in jmicron_probe_slot() argument
1407 if (slot->chip->pdev->revision == 0) { in jmicron_probe_slot()
1410 version = readl(slot->host->ioaddr + SDHCI_HOST_VERSION); in jmicron_probe_slot()
1420 slot->host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; in jmicron_probe_slot()
1424 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) { in jmicron_probe_slot()
1425 slot->host->ocr_avail_sd = MMC_VDD_32_33 | MMC_VDD_33_34 | in jmicron_probe_slot()
1428 slot->host->ocr_avail_mmc = MMC_VDD_32_33 | MMC_VDD_33_34 | in jmicron_probe_slot()
1436 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || in jmicron_probe_slot()
1437 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) in jmicron_probe_slot()
1438 jmicron_enable_mmc(slot->host, 1); in jmicron_probe_slot()
1440 slot->host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST; in jmicron_probe_slot()
1445 static void jmicron_remove_slot(struct sdhci_pci_slot *slot, int dead) in jmicron_remove_slot() argument
1450 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || in jmicron_remove_slot()
1451 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) in jmicron_remove_slot()
1452 jmicron_enable_mmc(slot->host, 0); in jmicron_remove_slot()
1533 static int syskt_probe_slot(struct sdhci_pci_slot *slot) in syskt_probe_slot() argument
1537 u8 board_rev = readb(slot->host->ioaddr + SYSKT_BOARD_REV); in syskt_probe_slot()
1538 u8 chip_rev = readb(slot->host->ioaddr + SYSKT_CHIP_REV); in syskt_probe_slot()
1539 dev_info(&slot->chip->pdev->dev, "SysKonnect CardBus2SDIO, " in syskt_probe_slot()
1544 slot->host->quirks |= SDHCI_QUIRK_FORCE_DMA; in syskt_probe_slot()
1546 writeb(SYSKT_POWER_330, slot->host->ioaddr + SYSKT_POWER_DATA); in syskt_probe_slot()
1547 writeb(SYSKT_POWER_START, slot->host->ioaddr + SYSKT_POWER_CMD); in syskt_probe_slot()
1551 ps = readw(slot->host->ioaddr + SYSKT_POWER_STATUS); in syskt_probe_slot()
1557 dev_err(&slot->chip->pdev->dev, in syskt_probe_slot()
1559 writeb(0, slot->host->ioaddr + SYSKT_POWER_CMD); in syskt_probe_slot()
1584 static int rtsx_probe_slot(struct sdhci_pci_slot *slot) in rtsx_probe_slot() argument
1586 slot->host->mmc->caps2 |= MMC_CAP2_HS200; in rtsx_probe_slot()
1648 struct sdhci_pci_slot *slot = sdhci_priv(host); in amd_execute_tuning_hs200() local
1649 struct pci_dev *pdev = slot->chip->pdev; in amd_execute_tuning_hs200()
1697 static int amd_probe_slot(struct sdhci_pci_slot *slot) in amd_probe_slot() argument
1699 struct mmc_host_ops *ops = &slot->host->mmc_host_ops; in amd_probe_slot()
1741 struct sdhci_pci_slot *slot = sdhci_priv(host); in amd_sdhci_reset() local
1742 struct pci_dev *pdev = slot->chip->pdev; in amd_sdhci_reset()
1900 struct sdhci_pci_slot *slot; in sdhci_pci_enable_dma() local
1903 slot = sdhci_priv(host); in sdhci_pci_enable_dma()
1904 pdev = slot->chip->pdev; in sdhci_pci_enable_dma()
1920 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_pci_hw_reset() local
1922 if (slot->hw_reset) in sdhci_pci_hw_reset()
1923 slot->hw_reset(host); in sdhci_pci_hw_reset()
2013 struct sdhci_pci_slot *slot; in sdhci_pci_probe_slot() local
2038 host = sdhci_alloc_host(&pdev->dev, sizeof(*slot) + priv_size); in sdhci_pci_probe_slot()
2044 slot = sdhci_priv(host); in sdhci_pci_probe_slot()
2046 slot->chip = chip; in sdhci_pci_probe_slot()
2047 slot->host = host; in sdhci_pci_probe_slot()
2048 slot->cd_idx = -1; in sdhci_pci_probe_slot()
2068 ret = chip->fixes->probe_slot(slot); in sdhci_pci_probe_slot()
2083 if (slot->cd_idx >= 0) { in sdhci_pci_probe_slot()
2084 ret = mmc_gpiod_request_cd(host->mmc, "cd", slot->cd_idx, in sdhci_pci_probe_slot()
2085 slot->cd_override_level, 0); in sdhci_pci_probe_slot()
2088 slot->cd_idx, in sdhci_pci_probe_slot()
2089 slot->cd_override_level, in sdhci_pci_probe_slot()
2096 slot->cd_idx = -1; in sdhci_pci_probe_slot()
2101 ret = chip->fixes->add_host(slot); in sdhci_pci_probe_slot()
2111 if (chip->fixes && chip->fixes->own_cd_for_runtime_pm && slot->cd_idx < 0) in sdhci_pci_probe_slot()
2114 return slot; in sdhci_pci_probe_slot()
2118 chip->fixes->remove_slot(slot, 0); in sdhci_pci_probe_slot()
2126 static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot) in sdhci_pci_remove_slot() argument
2132 scratch = readl(slot->host->ioaddr + SDHCI_INT_STATUS); in sdhci_pci_remove_slot()
2136 sdhci_remove_host(slot->host, dead); in sdhci_pci_remove_slot()
2138 if (slot->chip->fixes && slot->chip->fixes->remove_slot) in sdhci_pci_remove_slot()
2139 slot->chip->fixes->remove_slot(slot, dead); in sdhci_pci_remove_slot()
2141 sdhci_free_host(slot->host); in sdhci_pci_remove_slot()
2164 struct sdhci_pci_slot *slot; in sdhci_pci_probe() local
2225 slot = sdhci_pci_probe_slot(pdev, chip, first_bar, i); in sdhci_pci_probe()
2226 if (IS_ERR(slot)) { in sdhci_pci_probe()
2229 return PTR_ERR(slot); in sdhci_pci_probe()
2232 chip->slots[i] = slot; in sdhci_pci_probe()