Lines Matching refs:slot

48 static int ricoh_mmc_probe_slot(struct sdhci_pci_slot *slot)  in ricoh_mmc_probe_slot()  argument
50 slot->host->caps = in ricoh_mmc_probe_slot()
111 static int mrst_hc_probe_slot(struct sdhci_pci_slot *slot) in mrst_hc_probe_slot() argument
113 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in mrst_hc_probe_slot()
131 static int pch_hc_probe_slot(struct sdhci_pci_slot *slot) in pch_hc_probe_slot() argument
133 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in pch_hc_probe_slot()
141 struct sdhci_pci_slot *slot = dev_id; in sdhci_pci_sd_cd() local
142 struct sdhci_host *host = slot->host; in sdhci_pci_sd_cd()
148 static void sdhci_pci_add_own_cd(struct sdhci_pci_slot *slot) in sdhci_pci_add_own_cd() argument
150 int err, irq, gpio = slot->cd_gpio; in sdhci_pci_add_own_cd()
152 slot->cd_gpio = -EINVAL; in sdhci_pci_add_own_cd()
153 slot->cd_irq = -EINVAL; in sdhci_pci_add_own_cd()
171 IRQF_TRIGGER_FALLING, "sd_cd", slot); in sdhci_pci_add_own_cd()
175 slot->cd_gpio = gpio; in sdhci_pci_add_own_cd()
176 slot->cd_irq = irq; in sdhci_pci_add_own_cd()
183 dev_warn(&slot->chip->pdev->dev, "failed to setup card detect wake up\n"); in sdhci_pci_add_own_cd()
186 static void sdhci_pci_remove_own_cd(struct sdhci_pci_slot *slot) in sdhci_pci_remove_own_cd() argument
188 if (slot->cd_irq >= 0) in sdhci_pci_remove_own_cd()
189 free_irq(slot->cd_irq, slot); in sdhci_pci_remove_own_cd()
190 if (gpio_is_valid(slot->cd_gpio)) in sdhci_pci_remove_own_cd()
191 gpio_free(slot->cd_gpio); in sdhci_pci_remove_own_cd()
196 static inline void sdhci_pci_add_own_cd(struct sdhci_pci_slot *slot) in sdhci_pci_add_own_cd() argument
200 static inline void sdhci_pci_remove_own_cd(struct sdhci_pci_slot *slot) in sdhci_pci_remove_own_cd() argument
206 static int mfd_emmc_probe_slot(struct sdhci_pci_slot *slot) in mfd_emmc_probe_slot() argument
208 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE; in mfd_emmc_probe_slot()
209 slot->host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC | in mfd_emmc_probe_slot()
214 static int mfd_sdio_probe_slot(struct sdhci_pci_slot *slot) in mfd_sdio_probe_slot() argument
216 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE; in mfd_sdio_probe_slot()
269 static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot) in byt_emmc_probe_slot() argument
271 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | in byt_emmc_probe_slot()
275 slot->host->mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ; in byt_emmc_probe_slot()
276 slot->hw_reset = sdhci_pci_int_hw_reset; in byt_emmc_probe_slot()
277 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BSW_EMMC) in byt_emmc_probe_slot()
278 slot->host->timeout_clk = 1000; /* 1000 kHz i.e. 1 MHz */ in byt_emmc_probe_slot()
282 static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot) in byt_sdio_probe_slot() argument
284 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | in byt_sdio_probe_slot()
290 static int byt_sd_probe_slot(struct sdhci_pci_slot *slot) in byt_sd_probe_slot() argument
292 slot->host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST | in byt_sd_probe_slot()
294 slot->cd_con_id = NULL; in byt_sd_probe_slot()
295 slot->cd_idx = 0; in byt_sd_probe_slot()
296 slot->cd_override_level = true; in byt_sd_probe_slot()
330 static int intel_mrfl_mmc_probe_slot(struct sdhci_pci_slot *slot) in intel_mrfl_mmc_probe_slot() argument
332 if ((PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFL_EMMC_0) && in intel_mrfl_mmc_probe_slot()
333 (PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFL_EMMC_1)) in intel_mrfl_mmc_probe_slot()
337 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | in intel_mrfl_mmc_probe_slot()
467 static int jmicron_probe_slot(struct sdhci_pci_slot *slot) in jmicron_probe_slot() argument
469 if (slot->chip->pdev->revision == 0) { in jmicron_probe_slot()
472 version = readl(slot->host->ioaddr + SDHCI_HOST_VERSION); in jmicron_probe_slot()
482 slot->host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; in jmicron_probe_slot()
486 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) { in jmicron_probe_slot()
487 slot->host->ocr_avail_sd = MMC_VDD_32_33 | MMC_VDD_33_34 | in jmicron_probe_slot()
490 slot->host->ocr_avail_mmc = MMC_VDD_32_33 | MMC_VDD_33_34 | in jmicron_probe_slot()
498 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || in jmicron_probe_slot()
499 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) in jmicron_probe_slot()
500 jmicron_enable_mmc(slot->host, 1); in jmicron_probe_slot()
502 slot->host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST; in jmicron_probe_slot()
507 static void jmicron_remove_slot(struct sdhci_pci_slot *slot, int dead) in jmicron_remove_slot() argument
512 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || in jmicron_remove_slot()
513 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) in jmicron_remove_slot()
514 jmicron_enable_mmc(slot->host, 0); in jmicron_remove_slot()
595 static int syskt_probe_slot(struct sdhci_pci_slot *slot) in syskt_probe_slot() argument
599 u8 board_rev = readb(slot->host->ioaddr + SYSKT_BOARD_REV); in syskt_probe_slot()
600 u8 chip_rev = readb(slot->host->ioaddr + SYSKT_CHIP_REV); in syskt_probe_slot()
601 dev_info(&slot->chip->pdev->dev, "SysKonnect CardBus2SDIO, " in syskt_probe_slot()
606 slot->host->quirks |= SDHCI_QUIRK_FORCE_DMA; in syskt_probe_slot()
608 writeb(SYSKT_POWER_330, slot->host->ioaddr + SYSKT_POWER_DATA); in syskt_probe_slot()
609 writeb(SYSKT_POWER_START, slot->host->ioaddr + SYSKT_POWER_CMD); in syskt_probe_slot()
613 ps = readw(slot->host->ioaddr + SYSKT_POWER_STATUS); in syskt_probe_slot()
619 dev_err(&slot->chip->pdev->dev, in syskt_probe_slot()
621 writeb(0, slot->host->ioaddr + SYSKT_POWER_CMD); in syskt_probe_slot()
646 static int rtsx_probe_slot(struct sdhci_pci_slot *slot) in rtsx_probe_slot() argument
648 slot->host->mmc->caps2 |= MMC_CAP2_HS200; in rtsx_probe_slot()
1128 struct sdhci_pci_slot *slot; in sdhci_pci_enable_dma() local
1132 slot = sdhci_priv(host); in sdhci_pci_enable_dma()
1133 pdev = slot->chip->pdev; in sdhci_pci_enable_dma()
1186 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_pci_gpio_hw_reset() local
1187 int rst_n_gpio = slot->rst_n_gpio; in sdhci_pci_gpio_hw_reset()
1201 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_pci_hw_reset() local
1203 if (slot->hw_reset) in sdhci_pci_hw_reset()
1204 slot->hw_reset(host); in sdhci_pci_hw_reset()
1228 struct sdhci_pci_slot *slot; in sdhci_pci_suspend() local
1238 slot = chip->slots[i]; in sdhci_pci_suspend()
1239 if (!slot) in sdhci_pci_suspend()
1242 ret = sdhci_suspend_host(slot->host); in sdhci_pci_suspend()
1247 slot_pm_flags = slot->host->mmc->pm_flags; in sdhci_pci_suspend()
1249 sdhci_enable_irq_wakeups(slot->host); in sdhci_pci_suspend()
1280 struct sdhci_pci_slot *slot; in sdhci_pci_resume() local
1294 slot = chip->slots[i]; in sdhci_pci_resume()
1295 if (!slot) in sdhci_pci_resume()
1298 ret = sdhci_resume_host(slot->host); in sdhci_pci_resume()
1310 struct sdhci_pci_slot *slot; in sdhci_pci_runtime_suspend() local
1318 slot = chip->slots[i]; in sdhci_pci_runtime_suspend()
1319 if (!slot) in sdhci_pci_runtime_suspend()
1322 ret = sdhci_runtime_suspend_host(slot->host); in sdhci_pci_runtime_suspend()
1346 struct sdhci_pci_slot *slot; in sdhci_pci_runtime_resume() local
1360 slot = chip->slots[i]; in sdhci_pci_runtime_resume()
1361 if (!slot) in sdhci_pci_runtime_resume()
1364 ret = sdhci_runtime_resume_host(slot->host); in sdhci_pci_runtime_resume()
1396 struct sdhci_pci_slot *slot; in sdhci_pci_probe_slot() local
1426 slot = sdhci_priv(host); in sdhci_pci_probe_slot()
1428 slot->chip = chip; in sdhci_pci_probe_slot()
1429 slot->host = host; in sdhci_pci_probe_slot()
1430 slot->pci_bar = bar; in sdhci_pci_probe_slot()
1431 slot->rst_n_gpio = -EINVAL; in sdhci_pci_probe_slot()
1432 slot->cd_gpio = -EINVAL; in sdhci_pci_probe_slot()
1433 slot->cd_idx = -1; in sdhci_pci_probe_slot()
1437 slot->data = sdhci_pci_get_data(pdev, slotno); in sdhci_pci_probe_slot()
1439 if (slot->data) { in sdhci_pci_probe_slot()
1440 if (slot->data->setup) { in sdhci_pci_probe_slot()
1441 ret = slot->data->setup(slot->data); in sdhci_pci_probe_slot()
1447 slot->rst_n_gpio = slot->data->rst_n_gpio; in sdhci_pci_probe_slot()
1448 slot->cd_gpio = slot->data->cd_gpio; in sdhci_pci_probe_slot()
1472 ret = chip->fixes->probe_slot(slot); in sdhci_pci_probe_slot()
1477 if (gpio_is_valid(slot->rst_n_gpio)) { in sdhci_pci_probe_slot()
1478 if (!gpio_request(slot->rst_n_gpio, "eMMC_reset")) { in sdhci_pci_probe_slot()
1479 gpio_direction_output(slot->rst_n_gpio, 1); in sdhci_pci_probe_slot()
1480 slot->host->mmc->caps |= MMC_CAP_HW_RESET; in sdhci_pci_probe_slot()
1481 slot->hw_reset = sdhci_pci_gpio_hw_reset; in sdhci_pci_probe_slot()
1484 slot->rst_n_gpio = -EINVAL; in sdhci_pci_probe_slot()
1492 if (slot->cd_idx >= 0 && in sdhci_pci_probe_slot()
1493 mmc_gpiod_request_cd(host->mmc, slot->cd_con_id, slot->cd_idx, in sdhci_pci_probe_slot()
1494 slot->cd_override_level, 0, NULL)) { in sdhci_pci_probe_slot()
1496 slot->cd_idx = -1; in sdhci_pci_probe_slot()
1503 sdhci_pci_add_own_cd(slot); in sdhci_pci_probe_slot()
1511 !gpio_is_valid(slot->cd_gpio) && slot->cd_idx < 0) in sdhci_pci_probe_slot()
1514 return slot; in sdhci_pci_probe_slot()
1517 if (gpio_is_valid(slot->rst_n_gpio)) in sdhci_pci_probe_slot()
1518 gpio_free(slot->rst_n_gpio); in sdhci_pci_probe_slot()
1521 chip->fixes->remove_slot(slot, 0); in sdhci_pci_probe_slot()
1530 if (slot->data && slot->data->cleanup) in sdhci_pci_probe_slot()
1531 slot->data->cleanup(slot->data); in sdhci_pci_probe_slot()
1539 static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot) in sdhci_pci_remove_slot() argument
1544 sdhci_pci_remove_own_cd(slot); in sdhci_pci_remove_slot()
1547 scratch = readl(slot->host->ioaddr + SDHCI_INT_STATUS); in sdhci_pci_remove_slot()
1551 sdhci_remove_host(slot->host, dead); in sdhci_pci_remove_slot()
1553 if (gpio_is_valid(slot->rst_n_gpio)) in sdhci_pci_remove_slot()
1554 gpio_free(slot->rst_n_gpio); in sdhci_pci_remove_slot()
1556 if (slot->chip->fixes && slot->chip->fixes->remove_slot) in sdhci_pci_remove_slot()
1557 slot->chip->fixes->remove_slot(slot, dead); in sdhci_pci_remove_slot()
1559 if (slot->data && slot->data->cleanup) in sdhci_pci_remove_slot()
1560 slot->data->cleanup(slot->data); in sdhci_pci_remove_slot()
1562 pci_release_region(slot->chip->pdev, slot->pci_bar); in sdhci_pci_remove_slot()
1564 sdhci_free_host(slot->host); in sdhci_pci_remove_slot()
1586 struct sdhci_pci_slot *slot; in sdhci_pci_probe() local
1649 slot = sdhci_pci_probe_slot(pdev, chip, first_bar, i); in sdhci_pci_probe()
1650 if (IS_ERR(slot)) { in sdhci_pci_probe()
1653 ret = PTR_ERR(slot); in sdhci_pci_probe()
1657 chip->slots[i] = slot; in sdhci_pci_probe()