Lines Matching refs:slot
49 static int ricoh_mmc_probe_slot(struct sdhci_pci_slot *slot) in ricoh_mmc_probe_slot() argument
51 slot->host->caps = in ricoh_mmc_probe_slot()
112 static int mrst_hc_probe_slot(struct sdhci_pci_slot *slot) in mrst_hc_probe_slot() argument
114 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in mrst_hc_probe_slot()
132 static int pch_hc_probe_slot(struct sdhci_pci_slot *slot) in pch_hc_probe_slot() argument
134 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in pch_hc_probe_slot()
142 struct sdhci_pci_slot *slot = dev_id; in sdhci_pci_sd_cd() local
143 struct sdhci_host *host = slot->host; in sdhci_pci_sd_cd()
149 static void sdhci_pci_add_own_cd(struct sdhci_pci_slot *slot) in sdhci_pci_add_own_cd() argument
151 int err, irq, gpio = slot->cd_gpio; in sdhci_pci_add_own_cd()
153 slot->cd_gpio = -EINVAL; in sdhci_pci_add_own_cd()
154 slot->cd_irq = -EINVAL; in sdhci_pci_add_own_cd()
172 IRQF_TRIGGER_FALLING, "sd_cd", slot); in sdhci_pci_add_own_cd()
176 slot->cd_gpio = gpio; in sdhci_pci_add_own_cd()
177 slot->cd_irq = irq; in sdhci_pci_add_own_cd()
184 dev_warn(&slot->chip->pdev->dev, "failed to setup card detect wake up\n"); in sdhci_pci_add_own_cd()
187 static void sdhci_pci_remove_own_cd(struct sdhci_pci_slot *slot) in sdhci_pci_remove_own_cd() argument
189 if (slot->cd_irq >= 0) in sdhci_pci_remove_own_cd()
190 free_irq(slot->cd_irq, slot); in sdhci_pci_remove_own_cd()
191 if (gpio_is_valid(slot->cd_gpio)) in sdhci_pci_remove_own_cd()
192 gpio_free(slot->cd_gpio); in sdhci_pci_remove_own_cd()
197 static inline void sdhci_pci_add_own_cd(struct sdhci_pci_slot *slot) in sdhci_pci_add_own_cd() argument
201 static inline void sdhci_pci_remove_own_cd(struct sdhci_pci_slot *slot) in sdhci_pci_remove_own_cd() argument
207 static int mfd_emmc_probe_slot(struct sdhci_pci_slot *slot) in mfd_emmc_probe_slot() argument
209 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE; in mfd_emmc_probe_slot()
210 slot->host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC | in mfd_emmc_probe_slot()
215 static int mfd_sdio_probe_slot(struct sdhci_pci_slot *slot) in mfd_sdio_probe_slot() argument
217 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE; in mfd_sdio_probe_slot()
360 static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot) in byt_emmc_probe_slot() argument
362 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | in byt_emmc_probe_slot()
365 slot->host->mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ; in byt_emmc_probe_slot()
366 slot->hw_reset = sdhci_pci_int_hw_reset; in byt_emmc_probe_slot()
367 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BSW_EMMC) in byt_emmc_probe_slot()
368 slot->host->timeout_clk = 1000; /* 1000 kHz i.e. 1 MHz */ in byt_emmc_probe_slot()
369 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_SPT_EMMC) { in byt_emmc_probe_slot()
370 spt_read_drive_strength(slot->host); in byt_emmc_probe_slot()
371 slot->select_drive_strength = spt_select_drive_strength; in byt_emmc_probe_slot()
376 static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot) in byt_sdio_probe_slot() argument
378 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | in byt_sdio_probe_slot()
383 static int byt_sd_probe_slot(struct sdhci_pci_slot *slot) in byt_sd_probe_slot() argument
385 slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; in byt_sd_probe_slot()
386 slot->cd_con_id = NULL; in byt_sd_probe_slot()
387 slot->cd_idx = 0; in byt_sd_probe_slot()
388 slot->cd_override_level = true; in byt_sd_probe_slot()
389 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD || in byt_sd_probe_slot()
390 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXTM_SD || in byt_sd_probe_slot()
391 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_APL_SD) in byt_sd_probe_slot()
392 slot->host->mmc_host_ops.get_cd = bxt_get_cd; in byt_sd_probe_slot()
428 static int intel_mrfl_mmc_probe_slot(struct sdhci_pci_slot *slot) in intel_mrfl_mmc_probe_slot() argument
430 if ((PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFL_EMMC_0) && in intel_mrfl_mmc_probe_slot()
431 (PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFL_EMMC_1)) in intel_mrfl_mmc_probe_slot()
435 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | in intel_mrfl_mmc_probe_slot()
561 static int jmicron_probe_slot(struct sdhci_pci_slot *slot) in jmicron_probe_slot() argument
563 if (slot->chip->pdev->revision == 0) { in jmicron_probe_slot()
566 version = readl(slot->host->ioaddr + SDHCI_HOST_VERSION); in jmicron_probe_slot()
576 slot->host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; in jmicron_probe_slot()
580 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) { in jmicron_probe_slot()
581 slot->host->ocr_avail_sd = MMC_VDD_32_33 | MMC_VDD_33_34 | in jmicron_probe_slot()
584 slot->host->ocr_avail_mmc = MMC_VDD_32_33 | MMC_VDD_33_34 | in jmicron_probe_slot()
592 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || in jmicron_probe_slot()
593 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) in jmicron_probe_slot()
594 jmicron_enable_mmc(slot->host, 1); in jmicron_probe_slot()
596 slot->host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST; in jmicron_probe_slot()
601 static void jmicron_remove_slot(struct sdhci_pci_slot *slot, int dead) in jmicron_remove_slot() argument
606 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || in jmicron_remove_slot()
607 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) in jmicron_remove_slot()
608 jmicron_enable_mmc(slot->host, 0); in jmicron_remove_slot()
689 static int syskt_probe_slot(struct sdhci_pci_slot *slot) in syskt_probe_slot() argument
693 u8 board_rev = readb(slot->host->ioaddr + SYSKT_BOARD_REV); in syskt_probe_slot()
694 u8 chip_rev = readb(slot->host->ioaddr + SYSKT_CHIP_REV); in syskt_probe_slot()
695 dev_info(&slot->chip->pdev->dev, "SysKonnect CardBus2SDIO, " in syskt_probe_slot()
700 slot->host->quirks |= SDHCI_QUIRK_FORCE_DMA; in syskt_probe_slot()
702 writeb(SYSKT_POWER_330, slot->host->ioaddr + SYSKT_POWER_DATA); in syskt_probe_slot()
703 writeb(SYSKT_POWER_START, slot->host->ioaddr + SYSKT_POWER_CMD); in syskt_probe_slot()
707 ps = readw(slot->host->ioaddr + SYSKT_POWER_STATUS); in syskt_probe_slot()
713 dev_err(&slot->chip->pdev->dev, in syskt_probe_slot()
715 writeb(0, slot->host->ioaddr + SYSKT_POWER_CMD); in syskt_probe_slot()
740 static int rtsx_probe_slot(struct sdhci_pci_slot *slot) in rtsx_probe_slot() argument
742 slot->host->mmc->caps2 |= MMC_CAP2_HS200; in rtsx_probe_slot()
1325 struct sdhci_pci_slot *slot; in sdhci_pci_enable_dma() local
1329 slot = sdhci_priv(host); in sdhci_pci_enable_dma()
1330 pdev = slot->chip->pdev; in sdhci_pci_enable_dma()
1383 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_pci_gpio_hw_reset() local
1384 int rst_n_gpio = slot->rst_n_gpio; in sdhci_pci_gpio_hw_reset()
1398 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_pci_hw_reset() local
1400 if (slot->hw_reset) in sdhci_pci_hw_reset()
1401 slot->hw_reset(host); in sdhci_pci_hw_reset()
1409 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_pci_select_drive_strength() local
1411 if (!slot->select_drive_strength) in sdhci_pci_select_drive_strength()
1414 return slot->select_drive_strength(host, card, max_dtr, host_drv, in sdhci_pci_select_drive_strength()
1440 struct sdhci_pci_slot *slot; in sdhci_pci_suspend() local
1450 slot = chip->slots[i]; in sdhci_pci_suspend()
1451 if (!slot) in sdhci_pci_suspend()
1454 ret = sdhci_suspend_host(slot->host); in sdhci_pci_suspend()
1459 slot_pm_flags = slot->host->mmc->pm_flags; in sdhci_pci_suspend()
1461 sdhci_enable_irq_wakeups(slot->host); in sdhci_pci_suspend()
1492 struct sdhci_pci_slot *slot; in sdhci_pci_resume() local
1506 slot = chip->slots[i]; in sdhci_pci_resume()
1507 if (!slot) in sdhci_pci_resume()
1510 ret = sdhci_resume_host(slot->host); in sdhci_pci_resume()
1522 struct sdhci_pci_slot *slot; in sdhci_pci_runtime_suspend() local
1530 slot = chip->slots[i]; in sdhci_pci_runtime_suspend()
1531 if (!slot) in sdhci_pci_runtime_suspend()
1534 ret = sdhci_runtime_suspend_host(slot->host); in sdhci_pci_runtime_suspend()
1558 struct sdhci_pci_slot *slot; in sdhci_pci_runtime_resume() local
1572 slot = chip->slots[i]; in sdhci_pci_runtime_resume()
1573 if (!slot) in sdhci_pci_runtime_resume()
1576 ret = sdhci_runtime_resume_host(slot->host); in sdhci_pci_runtime_resume()
1608 struct sdhci_pci_slot *slot; in sdhci_pci_probe_slot() local
1638 slot = sdhci_priv(host); in sdhci_pci_probe_slot()
1640 slot->chip = chip; in sdhci_pci_probe_slot()
1641 slot->host = host; in sdhci_pci_probe_slot()
1642 slot->pci_bar = bar; in sdhci_pci_probe_slot()
1643 slot->rst_n_gpio = -EINVAL; in sdhci_pci_probe_slot()
1644 slot->cd_gpio = -EINVAL; in sdhci_pci_probe_slot()
1645 slot->cd_idx = -1; in sdhci_pci_probe_slot()
1649 slot->data = sdhci_pci_get_data(pdev, slotno); in sdhci_pci_probe_slot()
1651 if (slot->data) { in sdhci_pci_probe_slot()
1652 if (slot->data->setup) { in sdhci_pci_probe_slot()
1653 ret = slot->data->setup(slot->data); in sdhci_pci_probe_slot()
1659 slot->rst_n_gpio = slot->data->rst_n_gpio; in sdhci_pci_probe_slot()
1660 slot->cd_gpio = slot->data->cd_gpio; in sdhci_pci_probe_slot()
1684 ret = chip->fixes->probe_slot(slot); in sdhci_pci_probe_slot()
1689 if (gpio_is_valid(slot->rst_n_gpio)) { in sdhci_pci_probe_slot()
1690 if (!gpio_request(slot->rst_n_gpio, "eMMC_reset")) { in sdhci_pci_probe_slot()
1691 gpio_direction_output(slot->rst_n_gpio, 1); in sdhci_pci_probe_slot()
1692 slot->host->mmc->caps |= MMC_CAP_HW_RESET; in sdhci_pci_probe_slot()
1693 slot->hw_reset = sdhci_pci_gpio_hw_reset; in sdhci_pci_probe_slot()
1696 slot->rst_n_gpio = -EINVAL; in sdhci_pci_probe_slot()
1704 if (slot->cd_idx >= 0 && in sdhci_pci_probe_slot()
1705 mmc_gpiod_request_cd(host->mmc, slot->cd_con_id, slot->cd_idx, in sdhci_pci_probe_slot()
1706 slot->cd_override_level, 0, NULL)) { in sdhci_pci_probe_slot()
1708 slot->cd_idx = -1; in sdhci_pci_probe_slot()
1715 sdhci_pci_add_own_cd(slot); in sdhci_pci_probe_slot()
1723 !gpio_is_valid(slot->cd_gpio) && slot->cd_idx < 0) in sdhci_pci_probe_slot()
1726 return slot; in sdhci_pci_probe_slot()
1729 if (gpio_is_valid(slot->rst_n_gpio)) in sdhci_pci_probe_slot()
1730 gpio_free(slot->rst_n_gpio); in sdhci_pci_probe_slot()
1733 chip->fixes->remove_slot(slot, 0); in sdhci_pci_probe_slot()
1742 if (slot->data && slot->data->cleanup) in sdhci_pci_probe_slot()
1743 slot->data->cleanup(slot->data); in sdhci_pci_probe_slot()
1751 static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot) in sdhci_pci_remove_slot() argument
1756 sdhci_pci_remove_own_cd(slot); in sdhci_pci_remove_slot()
1759 scratch = readl(slot->host->ioaddr + SDHCI_INT_STATUS); in sdhci_pci_remove_slot()
1763 sdhci_remove_host(slot->host, dead); in sdhci_pci_remove_slot()
1765 if (gpio_is_valid(slot->rst_n_gpio)) in sdhci_pci_remove_slot()
1766 gpio_free(slot->rst_n_gpio); in sdhci_pci_remove_slot()
1768 if (slot->chip->fixes && slot->chip->fixes->remove_slot) in sdhci_pci_remove_slot()
1769 slot->chip->fixes->remove_slot(slot, dead); in sdhci_pci_remove_slot()
1771 if (slot->data && slot->data->cleanup) in sdhci_pci_remove_slot()
1772 slot->data->cleanup(slot->data); in sdhci_pci_remove_slot()
1774 pci_release_region(slot->chip->pdev, slot->pci_bar); in sdhci_pci_remove_slot()
1776 sdhci_free_host(slot->host); in sdhci_pci_remove_slot()
1798 struct sdhci_pci_slot *slot; in sdhci_pci_probe() local
1861 slot = sdhci_pci_probe_slot(pdev, chip, first_bar, i); in sdhci_pci_probe()
1862 if (IS_ERR(slot)) { in sdhci_pci_probe()
1865 ret = PTR_ERR(slot); in sdhci_pci_probe()
1869 chip->slots[i] = slot; in sdhci_pci_probe()