Lines Matching refs:imx_data
308 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_readl_le() local
323 if (imx_data->socdata->flags & ESDHC_FLAG_HAVE_CAP1) in esdhc_readl_le()
340 if (esdhc_is_usdhc(imx_data)) { in esdhc_readl_le()
341 if (imx_data->socdata->flags & ESDHC_FLAG_HAVE_CAP1) in esdhc_readl_le()
350 if (imx_data->socdata->flags & ESDHC_FLAG_HS400) in esdhc_readl_le()
357 if (IS_ERR_OR_NULL(imx_data->pins_100mhz) || in esdhc_readl_le()
358 IS_ERR_OR_NULL(imx_data->pins_200mhz)) in esdhc_readl_le()
364 if (unlikely(reg == SDHCI_MAX_CURRENT) && esdhc_is_usdhc(imx_data)) { in esdhc_readl_le()
381 if ((imx_data->multiblock_status == WAIT_FOR_INT) && in esdhc_readl_le()
386 imx_data->multiblock_status = NO_CMD_PENDING; in esdhc_readl_le()
396 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_writel_le() local
401 if ((val & SDHCI_INT_CARD_INT) && !esdhc_is_usdhc(imx_data)) { in esdhc_writel_le()
423 if (unlikely((imx_data->socdata->flags & ESDHC_FLAG_MULTIBLK_NO_INT) in esdhc_writel_le()
431 if (imx_data->multiblock_status == MULTIBLK_IN_PROCESS) in esdhc_writel_le()
437 imx_data->multiblock_status = WAIT_FOR_INT; in esdhc_writel_le()
447 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_readw_le() local
453 if (esdhc_is_usdhc(imx_data)) { in esdhc_readw_le()
467 if (esdhc_is_usdhc(imx_data)) { in esdhc_readw_le()
468 if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) in esdhc_readw_le()
470 else if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) in esdhc_readw_le()
486 if (esdhc_is_usdhc(imx_data)) { in esdhc_readw_le()
507 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_writew_le() local
526 if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) { in esdhc_writew_le()
536 } else if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) { in esdhc_writew_le()
560 if ((imx_data->socdata->flags & ESDHC_FLAG_MULTIBLK_NO_INT) in esdhc_writew_le()
570 if (esdhc_is_usdhc(imx_data)) { in esdhc_writew_le()
600 imx_data->scratchpad = val; in esdhc_writew_le()
608 (imx_data->socdata->flags & ESDHC_FLAG_MULTIBLK_NO_INT)) in esdhc_writew_le()
609 imx_data->multiblock_status = MULTIBLK_IN_PROCESS; in esdhc_writew_le()
611 if (esdhc_is_usdhc(imx_data)) in esdhc_writew_le()
615 writel(val << 16 | imx_data->scratchpad, in esdhc_writew_le()
647 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_writeb_le() local
664 if (!is_imx25_esdhc(imx_data)) { in esdhc_writeb_le()
702 if (esdhc_is_usdhc(imx_data)) { in esdhc_writeb_le()
709 imx_data->is_ddr = 0; in esdhc_writeb_le()
741 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_pltfm_set_clock() local
743 int ddr_pre_div = imx_data->is_ddr ? 2 : 1; in esdhc_pltfm_set_clock()
748 if (esdhc_is_usdhc(imx_data)) { in esdhc_pltfm_set_clock()
760 if (is_imx53_esdhc(imx_data)) { in esdhc_pltfm_set_clock()
778 if (imx_data->socdata->flags & ESDHC_FLAG_ERR010450) { in esdhc_pltfm_set_clock()
781 max_clock = imx_data->is_ddr ? 45000000 : 150000000; in esdhc_pltfm_set_clock()
806 if (esdhc_is_usdhc(imx_data)) { in esdhc_pltfm_set_clock()
818 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_pltfm_get_ro() local
819 struct esdhc_platform_data *boarddata = &imx_data->boarddata; in esdhc_pltfm_get_ro()
948 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_change_pinstate() local
953 if (IS_ERR(imx_data->pinctrl) || in esdhc_change_pinstate()
954 IS_ERR(imx_data->pins_default) || in esdhc_change_pinstate()
955 IS_ERR(imx_data->pins_100mhz) || in esdhc_change_pinstate()
956 IS_ERR(imx_data->pins_200mhz)) in esdhc_change_pinstate()
962 pinctrl = imx_data->pins_100mhz; in esdhc_change_pinstate()
967 pinctrl = imx_data->pins_200mhz; in esdhc_change_pinstate()
971 pinctrl = imx_data->pins_default; in esdhc_change_pinstate()
974 return pinctrl_select_state(imx_data->pinctrl, pinctrl); in esdhc_change_pinstate()
1023 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_reset_tuning() local
1027 if (esdhc_is_usdhc(imx_data)) { in esdhc_reset_tuning()
1028 if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) { in esdhc_reset_tuning()
1034 } else if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) { in esdhc_reset_tuning()
1046 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_set_uhs_signaling() local
1047 struct esdhc_platform_data *boarddata = &imx_data->boarddata; in esdhc_set_uhs_signaling()
1052 imx_data->is_ddr = 0; in esdhc_set_uhs_signaling()
1067 imx_data->is_ddr = 1; in esdhc_set_uhs_signaling()
1073 if (is_imx53_esdhc(imx_data)) in esdhc_set_uhs_signaling()
1081 imx_data->is_ddr = 1; in esdhc_set_uhs_signaling()
1106 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_get_max_timeout_count() local
1109 return esdhc_is_usdhc(imx_data) ? 1 << 29 : 1 << 27; in esdhc_get_max_timeout_count()
1115 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in esdhc_set_timeout() local
1119 esdhc_is_usdhc(imx_data) ? 0xF : 0xE, in esdhc_set_timeout()
1166 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in sdhci_esdhc_imx_hwinit() local
1169 if (esdhc_is_usdhc(imx_data)) { in sdhci_esdhc_imx_hwinit()
1210 if (imx_data->socdata->flags & ESDHC_FLAG_CQHCI) { in sdhci_esdhc_imx_hwinit()
1218 if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) { in sdhci_esdhc_imx_hwinit()
1222 if (imx_data->boarddata.tuning_start_tap) { in sdhci_esdhc_imx_hwinit()
1224 tmp |= imx_data->boarddata.tuning_start_tap; in sdhci_esdhc_imx_hwinit()
1227 if (imx_data->boarddata.tuning_step) { in sdhci_esdhc_imx_hwinit()
1229 tmp |= imx_data->boarddata.tuning_step in sdhci_esdhc_imx_hwinit()
1233 } else if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) { in sdhci_esdhc_imx_hwinit()
1312 struct pltfm_imx_data *imx_data) in sdhci_esdhc_imx_probe_dt() argument
1315 struct esdhc_platform_data *boarddata = &imx_data->boarddata; in sdhci_esdhc_imx_probe_dt()
1341 if (esdhc_is_usdhc(imx_data) && !IS_ERR(imx_data->pins_default)) { in sdhci_esdhc_imx_probe_dt()
1342 imx_data->pins_100mhz = pinctrl_lookup_state(imx_data->pinctrl, in sdhci_esdhc_imx_probe_dt()
1344 imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl, in sdhci_esdhc_imx_probe_dt()
1362 struct pltfm_imx_data *imx_data) in sdhci_esdhc_imx_probe_dt() argument
1370 struct pltfm_imx_data *imx_data) in sdhci_esdhc_imx_probe_nondt() argument
1372 struct esdhc_platform_data *boarddata = &imx_data->boarddata; in sdhci_esdhc_imx_probe_nondt()
1380 imx_data->boarddata = *((struct esdhc_platform_data *) in sdhci_esdhc_imx_probe_nondt()
1441 struct pltfm_imx_data *imx_data; in sdhci_esdhc_imx_probe() local
1444 sizeof(*imx_data)); in sdhci_esdhc_imx_probe()
1450 imx_data = sdhci_pltfm_priv(pltfm_host); in sdhci_esdhc_imx_probe()
1452 imx_data->socdata = of_id ? of_id->data : (struct esdhc_soc_data *) in sdhci_esdhc_imx_probe()
1455 if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS) in sdhci_esdhc_imx_probe()
1456 pm_qos_add_request(&imx_data->pm_qos_req, in sdhci_esdhc_imx_probe()
1459 imx_data->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); in sdhci_esdhc_imx_probe()
1460 if (IS_ERR(imx_data->clk_ipg)) { in sdhci_esdhc_imx_probe()
1461 err = PTR_ERR(imx_data->clk_ipg); in sdhci_esdhc_imx_probe()
1465 imx_data->clk_ahb = devm_clk_get(&pdev->dev, "ahb"); in sdhci_esdhc_imx_probe()
1466 if (IS_ERR(imx_data->clk_ahb)) { in sdhci_esdhc_imx_probe()
1467 err = PTR_ERR(imx_data->clk_ahb); in sdhci_esdhc_imx_probe()
1471 imx_data->clk_per = devm_clk_get(&pdev->dev, "per"); in sdhci_esdhc_imx_probe()
1472 if (IS_ERR(imx_data->clk_per)) { in sdhci_esdhc_imx_probe()
1473 err = PTR_ERR(imx_data->clk_per); in sdhci_esdhc_imx_probe()
1477 pltfm_host->clk = imx_data->clk_per; in sdhci_esdhc_imx_probe()
1479 err = clk_prepare_enable(imx_data->clk_per); in sdhci_esdhc_imx_probe()
1482 err = clk_prepare_enable(imx_data->clk_ipg); in sdhci_esdhc_imx_probe()
1485 err = clk_prepare_enable(imx_data->clk_ahb); in sdhci_esdhc_imx_probe()
1489 imx_data->pinctrl = devm_pinctrl_get(&pdev->dev); in sdhci_esdhc_imx_probe()
1490 if (IS_ERR(imx_data->pinctrl)) { in sdhci_esdhc_imx_probe()
1491 err = PTR_ERR(imx_data->pinctrl); in sdhci_esdhc_imx_probe()
1495 imx_data->pins_default = pinctrl_lookup_state(imx_data->pinctrl, in sdhci_esdhc_imx_probe()
1497 if (IS_ERR(imx_data->pins_default)) in sdhci_esdhc_imx_probe()
1500 if (esdhc_is_usdhc(imx_data)) { in sdhci_esdhc_imx_probe()
1503 if (!(imx_data->socdata->flags & ESDHC_FLAG_HS200)) in sdhci_esdhc_imx_probe()
1518 if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) in sdhci_esdhc_imx_probe()
1522 if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536) in sdhci_esdhc_imx_probe()
1525 if (imx_data->socdata->flags & ESDHC_FLAG_HS400) in sdhci_esdhc_imx_probe()
1528 if (imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) { in sdhci_esdhc_imx_probe()
1534 if (imx_data->socdata->flags & ESDHC_FLAG_CQHCI) { in sdhci_esdhc_imx_probe()
1551 err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data); in sdhci_esdhc_imx_probe()
1553 err = sdhci_esdhc_imx_probe_nondt(pdev, host, imx_data); in sdhci_esdhc_imx_probe()
1574 clk_disable_unprepare(imx_data->clk_ahb); in sdhci_esdhc_imx_probe()
1576 clk_disable_unprepare(imx_data->clk_ipg); in sdhci_esdhc_imx_probe()
1578 clk_disable_unprepare(imx_data->clk_per); in sdhci_esdhc_imx_probe()
1580 if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS) in sdhci_esdhc_imx_probe()
1581 pm_qos_remove_request(&imx_data->pm_qos_req); in sdhci_esdhc_imx_probe()
1590 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in sdhci_esdhc_imx_remove() local
1599 clk_disable_unprepare(imx_data->clk_per); in sdhci_esdhc_imx_remove()
1600 clk_disable_unprepare(imx_data->clk_ipg); in sdhci_esdhc_imx_remove()
1601 clk_disable_unprepare(imx_data->clk_ahb); in sdhci_esdhc_imx_remove()
1603 if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS) in sdhci_esdhc_imx_remove()
1604 pm_qos_remove_request(&imx_data->pm_qos_req); in sdhci_esdhc_imx_remove()
1653 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in sdhci_esdhc_runtime_suspend() local
1669 imx_data->actual_clock = host->mmc->actual_clock; in sdhci_esdhc_runtime_suspend()
1671 clk_disable_unprepare(imx_data->clk_per); in sdhci_esdhc_runtime_suspend()
1672 clk_disable_unprepare(imx_data->clk_ipg); in sdhci_esdhc_runtime_suspend()
1673 clk_disable_unprepare(imx_data->clk_ahb); in sdhci_esdhc_runtime_suspend()
1675 if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS) in sdhci_esdhc_runtime_suspend()
1676 pm_qos_remove_request(&imx_data->pm_qos_req); in sdhci_esdhc_runtime_suspend()
1685 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); in sdhci_esdhc_runtime_resume() local
1688 if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS) in sdhci_esdhc_runtime_resume()
1689 pm_qos_add_request(&imx_data->pm_qos_req, in sdhci_esdhc_runtime_resume()
1692 err = clk_prepare_enable(imx_data->clk_ahb); in sdhci_esdhc_runtime_resume()
1696 err = clk_prepare_enable(imx_data->clk_per); in sdhci_esdhc_runtime_resume()
1700 err = clk_prepare_enable(imx_data->clk_ipg); in sdhci_esdhc_runtime_resume()
1704 esdhc_pltfm_set_clock(host, imx_data->actual_clock); in sdhci_esdhc_runtime_resume()
1716 clk_disable_unprepare(imx_data->clk_ipg); in sdhci_esdhc_runtime_resume()
1718 clk_disable_unprepare(imx_data->clk_per); in sdhci_esdhc_runtime_resume()
1720 clk_disable_unprepare(imx_data->clk_ahb); in sdhci_esdhc_runtime_resume()
1722 if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS) in sdhci_esdhc_runtime_resume()
1723 pm_qos_remove_request(&imx_data->pm_qos_req); in sdhci_esdhc_runtime_resume()