Lines Matching refs:host
51 slot->host->caps = in ricoh_mmc_probe_slot()
114 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in mrst_hc_probe_slot()
134 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; in pch_hc_probe_slot()
143 struct sdhci_host *host = slot->host; in sdhci_pci_sd_cd() local
145 mmc_detect_change(host->mmc, msecs_to_jiffies(200)); in sdhci_pci_sd_cd()
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()
217 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE; in mfd_sdio_probe_slot()
255 static void sdhci_pci_int_hw_reset(struct sdhci_host *host) in sdhci_pci_int_hw_reset() argument
259 reg = sdhci_readb(host, SDHCI_POWER_CONTROL); in sdhci_pci_int_hw_reset()
261 sdhci_writeb(host, reg, SDHCI_POWER_CONTROL); in sdhci_pci_int_hw_reset()
265 sdhci_writeb(host, reg, SDHCI_POWER_CONTROL); in sdhci_pci_int_hw_reset()
270 static int spt_select_drive_strength(struct sdhci_host *host, in spt_select_drive_strength() argument
289 static void spt_read_drive_strength(struct sdhci_host *host) in spt_read_drive_strength() argument
299 m = sdhci_readw(host, SDHCI_HOST_CONTROL2) & 0x7; in spt_read_drive_strength()
302 val = sdhci_readl(host, SDHCI_PRESENT_STATE); in spt_read_drive_strength()
305 sdhci_writel(host, 0x007f0023, SDHCI_INT_ENABLE); in spt_read_drive_strength()
306 sdhci_writel(host, 0, SDHCI_SIGNAL_ENABLE); in spt_read_drive_strength()
307 sdhci_writew(host, 0x10, SDHCI_TRANSFER_MODE); in spt_read_drive_strength()
308 sdhci_writeb(host, 0xe, SDHCI_TIMEOUT_CONTROL); in spt_read_drive_strength()
309 sdhci_writew(host, 512, SDHCI_BLOCK_SIZE); in spt_read_drive_strength()
310 sdhci_writew(host, 1, SDHCI_BLOCK_COUNT); in spt_read_drive_strength()
311 sdhci_writel(host, 0, SDHCI_ARGUMENT); in spt_read_drive_strength()
312 sdhci_writew(host, 0x83b, SDHCI_COMMAND); in spt_read_drive_strength()
314 val = sdhci_readl(host, SDHCI_INT_STATUS); in spt_read_drive_strength()
321 val = sdhci_readl(host, SDHCI_PRESENT_STATE); in spt_read_drive_strength()
325 val = sdhci_readl(host, SDHCI_BUFFER); in spt_read_drive_strength()
336 struct sdhci_host *host = mmc_priv(mmc); in bxt_get_cd() local
345 spin_lock_irqsave(&host->lock, flags); in bxt_get_cd()
347 if (host->flags & SDHCI_DEVICE_DEAD) in bxt_get_cd()
350 ret = !!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT); in bxt_get_cd()
352 spin_unlock_irqrestore(&host->lock, flags); in bxt_get_cd()
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()
368 slot->host->timeout_clk = 1000; /* 1000 kHz i.e. 1 MHz */ in byt_emmc_probe_slot()
370 spt_read_drive_strength(slot->host); in byt_emmc_probe_slot()
378 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | in byt_sdio_probe_slot()
385 slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; in byt_sd_probe_slot()
392 slot->host->mmc_host_ops.get_cd = bxt_get_cd; in byt_sd_probe_slot()
435 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | in intel_mrfl_mmc_probe_slot()
547 static void jmicron_enable_mmc(struct sdhci_host *host, int on) in jmicron_enable_mmc() argument
551 scratch = readb(host->ioaddr + 0xC0); in jmicron_enable_mmc()
558 writeb(scratch, host->ioaddr + 0xC0); in jmicron_enable_mmc()
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()
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()
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()
608 jmicron_enable_mmc(slot->host, 0); in jmicron_remove_slot()
618 jmicron_enable_mmc(chip->slots[i]->host, 0); in jmicron_suspend()
631 jmicron_enable_mmc(chip->slots[i]->host, 1); in jmicron_resume()
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()
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()
715 writeb(0, slot->host->ioaddr + SYSKT_POWER_CMD); in syskt_probe_slot()
742 slot->host->mmc->caps2 |= MMC_CAP2_HS200; in rtsx_probe_slot()
1323 static int sdhci_pci_enable_dma(struct sdhci_host *host) in sdhci_pci_enable_dma() argument
1329 slot = sdhci_priv(host); in sdhci_pci_enable_dma()
1334 (host->flags & SDHCI_USE_SDMA)) { in sdhci_pci_enable_dma()
1339 if (host->flags & SDHCI_USE_64_BIT_DMA) { in sdhci_pci_enable_dma()
1340 if (host->quirks2 & SDHCI_QUIRK2_BROKEN_64_BIT_DMA) { in sdhci_pci_enable_dma()
1341 host->flags &= ~SDHCI_USE_64_BIT_DMA; in sdhci_pci_enable_dma()
1358 static void sdhci_pci_set_bus_width(struct sdhci_host *host, int width) in sdhci_pci_set_bus_width() argument
1362 ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); in sdhci_pci_set_bus_width()
1378 sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); in sdhci_pci_set_bus_width()
1381 static void sdhci_pci_gpio_hw_reset(struct sdhci_host *host) in sdhci_pci_gpio_hw_reset() argument
1383 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_pci_gpio_hw_reset()
1396 static void sdhci_pci_hw_reset(struct sdhci_host *host) in sdhci_pci_hw_reset() argument
1398 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_pci_hw_reset()
1401 slot->hw_reset(host); in sdhci_pci_hw_reset()
1404 static int sdhci_pci_select_drive_strength(struct sdhci_host *host, in sdhci_pci_select_drive_strength() argument
1409 struct sdhci_pci_slot *slot = sdhci_priv(host); in sdhci_pci_select_drive_strength()
1414 return slot->select_drive_strength(host, card, max_dtr, host_drv, in sdhci_pci_select_drive_strength()
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()
1484 sdhci_resume_host(chip->slots[i]->host); in sdhci_pci_suspend()
1510 ret = sdhci_resume_host(slot->host); in sdhci_pci_resume()
1534 ret = sdhci_runtime_suspend_host(slot->host); in sdhci_pci_runtime_suspend()
1550 sdhci_runtime_resume_host(chip->slots[i]->host); in sdhci_pci_runtime_suspend()
1576 ret = sdhci_runtime_resume_host(slot->host); in sdhci_pci_runtime_resume()
1609 struct sdhci_host *host; in sdhci_pci_probe_slot() local
1632 host = sdhci_alloc_host(&pdev->dev, sizeof(struct sdhci_pci_slot)); in sdhci_pci_probe_slot()
1633 if (IS_ERR(host)) { in sdhci_pci_probe_slot()
1635 return ERR_CAST(host); in sdhci_pci_probe_slot()
1638 slot = sdhci_priv(host); in sdhci_pci_probe_slot()
1641 slot->host = host; in sdhci_pci_probe_slot()
1663 host->hw_name = "PCI"; in sdhci_pci_probe_slot()
1664 host->ops = &sdhci_pci_ops; in sdhci_pci_probe_slot()
1665 host->quirks = chip->quirks; in sdhci_pci_probe_slot()
1666 host->quirks2 = chip->quirks2; in sdhci_pci_probe_slot()
1668 host->irq = pdev->irq; in sdhci_pci_probe_slot()
1670 ret = pci_request_region(pdev, bar, mmc_hostname(host->mmc)); in sdhci_pci_probe_slot()
1676 host->ioaddr = pci_ioremap_bar(pdev, bar); in sdhci_pci_probe_slot()
1677 if (!host->ioaddr) { in sdhci_pci_probe_slot()
1692 slot->host->mmc->caps |= MMC_CAP_HW_RESET; in sdhci_pci_probe_slot()
1700 host->mmc->pm_caps = MMC_PM_KEEP_POWER | MMC_PM_WAKE_SDIO_IRQ; in sdhci_pci_probe_slot()
1701 host->mmc->slotno = slotno; in sdhci_pci_probe_slot()
1702 host->mmc->caps2 |= MMC_CAP2_NO_PRESCAN_POWERUP; in sdhci_pci_probe_slot()
1705 mmc_gpiod_request_cd(host->mmc, slot->cd_con_id, slot->cd_idx, in sdhci_pci_probe_slot()
1711 ret = sdhci_add_host(host); in sdhci_pci_probe_slot()
1736 iounmap(host->ioaddr); in sdhci_pci_probe_slot()
1746 sdhci_free_host(host); in sdhci_pci_probe_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()
1776 sdhci_free_host(slot->host); in sdhci_pci_remove_slot()