Lines Matching +full:wp +full:- +full:inverted

1 // SPDX-License-Identifier: GPL-2.0-only
3 * sdhci-pltfm.c Support for SDHCI platform devices
16 * Inspired by sdhci-pci.c, by Pierre Ossman
25 #include "sdhci-pltfm.h"
31 return clk_get_rate(pltfm_host->clk); in sdhci_pltfm_clk_get_max_clock()
44 if (device_property_present(dev, "sdhci,wp-inverted") || in sdhci_wp_inverted()
45 device_property_present(dev, "wp-inverted")) in sdhci_wp_inverted()
48 /* Old device trees don't have the wp-inverted property. */ in sdhci_wp_inverted()
58 struct device *dev = &pdev->dev; in sdhci_get_compatibility()
61 if (device_is_compatible(dev, "fsl,p2020-rev1-esdhc")) in sdhci_get_compatibility()
62 host->quirks |= SDHCI_QUIRK_BROKEN_DMA; in sdhci_get_compatibility()
64 if (device_is_compatible(dev, "fsl,p2020-esdhc") || in sdhci_get_compatibility()
65 device_is_compatible(dev, "fsl,p1010-esdhc") || in sdhci_get_compatibility()
66 device_is_compatible(dev, "fsl,t4240-esdhc") || in sdhci_get_compatibility()
67 device_is_compatible(dev, "fsl,mpc8536-esdhc")) in sdhci_get_compatibility()
68 host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; in sdhci_get_compatibility()
73 struct device *dev = &pdev->dev; in sdhci_get_property()
78 if (device_property_present(dev, "sdhci,auto-cmd12")) in sdhci_get_property()
79 host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12; in sdhci_get_property()
81 if (device_property_present(dev, "sdhci,1-bit-only") || in sdhci_get_property()
82 (device_property_read_u32(dev, "bus-width", &bus_width) == 0 && in sdhci_get_property()
84 host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA; in sdhci_get_property()
87 host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT; in sdhci_get_property()
89 if (device_property_present(dev, "broken-cd")) in sdhci_get_property()
90 host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION; in sdhci_get_property()
92 if (device_property_present(dev, "no-1-8-v")) in sdhci_get_property()
93 host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; in sdhci_get_property()
97 device_property_read_u32(dev, "clock-frequency", &pltfm_host->clock); in sdhci_get_property()
99 if (device_property_present(dev, "keep-power-in-suspend")) in sdhci_get_property()
100 host->mmc->pm_caps |= MMC_PM_KEEP_POWER; in sdhci_get_property()
102 if (device_property_read_bool(dev, "wakeup-source") || in sdhci_get_property()
103 device_property_read_bool(dev, "enable-sdio-wakeup")) /* legacy */ in sdhci_get_property()
104 host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ; in sdhci_get_property()
124 host = sdhci_alloc_host(&pdev->dev, in sdhci_pltfm_init()
127 dev_err(&pdev->dev, "%s failed %pe\n", __func__, host); in sdhci_pltfm_init()
131 host->ioaddr = ioaddr; in sdhci_pltfm_init()
132 host->irq = irq; in sdhci_pltfm_init()
133 host->hw_name = dev_name(&pdev->dev); in sdhci_pltfm_init()
134 if (pdata && pdata->ops) in sdhci_pltfm_init()
135 host->ops = pdata->ops; in sdhci_pltfm_init()
137 host->ops = &sdhci_pltfm_ops; in sdhci_pltfm_init()
139 host->quirks = pdata->quirks; in sdhci_pltfm_init()
140 host->quirks2 = pdata->quirks2; in sdhci_pltfm_init()
181 int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff); in sdhci_pltfm_remove()
195 if (host->tuning_mode != SDHCI_TUNING_MODE_3) in sdhci_pltfm_suspend()
196 mmc_retune_needed(host->mmc); in sdhci_pltfm_suspend()
202 clk_disable_unprepare(pltfm_host->clk); in sdhci_pltfm_suspend()
214 ret = clk_prepare_enable(pltfm_host->clk); in sdhci_pltfm_resume()
220 clk_disable_unprepare(pltfm_host->clk); in sdhci_pltfm_resume()
234 pr_info("sdhci-pltfm: SDHCI platform and OF driver helper\n"); in sdhci_pltfm_drv_init()