Lines Matching refs:slot

54 		struct sdhci_pci_slot *slot = chip->slots[i];  in sdhci_pci_init_wakeup()  local
56 if (slot) { in sdhci_pci_init_wakeup()
57 pm_flags |= slot->host->mmc->pm_flags; in sdhci_pci_init_wakeup()
58 if (slot->host->mmc->caps & MMC_CAP_CD_WAKE) in sdhci_pci_init_wakeup()
78 struct sdhci_pci_slot *slot = chip->slots[i]; in sdhci_pci_suspend_host() local
81 if (!slot) in sdhci_pci_suspend_host()
84 host = slot->host; in sdhci_pci_suspend_host()
107 struct sdhci_pci_slot *slot; in sdhci_pci_resume_host() local
111 slot = chip->slots[i]; in sdhci_pci_resume_host()
112 if (!slot) in sdhci_pci_resume_host()
115 ret = sdhci_resume_host(slot->host); in sdhci_pci_resume_host()
119 mmc_gpio_set_cd_wake(slot->host->mmc, false); in sdhci_pci_resume_host()
151 struct sdhci_pci_slot *slot; in sdhci_pci_runtime_suspend_host() local
156 slot = chip->slots[i]; in sdhci_pci_runtime_suspend_host()
157 if (!slot) in sdhci_pci_runtime_suspend_host()
160 host = slot->host; in sdhci_pci_runtime_suspend_host()
181 struct sdhci_pci_slot *slot; in sdhci_pci_runtime_resume_host() local
185 slot = chip->slots[i]; in sdhci_pci_runtime_resume_host()
186 if (!slot) in sdhci_pci_runtime_resume_host()
189 ret = sdhci_runtime_resume_host(slot->host, 0); in sdhci_pci_runtime_resume_host()
252 static int ricoh_mmc_probe_slot(struct sdhci_pci_slot *slot) in ricoh_mmc_probe_slot() argument
263 __sdhci_read_caps(slot->host, NULL, &caps, &caps1); in ricoh_mmc_probe_slot()
310 static int ene_714_probe_slot(struct sdhci_pci_slot *slot) in ene_714_probe_slot() argument
312 slot->host->mmc_host_ops.set_ios = ene_714_set_ios; in ene_714_probe_slot()
338 static int mrst_hc_probe_slot(struct sdhci_pci_slot *slot) in mrst_hc_probe_slot() argument
340 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in mrst_hc_probe_slot()
358 static int pch_hc_probe_slot(struct sdhci_pci_slot *slot) in pch_hc_probe_slot() argument
360 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in pch_hc_probe_slot()
364 static int mfd_emmc_probe_slot(struct sdhci_pci_slot *slot) in mfd_emmc_probe_slot() argument
366 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE; in mfd_emmc_probe_slot()
367 slot->host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC; in mfd_emmc_probe_slot()
371 static int mfd_sdio_probe_slot(struct sdhci_pci_slot *slot) in mfd_sdio_probe_slot() argument
373 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE; in mfd_sdio_probe_slot()
559 struct sdhci_pci_slot *slot = sdhci_priv(host); in intel_select_drive_strength() local
560 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_select_drive_strength()
589 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_intel_set_power() local
590 struct intel_host *intel_host = sdhci_pci_priv(slot); in sdhci_intel_set_power()
658 struct sdhci_pci_slot *slot = sdhci_priv(host); in intel_start_signal_voltage_switch() local
659 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_start_signal_voltage_switch()
707 static void byt_read_dsm(struct sdhci_pci_slot *slot) in byt_read_dsm() argument
709 struct intel_host *intel_host = sdhci_pci_priv(slot); in byt_read_dsm()
710 struct device *dev = &slot->chip->pdev->dev; in byt_read_dsm()
711 struct mmc_host *mmc = slot->host->mmc; in byt_read_dsm()
714 slot->chip->rpm_retune = intel_host->d3_retune; in byt_read_dsm()
744 static void intel_cache_ltr(struct sdhci_pci_slot *slot) in intel_cache_ltr() argument
746 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_cache_ltr()
747 struct sdhci_host *host = slot->host; in intel_cache_ltr()
756 struct sdhci_pci_slot *slot = chip->slots[0]; in intel_ltr_set() local
757 struct intel_host *intel_host = sdhci_pci_priv(slot); in intel_ltr_set()
758 struct sdhci_host *host = slot->host; in intel_ltr_set()
794 intel_cache_ltr(slot); in intel_ltr_set()
837 static void byt_probe_slot(struct sdhci_pci_slot *slot) in byt_probe_slot() argument
839 struct mmc_host_ops *ops = &slot->host->mmc_host_ops; in byt_probe_slot()
840 struct device *dev = &slot->chip->pdev->dev; in byt_probe_slot()
841 struct mmc_host *mmc = slot->host->mmc; in byt_probe_slot()
843 byt_read_dsm(slot); in byt_probe_slot()
845 byt_ocp_setting(slot->chip->pdev); in byt_probe_slot()
853 slot->chip->slots[mmc->slotno] = slot; in byt_probe_slot()
854 intel_ltr_expose(slot->chip); in byt_probe_slot()
858 static void byt_add_debugfs(struct sdhci_pci_slot *slot) in byt_add_debugfs() argument
860 struct intel_host *intel_host = sdhci_pci_priv(slot); in byt_add_debugfs()
861 struct mmc_host *mmc = slot->host->mmc; in byt_add_debugfs()
864 if (!intel_use_ltr(slot->chip)) in byt_add_debugfs()
870 intel_cache_ltr(slot); in byt_add_debugfs()
873 static int byt_add_host(struct sdhci_pci_slot *slot) in byt_add_host() argument
875 int ret = sdhci_add_host(slot->host); in byt_add_host()
878 byt_add_debugfs(slot); in byt_add_host()
882 static void byt_remove_slot(struct sdhci_pci_slot *slot, int dead) in byt_remove_slot() argument
884 struct mmc_host *mmc = slot->host->mmc; in byt_remove_slot()
887 intel_ltr_hide(slot->chip); in byt_remove_slot()
890 static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot) in byt_emmc_probe_slot() argument
892 byt_probe_slot(slot); in byt_emmc_probe_slot()
893 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | in byt_emmc_probe_slot()
897 slot->hw_reset = sdhci_pci_int_hw_reset; in byt_emmc_probe_slot()
898 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BSW_EMMC) in byt_emmc_probe_slot()
899 slot->host->timeout_clk = 1000; /* 1000 kHz i.e. 1 MHz */ in byt_emmc_probe_slot()
900 slot->host->mmc_host_ops.select_drive_strength = in byt_emmc_probe_slot()
905 static bool glk_broken_cqhci(struct sdhci_pci_slot *slot) in glk_broken_cqhci() argument
907 return slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_GLK_EMMC && in glk_broken_cqhci()
912 static bool jsl_broken_hs400es(struct sdhci_pci_slot *slot) in jsl_broken_hs400es() argument
914 return slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_JSL_EMMC && in jsl_broken_hs400es()
918 static int glk_emmc_probe_slot(struct sdhci_pci_slot *slot) in glk_emmc_probe_slot() argument
920 int ret = byt_emmc_probe_slot(slot); in glk_emmc_probe_slot()
922 if (!glk_broken_cqhci(slot)) in glk_emmc_probe_slot()
923 slot->host->mmc->caps2 |= MMC_CAP2_CQE; in glk_emmc_probe_slot()
925 if (slot->chip->pdev->device != PCI_DEVICE_ID_INTEL_GLK_EMMC) { in glk_emmc_probe_slot()
926 if (!jsl_broken_hs400es(slot)) { in glk_emmc_probe_slot()
927 slot->host->mmc->caps2 |= MMC_CAP2_HS400_ES; in glk_emmc_probe_slot()
928 slot->host->mmc_host_ops.hs400_enhanced_strobe = in glk_emmc_probe_slot()
931 slot->host->mmc->caps2 |= MMC_CAP2_CQE_DCMD; in glk_emmc_probe_slot()
943 static int glk_emmc_add_host(struct sdhci_pci_slot *slot) in glk_emmc_add_host() argument
945 struct device *dev = &slot->chip->pdev->dev; in glk_emmc_add_host()
946 struct sdhci_host *host = slot->host; in glk_emmc_add_host()
977 byt_add_debugfs(slot); in glk_emmc_add_host()
994 struct sdhci_pci_slot *slot = chip->slots[0]; in glk_rpm_retune_wa() local
995 struct intel_host *intel_host = sdhci_pci_priv(slot); in glk_rpm_retune_wa()
996 struct sdhci_host *host = slot->host; in glk_rpm_retune_wa()
1058 static int ni_set_max_freq(struct sdhci_pci_slot *slot) in ni_set_max_freq() argument
1063 status = acpi_evaluate_integer(ACPI_HANDLE(&slot->chip->pdev->dev), in ni_set_max_freq()
1066 dev_err(&slot->chip->pdev->dev, in ni_set_max_freq()
1071 slot->host->mmc->f_max = max_freq * 1000000; in ni_set_max_freq()
1076 static inline int ni_set_max_freq(struct sdhci_pci_slot *slot) in ni_set_max_freq() argument
1082 static int ni_byt_sdio_probe_slot(struct sdhci_pci_slot *slot) in ni_byt_sdio_probe_slot() argument
1086 byt_probe_slot(slot); in ni_byt_sdio_probe_slot()
1088 err = ni_set_max_freq(slot); in ni_byt_sdio_probe_slot()
1092 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | in ni_byt_sdio_probe_slot()
1097 static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot) in byt_sdio_probe_slot() argument
1099 byt_probe_slot(slot); in byt_sdio_probe_slot()
1100 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | in byt_sdio_probe_slot()
1105 static void byt_needs_pwr_off(struct sdhci_pci_slot *slot) in byt_needs_pwr_off() argument
1107 struct intel_host *intel_host = sdhci_pci_priv(slot); in byt_needs_pwr_off()
1108 u8 reg = sdhci_readb(slot->host, SDHCI_POWER_CONTROL); in byt_needs_pwr_off()
1113 static int byt_sd_probe_slot(struct sdhci_pci_slot *slot) in byt_sd_probe_slot() argument
1115 byt_probe_slot(slot); in byt_sd_probe_slot()
1116 slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY | in byt_sd_probe_slot()
1118 slot->cd_idx = 0; in byt_sd_probe_slot()
1119 slot->cd_override_level = true; in byt_sd_probe_slot()
1120 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD || in byt_sd_probe_slot()
1121 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXTM_SD || in byt_sd_probe_slot()
1122 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_APL_SD || in byt_sd_probe_slot()
1123 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_GLK_SD) in byt_sd_probe_slot()
1124 slot->host->mmc_host_ops.get_cd = bxt_get_cd; in byt_sd_probe_slot()
1126 if (slot->chip->pdev->subsystem_vendor == PCI_VENDOR_ID_NI && in byt_sd_probe_slot()
1127 slot->chip->pdev->subsystem_device == PCI_SUBDEVICE_ID_NI_78E3) in byt_sd_probe_slot()
1128 slot->host->mmc->caps2 |= MMC_CAP2_AVOID_3_3V; in byt_sd_probe_slot()
1130 byt_needs_pwr_off(slot); in byt_sd_probe_slot()
1265 static void intel_mrfld_mmc_fix_up_power_slot(struct sdhci_pci_slot *slot) in intel_mrfld_mmc_fix_up_power_slot() argument
1269 device = ACPI_COMPANION(&slot->chip->pdev->dev); in intel_mrfld_mmc_fix_up_power_slot()
1274 static inline void intel_mrfld_mmc_fix_up_power_slot(struct sdhci_pci_slot *slot) {} in intel_mrfld_mmc_fix_up_power_slot() argument
1277 static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot) in intel_mrfld_mmc_probe_slot() argument
1279 unsigned int func = PCI_FUNC(slot->chip->pdev->devfn); in intel_mrfld_mmc_probe_slot()
1284 slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE | in intel_mrfld_mmc_probe_slot()
1289 slot->cd_idx = 0; in intel_mrfld_mmc_probe_slot()
1290 slot->cd_override_level = true; in intel_mrfld_mmc_probe_slot()
1296 slot->host->mmc_host_ops.get_cd = mrfld_get_cd; in intel_mrfld_mmc_probe_slot()
1297 slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; in intel_mrfld_mmc_probe_slot()
1301 slot->host->ocr_mask = MMC_VDD_20_21 | MMC_VDD_165_195; in intel_mrfld_mmc_probe_slot()
1302 slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE | in intel_mrfld_mmc_probe_slot()
1309 intel_mrfld_mmc_fix_up_power_slot(slot); in intel_mrfld_mmc_probe_slot()
1427 static int jmicron_probe_slot(struct sdhci_pci_slot *slot) in jmicron_probe_slot() argument
1429 if (slot->chip->pdev->revision == 0) { in jmicron_probe_slot()
1432 version = readl(slot->host->ioaddr + SDHCI_HOST_VERSION); in jmicron_probe_slot()
1442 slot->host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; in jmicron_probe_slot()
1446 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) { in jmicron_probe_slot()
1447 slot->host->ocr_avail_sd = MMC_VDD_32_33 | MMC_VDD_33_34 | in jmicron_probe_slot()
1450 slot->host->ocr_avail_mmc = MMC_VDD_32_33 | MMC_VDD_33_34 | in jmicron_probe_slot()
1458 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || in jmicron_probe_slot()
1459 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) in jmicron_probe_slot()
1460 jmicron_enable_mmc(slot->host, 1); in jmicron_probe_slot()
1462 slot->host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST; in jmicron_probe_slot()
1467 static void jmicron_remove_slot(struct sdhci_pci_slot *slot, int dead) in jmicron_remove_slot() argument
1472 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || in jmicron_remove_slot()
1473 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) in jmicron_remove_slot()
1474 jmicron_enable_mmc(slot->host, 0); in jmicron_remove_slot()
1555 static int syskt_probe_slot(struct sdhci_pci_slot *slot) in syskt_probe_slot() argument
1559 u8 board_rev = readb(slot->host->ioaddr + SYSKT_BOARD_REV); in syskt_probe_slot()
1560 u8 chip_rev = readb(slot->host->ioaddr + SYSKT_CHIP_REV); in syskt_probe_slot()
1561 dev_info(&slot->chip->pdev->dev, "SysKonnect CardBus2SDIO, " in syskt_probe_slot()
1566 slot->host->quirks |= SDHCI_QUIRK_FORCE_DMA; in syskt_probe_slot()
1568 writeb(SYSKT_POWER_330, slot->host->ioaddr + SYSKT_POWER_DATA); in syskt_probe_slot()
1569 writeb(SYSKT_POWER_START, slot->host->ioaddr + SYSKT_POWER_CMD); in syskt_probe_slot()
1573 ps = readw(slot->host->ioaddr + SYSKT_POWER_STATUS); in syskt_probe_slot()
1579 dev_err(&slot->chip->pdev->dev, in syskt_probe_slot()
1581 writeb(0, slot->host->ioaddr + SYSKT_POWER_CMD); in syskt_probe_slot()
1606 static int rtsx_probe_slot(struct sdhci_pci_slot *slot) in rtsx_probe_slot() argument
1608 slot->host->mmc->caps2 |= MMC_CAP2_HS200; in rtsx_probe_slot()
1670 struct sdhci_pci_slot *slot = sdhci_priv(host); in amd_execute_tuning_hs200() local
1671 struct pci_dev *pdev = slot->chip->pdev; in amd_execute_tuning_hs200()
1719 static int amd_probe_slot(struct sdhci_pci_slot *slot) in amd_probe_slot() argument
1721 struct mmc_host_ops *ops = &slot->host->mmc_host_ops; in amd_probe_slot()
1765 struct sdhci_pci_slot *slot = sdhci_priv(host); in amd_sdhci_reset() local
1766 struct pci_dev *pdev = slot->chip->pdev; in amd_sdhci_reset()
1930 struct sdhci_pci_slot *slot; in sdhci_pci_enable_dma() local
1933 slot = sdhci_priv(host); in sdhci_pci_enable_dma()
1934 pdev = slot->chip->pdev; in sdhci_pci_enable_dma()
1950 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_pci_hw_reset() local
1952 if (slot->hw_reset) in sdhci_pci_hw_reset()
1953 slot->hw_reset(host); in sdhci_pci_hw_reset()
2043 struct sdhci_pci_slot *slot; in sdhci_pci_probe_slot() local
2068 host = sdhci_alloc_host(&pdev->dev, sizeof(*slot) + priv_size); in sdhci_pci_probe_slot()
2074 slot = sdhci_priv(host); in sdhci_pci_probe_slot()
2076 slot->chip = chip; in sdhci_pci_probe_slot()
2077 slot->host = host; in sdhci_pci_probe_slot()
2078 slot->cd_idx = -1; in sdhci_pci_probe_slot()
2098 ret = chip->fixes->probe_slot(slot); in sdhci_pci_probe_slot()
2113 if (slot->cd_idx >= 0) { in sdhci_pci_probe_slot()
2114 ret = mmc_gpiod_request_cd(host->mmc, "cd", slot->cd_idx, in sdhci_pci_probe_slot()
2115 slot->cd_override_level, 0); in sdhci_pci_probe_slot()
2118 slot->cd_idx, in sdhci_pci_probe_slot()
2119 slot->cd_override_level, in sdhci_pci_probe_slot()
2126 slot->cd_idx = -1; in sdhci_pci_probe_slot()
2131 ret = chip->fixes->add_host(slot); in sdhci_pci_probe_slot()
2141 if (chip->fixes && chip->fixes->own_cd_for_runtime_pm && slot->cd_idx < 0) in sdhci_pci_probe_slot()
2144 return slot; in sdhci_pci_probe_slot()
2148 chip->fixes->remove_slot(slot, 0); in sdhci_pci_probe_slot()
2156 static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot) in sdhci_pci_remove_slot() argument
2162 scratch = readl(slot->host->ioaddr + SDHCI_INT_STATUS); in sdhci_pci_remove_slot()
2166 sdhci_remove_host(slot->host, dead); in sdhci_pci_remove_slot()
2168 if (slot->chip->fixes && slot->chip->fixes->remove_slot) in sdhci_pci_remove_slot()
2169 slot->chip->fixes->remove_slot(slot, dead); in sdhci_pci_remove_slot()
2171 sdhci_free_host(slot->host); in sdhci_pci_remove_slot()
2194 struct sdhci_pci_slot *slot; in sdhci_pci_probe() local
2255 slot = sdhci_pci_probe_slot(pdev, chip, first_bar, i); in sdhci_pci_probe()
2256 if (IS_ERR(slot)) { in sdhci_pci_probe()
2259 return PTR_ERR(slot); in sdhci_pci_probe()
2262 chip->slots[i] = slot; in sdhci_pci_probe()