Lines Matching full:slot
33 #include <linux/mmc/slot-gpio.h>
56 struct sdhci_pci_slot *slot = chip->slots[i]; in sdhci_pci_init_wakeup() local
58 if (slot) { in sdhci_pci_init_wakeup()
59 pm_flags |= slot->host->mmc->pm_flags; in sdhci_pci_init_wakeup()
60 if (slot->host->mmc->caps & MMC_CAP_CD_WAKE) in sdhci_pci_init_wakeup()
80 struct sdhci_pci_slot *slot = chip->slots[i]; in sdhci_pci_suspend_host() local
83 if (!slot) in sdhci_pci_suspend_host()
86 host = slot->host; in sdhci_pci_suspend_host()
109 struct sdhci_pci_slot *slot; in sdhci_pci_resume_host() local
113 slot = chip->slots[i]; in sdhci_pci_resume_host()
114 if (!slot) in sdhci_pci_resume_host()
117 ret = sdhci_resume_host(slot->host); in sdhci_pci_resume_host()
121 mmc_gpio_set_cd_wake(slot->host->mmc, false); in sdhci_pci_resume_host()
153 struct sdhci_pci_slot *slot; in sdhci_pci_runtime_suspend_host() local
158 slot = chip->slots[i]; in sdhci_pci_runtime_suspend_host()
159 if (!slot) in sdhci_pci_runtime_suspend_host()
162 host = slot->host; in sdhci_pci_runtime_suspend_host()
183 struct sdhci_pci_slot *slot; in sdhci_pci_runtime_resume_host() local
187 slot = chip->slots[i]; in sdhci_pci_runtime_resume_host()
188 if (!slot) in sdhci_pci_runtime_resume_host()
191 ret = sdhci_runtime_resume_host(slot->host, 0); in sdhci_pci_runtime_resume_host()
254 static int ricoh_mmc_probe_slot(struct sdhci_pci_slot *slot) in ricoh_mmc_probe_slot() argument
265 __sdhci_read_caps(slot->host, NULL, &caps, &caps1); in ricoh_mmc_probe_slot()
312 static int ene_714_probe_slot(struct sdhci_pci_slot *slot) in ene_714_probe_slot() argument
314 slot->host->mmc_host_ops.set_ios = ene_714_set_ios; in ene_714_probe_slot()
340 static int mrst_hc_probe_slot(struct sdhci_pci_slot *slot) in mrst_hc_probe_slot() argument
342 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in mrst_hc_probe_slot()
360 static int pch_hc_probe_slot(struct sdhci_pci_slot *slot) in pch_hc_probe_slot() argument
362 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in pch_hc_probe_slot()
366 static int mfd_emmc_probe_slot(struct sdhci_pci_slot *slot) in mfd_emmc_probe_slot() argument
368 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE; in mfd_emmc_probe_slot()
369 slot->host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC; in mfd_emmc_probe_slot()
373 static int mfd_sdio_probe_slot(struct sdhci_pci_slot *slot) in mfd_sdio_probe_slot() argument
375 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE; in mfd_sdio_probe_slot()
562 struct sdhci_pci_slot *slot = sdhci_priv(host); in intel_select_drive_strength() local
563 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_select_drive_strength()
592 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_intel_set_power() local
593 struct intel_host *intel_host = sdhci_pci_priv(slot); in sdhci_intel_set_power()
661 struct sdhci_pci_slot *slot = sdhci_priv(host); in intel_start_signal_voltage_switch() local
662 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_start_signal_voltage_switch()
710 static void byt_read_dsm(struct sdhci_pci_slot *slot) in byt_read_dsm() argument
712 struct intel_host *intel_host = sdhci_pci_priv(slot); in byt_read_dsm()
713 struct device *dev = &slot->chip->pdev->dev; in byt_read_dsm()
714 struct mmc_host *mmc = slot->host->mmc; in byt_read_dsm()
717 slot->chip->rpm_retune = intel_host->d3_retune; in byt_read_dsm()
747 static void intel_cache_ltr(struct sdhci_pci_slot *slot) in intel_cache_ltr() argument
749 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_cache_ltr()
750 struct sdhci_host *host = slot->host; in intel_cache_ltr()
759 struct sdhci_pci_slot *slot = chip->slots[0]; in intel_ltr_set() local
760 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_ltr_set()
761 struct sdhci_host *host = slot->host; in intel_ltr_set()
797 intel_cache_ltr(slot); in intel_ltr_set()
840 static void byt_probe_slot(struct sdhci_pci_slot *slot) in byt_probe_slot() argument
842 struct mmc_host_ops *ops = &slot->host->mmc_host_ops; in byt_probe_slot()
843 struct device *dev = &slot->chip->pdev->dev; in byt_probe_slot()
844 struct mmc_host *mmc = slot->host->mmc; in byt_probe_slot()
846 byt_read_dsm(slot); in byt_probe_slot()
848 byt_ocp_setting(slot->chip->pdev); in byt_probe_slot()
856 slot->chip->slots[mmc->slotno] = slot; in byt_probe_slot()
857 intel_ltr_expose(slot->chip); in byt_probe_slot()
861 static void byt_add_debugfs(struct sdhci_pci_slot *slot) in byt_add_debugfs() argument
863 struct intel_host *intel_host = sdhci_pci_priv(slot); in byt_add_debugfs()
864 struct mmc_host *mmc = slot->host->mmc; in byt_add_debugfs()
867 if (!intel_use_ltr(slot->chip)) in byt_add_debugfs()
873 intel_cache_ltr(slot); in byt_add_debugfs()
876 static int byt_add_host(struct sdhci_pci_slot *slot) in byt_add_host() argument
878 int ret = sdhci_add_host(slot->host); in byt_add_host()
881 byt_add_debugfs(slot); in byt_add_host()
885 static void byt_remove_slot(struct sdhci_pci_slot *slot, int dead) in byt_remove_slot() argument
887 struct mmc_host *mmc = slot->host->mmc; in byt_remove_slot()
890 intel_ltr_hide(slot->chip); in byt_remove_slot()
893 static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot) in byt_emmc_probe_slot() argument
895 byt_probe_slot(slot); in byt_emmc_probe_slot()
896 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | in byt_emmc_probe_slot()
900 slot->hw_reset = sdhci_pci_int_hw_reset; in byt_emmc_probe_slot()
901 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BSW_EMMC) in byt_emmc_probe_slot()
902 slot->host->timeout_clk = 1000; /* 1000 kHz i.e. 1 MHz */ in byt_emmc_probe_slot()
903 slot->host->mmc_host_ops.select_drive_strength = in byt_emmc_probe_slot()
908 static bool glk_broken_cqhci(struct sdhci_pci_slot *slot) in glk_broken_cqhci() argument
910 return slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_GLK_EMMC && in glk_broken_cqhci()
915 static bool jsl_broken_hs400es(struct sdhci_pci_slot *slot) in jsl_broken_hs400es() argument
917 return slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_JSL_EMMC && in jsl_broken_hs400es()
921 static int glk_emmc_probe_slot(struct sdhci_pci_slot *slot) in glk_emmc_probe_slot() argument
923 int ret = byt_emmc_probe_slot(slot); in glk_emmc_probe_slot()
925 if (!glk_broken_cqhci(slot)) in glk_emmc_probe_slot()
926 slot->host->mmc->caps2 |= MMC_CAP2_CQE; in glk_emmc_probe_slot()
928 if (slot->chip->pdev->device != PCI_DEVICE_ID_INTEL_GLK_EMMC) { in glk_emmc_probe_slot()
929 if (!jsl_broken_hs400es(slot)) { in glk_emmc_probe_slot()
930 slot->host->mmc->caps2 |= MMC_CAP2_HS400_ES; in glk_emmc_probe_slot()
931 slot->host->mmc_host_ops.hs400_enhanced_strobe = in glk_emmc_probe_slot()
934 slot->host->mmc->caps2 |= MMC_CAP2_CQE_DCMD; in glk_emmc_probe_slot()
946 static int glk_emmc_add_host(struct sdhci_pci_slot *slot) in glk_emmc_add_host() argument
948 struct device *dev = &slot->chip->pdev->dev; in glk_emmc_add_host()
949 struct sdhci_host *host = slot->host; in glk_emmc_add_host()
980 byt_add_debugfs(slot); in glk_emmc_add_host()
997 struct sdhci_pci_slot *slot = chip->slots[0]; in glk_rpm_retune_wa() local
998 struct intel_host *intel_host = sdhci_pci_priv(slot); in glk_rpm_retune_wa()
999 struct sdhci_host *host = slot->host; in glk_rpm_retune_wa()
1061 static int ni_set_max_freq(struct sdhci_pci_slot *slot) in ni_set_max_freq() argument
1066 status = acpi_evaluate_integer(ACPI_HANDLE(&slot->chip->pdev->dev), in ni_set_max_freq()
1069 dev_err(&slot->chip->pdev->dev, in ni_set_max_freq()
1074 slot->host->mmc->f_max = max_freq * 1000000; in ni_set_max_freq()
1079 static inline int ni_set_max_freq(struct sdhci_pci_slot *slot) in ni_set_max_freq() argument
1085 static int ni_byt_sdio_probe_slot(struct sdhci_pci_slot *slot) in ni_byt_sdio_probe_slot() argument
1089 byt_probe_slot(slot); in ni_byt_sdio_probe_slot()
1091 err = ni_set_max_freq(slot); in ni_byt_sdio_probe_slot()
1095 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | in ni_byt_sdio_probe_slot()
1100 static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot) in byt_sdio_probe_slot() argument
1102 byt_probe_slot(slot); in byt_sdio_probe_slot()
1103 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | in byt_sdio_probe_slot()
1108 static void byt_needs_pwr_off(struct sdhci_pci_slot *slot) in byt_needs_pwr_off() argument
1110 struct intel_host *intel_host = sdhci_pci_priv(slot); in byt_needs_pwr_off()
1111 u8 reg = sdhci_readb(slot->host, SDHCI_POWER_CONTROL); in byt_needs_pwr_off()
1116 static int byt_sd_probe_slot(struct sdhci_pci_slot *slot) in byt_sd_probe_slot() argument
1118 byt_probe_slot(slot); in byt_sd_probe_slot()
1119 slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY | in byt_sd_probe_slot()
1121 slot->cd_idx = 0; in byt_sd_probe_slot()
1122 slot->cd_override_level = true; in byt_sd_probe_slot()
1123 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD || in byt_sd_probe_slot()
1124 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXTM_SD || in byt_sd_probe_slot()
1125 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_APL_SD || in byt_sd_probe_slot()
1126 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_GLK_SD) in byt_sd_probe_slot()
1127 slot->host->mmc_host_ops.get_cd = bxt_get_cd; in byt_sd_probe_slot()
1129 if (slot->chip->pdev->subsystem_vendor == PCI_VENDOR_ID_NI && in byt_sd_probe_slot()
1130 slot->chip->pdev->subsystem_device == PCI_SUBDEVICE_ID_NI_78E3) in byt_sd_probe_slot()
1131 slot->host->mmc->caps2 |= MMC_CAP2_AVOID_3_3V; in byt_sd_probe_slot()
1133 byt_needs_pwr_off(slot); in byt_sd_probe_slot()
1292 static void intel_mrfld_mmc_fix_up_power_slot(struct sdhci_pci_slot *slot) in intel_mrfld_mmc_fix_up_power_slot() argument
1296 device = ACPI_COMPANION(&slot->chip->pdev->dev); in intel_mrfld_mmc_fix_up_power_slot()
1301 static inline void intel_mrfld_mmc_fix_up_power_slot(struct sdhci_pci_slot *slot) {} in intel_mrfld_mmc_fix_up_power_slot() argument
1304 static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot) in intel_mrfld_mmc_probe_slot() argument
1306 unsigned int func = PCI_FUNC(slot->chip->pdev->devfn); in intel_mrfld_mmc_probe_slot()
1311 slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE | in intel_mrfld_mmc_probe_slot()
1316 slot->cd_idx = 0; in intel_mrfld_mmc_probe_slot()
1317 slot->cd_override_level = true; in intel_mrfld_mmc_probe_slot()
1319 * There are two PCB designs of SD card slot with the opposite in intel_mrfld_mmc_probe_slot()
1323 slot->host->mmc_host_ops.get_cd = mrfld_get_cd; in intel_mrfld_mmc_probe_slot()
1324 slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; in intel_mrfld_mmc_probe_slot()
1328 slot->host->ocr_mask = MMC_VDD_20_21 | MMC_VDD_165_195; in intel_mrfld_mmc_probe_slot()
1329 slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE | in intel_mrfld_mmc_probe_slot()
1336 intel_mrfld_mmc_fix_up_power_slot(slot); in intel_mrfld_mmc_probe_slot()
1466 static int jmicron_probe_slot(struct sdhci_pci_slot *slot) in jmicron_probe_slot() argument
1468 if (slot->chip->pdev->revision == 0) { in jmicron_probe_slot()
1471 version = readl(slot->host->ioaddr + SDHCI_HOST_VERSION); in jmicron_probe_slot()
1481 slot->host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; in jmicron_probe_slot()
1485 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) { in jmicron_probe_slot()
1486 slot->host->ocr_avail_sd = MMC_VDD_32_33 | MMC_VDD_33_34 | in jmicron_probe_slot()
1489 slot->host->ocr_avail_mmc = MMC_VDD_32_33 | MMC_VDD_33_34 | in jmicron_probe_slot()
1497 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || in jmicron_probe_slot()
1498 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) in jmicron_probe_slot()
1499 jmicron_enable_mmc(slot->host, 1); in jmicron_probe_slot()
1501 slot->host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST; in jmicron_probe_slot()
1504 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_SD || in jmicron_probe_slot()
1505 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) in jmicron_probe_slot()
1506 slot->host->mmc_host_ops.get_ro = jmicron_jmb388_get_ro; in jmicron_probe_slot()
1511 static void jmicron_remove_slot(struct sdhci_pci_slot *slot, int dead) in jmicron_remove_slot() argument
1516 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || in jmicron_remove_slot()
1517 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) in jmicron_remove_slot()
1518 jmicron_enable_mmc(slot->host, 0); in jmicron_remove_slot()
1599 static int syskt_probe_slot(struct sdhci_pci_slot *slot) in syskt_probe_slot() argument
1603 u8 board_rev = readb(slot->host->ioaddr + SYSKT_BOARD_REV); in syskt_probe_slot()
1604 u8 chip_rev = readb(slot->host->ioaddr + SYSKT_CHIP_REV); in syskt_probe_slot()
1605 dev_info(&slot->chip->pdev->dev, "SysKonnect CardBus2SDIO, " in syskt_probe_slot()
1610 slot->host->quirks |= SDHCI_QUIRK_FORCE_DMA; in syskt_probe_slot()
1612 writeb(SYSKT_POWER_330, slot->host->ioaddr + SYSKT_POWER_DATA); in syskt_probe_slot()
1613 writeb(SYSKT_POWER_START, slot->host->ioaddr + SYSKT_POWER_CMD); in syskt_probe_slot()
1617 ps = readw(slot->host->ioaddr + SYSKT_POWER_STATUS); in syskt_probe_slot()
1623 dev_err(&slot->chip->pdev->dev, in syskt_probe_slot()
1625 writeb(0, slot->host->ioaddr + SYSKT_POWER_CMD); in syskt_probe_slot()
1650 static int rtsx_probe_slot(struct sdhci_pci_slot *slot) in rtsx_probe_slot() argument
1652 slot->host->mmc->caps2 |= MMC_CAP2_HS200; in rtsx_probe_slot()
1714 struct sdhci_pci_slot *slot = sdhci_priv(host); in amd_execute_tuning_hs200() local
1715 struct pci_dev *pdev = slot->chip->pdev; in amd_execute_tuning_hs200()
1763 static int amd_probe_slot(struct sdhci_pci_slot *slot) in amd_probe_slot() argument
1765 struct mmc_host_ops *ops = &slot->host->mmc_host_ops; in amd_probe_slot()
1809 struct sdhci_pci_slot *slot = sdhci_priv(host); in amd_sdhci_reset() local
1810 struct pci_dev *pdev = slot->chip->pdev; in amd_sdhci_reset()
1974 struct sdhci_pci_slot *slot; in sdhci_pci_enable_dma() local
1977 slot = sdhci_priv(host); in sdhci_pci_enable_dma()
1978 pdev = slot->chip->pdev; in sdhci_pci_enable_dma()
1994 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_pci_hw_reset() local
1996 if (slot->hw_reset) in sdhci_pci_hw_reset()
1997 slot->hw_reset(host); in sdhci_pci_hw_reset()
2123 struct sdhci_pci_slot *slot; in sdhci_pci_probe_slot() local
2148 host = sdhci_alloc_host(&pdev->dev, sizeof(*slot) + priv_size); in sdhci_pci_probe_slot()
2154 slot = sdhci_priv(host); in sdhci_pci_probe_slot()
2156 slot->chip = chip; in sdhci_pci_probe_slot()
2157 slot->host = host; in sdhci_pci_probe_slot()
2158 slot->cd_idx = -1; in sdhci_pci_probe_slot()
2178 ret = chip->fixes->probe_slot(slot); in sdhci_pci_probe_slot()
2193 if (slot->cd_idx >= 0) { in sdhci_pci_probe_slot()
2202 ret = mmc_gpiod_request_cd(host->mmc, "cd", slot->cd_idx, in sdhci_pci_probe_slot()
2203 slot->cd_override_level, 0); in sdhci_pci_probe_slot()
2209 slot->cd_idx, in sdhci_pci_probe_slot()
2210 slot->cd_override_level, in sdhci_pci_probe_slot()
2217 slot->cd_idx = -1; in sdhci_pci_probe_slot()
2222 ret = chip->fixes->add_host(slot); in sdhci_pci_probe_slot()
2232 if (chip->fixes && chip->fixes->own_cd_for_runtime_pm && slot->cd_idx < 0) in sdhci_pci_probe_slot()
2235 return slot; in sdhci_pci_probe_slot()
2239 chip->fixes->remove_slot(slot, 0); in sdhci_pci_probe_slot()
2247 static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot) in sdhci_pci_remove_slot() argument
2253 scratch = readl(slot->host->ioaddr + SDHCI_INT_STATUS); in sdhci_pci_remove_slot()
2257 if (slot->chip->fixes && slot->chip->fixes->remove_host) in sdhci_pci_remove_slot()
2258 slot->chip->fixes->remove_host(slot, dead); in sdhci_pci_remove_slot()
2260 sdhci_remove_host(slot->host, dead); in sdhci_pci_remove_slot()
2262 if (slot->chip->fixes && slot->chip->fixes->remove_slot) in sdhci_pci_remove_slot()
2263 slot->chip->fixes->remove_slot(slot, dead); in sdhci_pci_remove_slot()
2265 sdhci_free_host(slot->host); in sdhci_pci_remove_slot()
2268 int sdhci_pci_uhs2_add_host(struct sdhci_pci_slot *slot) in sdhci_pci_uhs2_add_host() argument
2270 return sdhci_uhs2_add_host(slot->host); in sdhci_pci_uhs2_add_host()
2273 void sdhci_pci_uhs2_remove_host(struct sdhci_pci_slot *slot, int dead) in sdhci_pci_uhs2_remove_host() argument
2275 sdhci_uhs2_remove_host(slot->host, dead); in sdhci_pci_uhs2_remove_host()
2298 struct sdhci_pci_slot *slot; in sdhci_pci_probe() local
2314 dev_dbg(&pdev->dev, "found %d slot(s)\n", slots); in sdhci_pci_probe()
2359 slot = sdhci_pci_probe_slot(pdev, chip, first_bar, i); in sdhci_pci_probe()
2360 if (IS_ERR(slot)) { in sdhci_pci_probe()
2363 return PTR_ERR(slot); in sdhci_pci_probe()
2366 chip->slots[i] = slot; in sdhci_pci_probe()