• Home
  • Raw
  • Download

Lines Matching +full:non +full:- +full:muxed

23 #include <linux/mmc/slot-gpio.h>
30 #include "sdhci-pltfm.h"
52 mc1r = readb(host->ioaddr + SDMMC_MC1R); in sdhci_at91_set_force_card_detect()
54 writeb(mc1r, host->ioaddr + SDMMC_MC1R); in sdhci_at91_set_force_card_detect()
62 host->mmc->actual_clock = 0; in sdhci_at91_set_clock()
67 * internal clock, changing the configuration and re-enabling the in sdhci_at91_set_clock()
79 clk = sdhci_calc_clk(host, clock, &host->mmc->actual_clock); in sdhci_at91_set_clock()
90 mmc_hostname(host->mmc)); in sdhci_at91_set_clock()
93 timeout--; in sdhci_at91_set_clock()
109 if (!IS_ERR(host->mmc->supply.vmmc)) { in sdhci_at91_set_power()
110 struct mmc_host *mmc = host->mmc; in sdhci_at91_set_power()
112 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); in sdhci_at91_set_power()
129 if ((host->mmc->caps & MMC_CAP_NONREMOVABLE) in sdhci_at91_reset()
130 || mmc_gpio_get_cd(host->mmc) >= 0) in sdhci_at91_reset()
147 { .compatible = "atmel,sama5d2-sdhci", .data = &soc_data_sama5d2 },
168 clk_prepare_enable(priv->hclock); in sdhci_at91_set_clks_presets()
169 caps0 = readl(host->ioaddr + SDHCI_CAPABILITIES); in sdhci_at91_set_clks_presets()
170 caps1 = readl(host->ioaddr + SDHCI_CAPABILITIES_1); in sdhci_at91_set_clks_presets()
174 ret = clk_set_rate(priv->gck, gck_rate); in sdhci_at91_set_clks_presets()
177 clk_disable_unprepare(priv->hclock); in sdhci_at91_set_clks_presets()
186 real_gck_rate = clk_get_rate(priv->gck); in sdhci_at91_set_clks_presets()
188 clk_mul = real_gck_rate / (clk_base * 1000000) - 1; in sdhci_at91_set_clks_presets()
194 host->ioaddr + SDMMC_CACR); in sdhci_at91_set_clks_presets()
195 writel(caps1, host->ioaddr + SDHCI_CAPABILITIES_1); in sdhci_at91_set_clks_presets()
197 writel(0, host->ioaddr + SDMMC_CACR); in sdhci_at91_set_clks_presets()
208 preset_div = DIV_ROUND_UP(real_gck_rate, 24000000) - 1; in sdhci_at91_set_clks_presets()
210 host->ioaddr + SDHCI_PRESET_FOR_SDR12); in sdhci_at91_set_clks_presets()
211 preset_div = DIV_ROUND_UP(real_gck_rate, 50000000) - 1; in sdhci_at91_set_clks_presets()
213 host->ioaddr + SDHCI_PRESET_FOR_SDR25); in sdhci_at91_set_clks_presets()
214 preset_div = DIV_ROUND_UP(real_gck_rate, 100000000) - 1; in sdhci_at91_set_clks_presets()
216 host->ioaddr + SDHCI_PRESET_FOR_SDR50); in sdhci_at91_set_clks_presets()
217 preset_div = DIV_ROUND_UP(real_gck_rate, 120000000) - 1; in sdhci_at91_set_clks_presets()
219 host->ioaddr + SDHCI_PRESET_FOR_SDR104); in sdhci_at91_set_clks_presets()
220 preset_div = DIV_ROUND_UP(real_gck_rate, 50000000) - 1; in sdhci_at91_set_clks_presets()
222 host->ioaddr + SDHCI_PRESET_FOR_DDR50); in sdhci_at91_set_clks_presets()
224 clk_prepare_enable(priv->mainck); in sdhci_at91_set_clks_presets()
225 clk_prepare_enable(priv->gck); in sdhci_at91_set_clks_presets()
240 priv->restore_needed = true; in sdhci_at91_suspend()
256 if (host->tuning_mode != SDHCI_TUNING_MODE_3) in sdhci_at91_runtime_suspend()
257 mmc_retune_needed(host->mmc); in sdhci_at91_runtime_suspend()
259 clk_disable_unprepare(priv->gck); in sdhci_at91_runtime_suspend()
260 clk_disable_unprepare(priv->hclock); in sdhci_at91_runtime_suspend()
261 clk_disable_unprepare(priv->mainck); in sdhci_at91_runtime_suspend()
273 if (priv->restore_needed) { in sdhci_at91_runtime_resume()
278 priv->restore_needed = false; in sdhci_at91_runtime_resume()
282 ret = clk_prepare_enable(priv->mainck); in sdhci_at91_runtime_resume()
288 ret = clk_prepare_enable(priv->hclock); in sdhci_at91_runtime_resume()
294 ret = clk_prepare_enable(priv->gck); in sdhci_at91_runtime_resume()
321 match = of_match_device(sdhci_at91_dt_match, &pdev->dev); in sdhci_at91_probe()
323 return -EINVAL; in sdhci_at91_probe()
324 soc_data = match->data; in sdhci_at91_probe()
333 priv->mainck = devm_clk_get(&pdev->dev, "baseclk"); in sdhci_at91_probe()
334 if (IS_ERR(priv->mainck)) { in sdhci_at91_probe()
335 dev_err(&pdev->dev, "failed to get baseclk\n"); in sdhci_at91_probe()
336 ret = PTR_ERR(priv->mainck); in sdhci_at91_probe()
340 priv->hclock = devm_clk_get(&pdev->dev, "hclock"); in sdhci_at91_probe()
341 if (IS_ERR(priv->hclock)) { in sdhci_at91_probe()
342 dev_err(&pdev->dev, "failed to get hclock\n"); in sdhci_at91_probe()
343 ret = PTR_ERR(priv->hclock); in sdhci_at91_probe()
347 priv->gck = devm_clk_get(&pdev->dev, "multclk"); in sdhci_at91_probe()
348 if (IS_ERR(priv->gck)) { in sdhci_at91_probe()
349 dev_err(&pdev->dev, "failed to get multclk\n"); in sdhci_at91_probe()
350 ret = PTR_ERR(priv->gck); in sdhci_at91_probe()
354 ret = sdhci_at91_set_clks_presets(&pdev->dev); in sdhci_at91_probe()
358 priv->restore_needed = false; in sdhci_at91_probe()
360 ret = mmc_of_parse(host->mmc); in sdhci_at91_probe()
366 pm_runtime_get_noresume(&pdev->dev); in sdhci_at91_probe()
367 pm_runtime_set_active(&pdev->dev); in sdhci_at91_probe()
368 pm_runtime_enable(&pdev->dev); in sdhci_at91_probe()
369 pm_runtime_set_autosuspend_delay(&pdev->dev, 50); in sdhci_at91_probe()
370 pm_runtime_use_autosuspend(&pdev->dev); in sdhci_at91_probe()
373 host->quirks2 |= SDHCI_QUIRK2_BROKEN_HS200; in sdhci_at91_probe()
383 * For that reason, it is not planned to wake-up on a card detect irq in sdhci_at91_probe()
385 * If we want to use runtime PM and to be able to wake-up on card in sdhci_at91_probe()
390 * to enable polling via device tree with broken-cd property. in sdhci_at91_probe()
392 if (mmc_card_is_removable(host->mmc) && in sdhci_at91_probe()
393 mmc_gpio_get_cd(host->mmc) < 0) { in sdhci_at91_probe()
394 host->mmc->caps |= MMC_CAP_NEEDS_POLL; in sdhci_at91_probe()
395 host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; in sdhci_at91_probe()
402 * detect pin is not muxed to SDHCI controller, a default value is in sdhci_at91_probe()
405 * avoid this case, if the device is non removable then the card in sdhci_at91_probe()
412 if ((host->mmc->caps & MMC_CAP_NONREMOVABLE) in sdhci_at91_probe()
413 || mmc_gpio_get_cd(host->mmc) >= 0) in sdhci_at91_probe()
416 pm_runtime_put_autosuspend(&pdev->dev); in sdhci_at91_probe()
421 pm_runtime_disable(&pdev->dev); in sdhci_at91_probe()
422 pm_runtime_set_suspended(&pdev->dev); in sdhci_at91_probe()
423 pm_runtime_put_noidle(&pdev->dev); in sdhci_at91_probe()
425 clk_disable_unprepare(priv->gck); in sdhci_at91_probe()
426 clk_disable_unprepare(priv->mainck); in sdhci_at91_probe()
427 clk_disable_unprepare(priv->hclock); in sdhci_at91_probe()
438 struct clk *gck = priv->gck; in sdhci_at91_remove()
439 struct clk *hclock = priv->hclock; in sdhci_at91_remove()
440 struct clk *mainck = priv->mainck; in sdhci_at91_remove()
442 pm_runtime_get_sync(&pdev->dev); in sdhci_at91_remove()
443 pm_runtime_disable(&pdev->dev); in sdhci_at91_remove()
444 pm_runtime_put_noidle(&pdev->dev); in sdhci_at91_remove()
457 .name = "sdhci-at91",