Lines Matching +full:program +full:- +full:gpios

2  * drivers/mmc/host/sdhci-spear.c
9 * Inspired by sdhci-pltfm.c
12 * License version 2. This program is licensed "as is" without any
27 #include <linux/mmc/slot-gpio.h>
50 dev = pdev->dev.parent ? pdev->dev.parent : &pdev->dev; in sdhci_probe()
54 dev_dbg(&pdev->dev, "cannot allocate memory for sdhci\n"); in sdhci_probe()
58 host->ioaddr = devm_platform_ioremap_resource(pdev, 0); in sdhci_probe()
59 if (IS_ERR(host->ioaddr)) { in sdhci_probe()
60 ret = PTR_ERR(host->ioaddr); in sdhci_probe()
61 dev_dbg(&pdev->dev, "unable to map iomem: %d\n", ret); in sdhci_probe()
65 host->hw_name = "sdhci"; in sdhci_probe()
66 host->ops = &sdhci_pltfm_ops; in sdhci_probe()
67 host->irq = platform_get_irq(pdev, 0); in sdhci_probe()
68 if (host->irq < 0) { in sdhci_probe()
69 ret = host->irq; in sdhci_probe()
72 host->quirks = SDHCI_QUIRK_BROKEN_ADMA; in sdhci_probe()
77 sdhci->clk = devm_clk_get(&pdev->dev, NULL); in sdhci_probe()
78 if (IS_ERR(sdhci->clk)) { in sdhci_probe()
79 ret = PTR_ERR(sdhci->clk); in sdhci_probe()
80 dev_dbg(&pdev->dev, "Error getting clock\n"); in sdhci_probe()
84 ret = clk_prepare_enable(sdhci->clk); in sdhci_probe()
86 dev_dbg(&pdev->dev, "Error enabling clock\n"); in sdhci_probe()
90 ret = clk_set_rate(sdhci->clk, 50000000); in sdhci_probe()
92 dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n", in sdhci_probe()
93 clk_get_rate(sdhci->clk)); in sdhci_probe()
96 * It is optional to use GPIOs for sdhci card detection. If we in sdhci_probe()
99 ret = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0); in sdhci_probe()
100 if (ret == -EPROBE_DEFER) in sdhci_probe()
112 clk_disable_unprepare(sdhci->clk); in sdhci_probe()
116 dev_err(&pdev->dev, "spear-sdhci probe failed: %d\n", ret); in sdhci_probe()
127 scratch = readl(host->ioaddr + SDHCI_INT_STATUS); in sdhci_remove()
128 if (scratch == (u32)-1) in sdhci_remove()
132 clk_disable_unprepare(sdhci->clk); in sdhci_remove()
143 if (host->tuning_mode != SDHCI_TUNING_MODE_3) in sdhci_suspend()
144 mmc_retune_needed(host->mmc); in sdhci_suspend()
148 clk_disable(sdhci->clk); in sdhci_suspend()
159 ret = clk_enable(sdhci->clk); in sdhci_resume()
172 { .compatible = "st,spear300-sdhci" },