• Home
  • Raw
  • Download

Lines Matching +full:cd +full:- +full:inverted

2  * sdhci-pltfm.c Support for SDHCI platform devices
28 * Inspired by sdhci-pci.c, by Pierre Ossman
37 #include "sdhci-pltfm.h"
43 return clk_get_rate(pltfm_host->clk); in sdhci_pltfm_clk_get_max_clock()
57 if (of_get_property(np, "sdhci,wp-inverted", NULL) || in sdhci_of_wp_inverted()
58 of_get_property(np, "wp-inverted", NULL)) in sdhci_of_wp_inverted()
61 /* Old device trees don't have the wp-inverted property. */ in sdhci_of_wp_inverted()
71 struct device_node *np = pdev->dev.of_node; in sdhci_get_of_property()
76 if (of_get_property(np, "sdhci,auto-cmd12", NULL)) in sdhci_get_of_property()
77 host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12; in sdhci_get_of_property()
79 if (of_get_property(np, "sdhci,1-bit-only", NULL) || in sdhci_get_of_property()
80 (of_property_read_u32(np, "bus-width", &bus_width) == 0 && in sdhci_get_of_property()
82 host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA; in sdhci_get_of_property()
85 host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT; in sdhci_get_of_property()
87 if (of_get_property(np, "broken-cd", NULL)) in sdhci_get_of_property()
88 host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION; in sdhci_get_of_property()
90 if (of_get_property(np, "no-1-8-v", NULL)) in sdhci_get_of_property()
91 host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; in sdhci_get_of_property()
93 if (of_device_is_compatible(np, "fsl,p2020-rev1-esdhc")) in sdhci_get_of_property()
94 host->quirks |= SDHCI_QUIRK_BROKEN_DMA; in sdhci_get_of_property()
96 if (of_device_is_compatible(np, "fsl,p2020-esdhc") || in sdhci_get_of_property()
97 of_device_is_compatible(np, "fsl,p1010-esdhc") || in sdhci_get_of_property()
98 of_device_is_compatible(np, "fsl,t4240-esdhc") || in sdhci_get_of_property()
99 of_device_is_compatible(np, "fsl,mpc8536-esdhc")) in sdhci_get_of_property()
100 host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; in sdhci_get_of_property()
102 of_property_read_u32(np, "clock-frequency", &pltfm_host->clock); in sdhci_get_of_property()
104 if (of_find_property(np, "keep-power-in-suspend", NULL)) in sdhci_get_of_property()
105 host->mmc->pm_caps |= MMC_PM_KEEP_POWER; in sdhci_get_of_property()
107 if (of_property_read_bool(np, "wakeup-source") || in sdhci_get_of_property()
108 of_property_read_bool(np, "enable-sdio-wakeup")) /* legacy */ in sdhci_get_of_property()
109 host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ; in sdhci_get_of_property()
126 ioaddr = devm_ioremap_resource(&pdev->dev, iomem); in sdhci_pltfm_init()
134 dev_err(&pdev->dev, "failed to get IRQ number\n"); in sdhci_pltfm_init()
139 host = sdhci_alloc_host(&pdev->dev, in sdhci_pltfm_init()
147 host->ioaddr = ioaddr; in sdhci_pltfm_init()
148 host->irq = irq; in sdhci_pltfm_init()
149 host->hw_name = dev_name(&pdev->dev); in sdhci_pltfm_init()
150 if (pdata && pdata->ops) in sdhci_pltfm_init()
151 host->ops = pdata->ops; in sdhci_pltfm_init()
153 host->ops = &sdhci_pltfm_ops; in sdhci_pltfm_init()
155 host->quirks = pdata->quirks; in sdhci_pltfm_init()
156 host->quirks2 = pdata->quirks2; in sdhci_pltfm_init()
163 dev_err(&pdev->dev, "%s failed %d\n", __func__, ret); in sdhci_pltfm_init()
201 int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff); in sdhci_pltfm_unregister()
204 clk_disable_unprepare(pltfm_host->clk); in sdhci_pltfm_unregister()
218 if (host->tuning_mode != SDHCI_TUNING_MODE_3) in sdhci_pltfm_suspend()
219 mmc_retune_needed(host->mmc); in sdhci_pltfm_suspend()
225 clk_disable_unprepare(pltfm_host->clk); in sdhci_pltfm_suspend()
237 ret = clk_prepare_enable(pltfm_host->clk); in sdhci_pltfm_resume()
243 clk_disable_unprepare(pltfm_host->clk); in sdhci_pltfm_resume()
257 pr_info("sdhci-pltfm: SDHCI platform and OF driver helper\n"); in sdhci_pltfm_drv_init()