Lines Matching refs:host

97 	struct ufs_mtk_host *host = ufshcd_get_variant(hba);
99 return !!(host->caps & UFS_MTK_CAP_BOOST_CRYPT_ENGINE);
104 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
106 return !!(host->caps & UFS_MTK_CAP_VA09_PWR_CTRL);
111 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
113 return !!(host->caps & UFS_MTK_CAP_BROKEN_VCC);
118 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
120 return !!(host->caps & UFS_MTK_CAP_PMC_VIA_FASTAUTO);
125 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
127 return (host->caps & UFS_MTK_CAP_TX_SKEW_FIX);
132 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
134 return (host->caps & UFS_MTK_CAP_RTFF_MTCMOS);
139 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
141 return (host->caps & UFS_MTK_CAP_ALLOW_VCCQX_LPM);
194 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
197 reset_control_assert(host->hci_reset);
198 reset_control_assert(host->crypto_reset);
199 reset_control_assert(host->unipro_reset);
200 reset_control_assert(host->mphy_reset);
204 reset_control_deassert(host->unipro_reset);
205 reset_control_deassert(host->crypto_reset);
206 reset_control_deassert(host->hci_reset);
207 reset_control_deassert(host->mphy_reset);
210 if (host->mphy_reset)
228 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
230 ufs_mtk_init_reset_control(hba, &host->hci_reset,
232 ufs_mtk_init_reset_control(hba, &host->unipro_reset,
234 ufs_mtk_init_reset_control(hba, &host->crypto_reset,
236 ufs_mtk_init_reset_control(hba, &host->mphy_reset,
243 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
246 if (host->unipro_lpm) {
256 if (host->caps & UFS_MTK_CAP_DISABLE_AH8) {
265 * to prevent host hang issue
277 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
282 host->mphy = devm_of_phy_get_by_index(dev, np, 0);
284 if (host->mphy == ERR_PTR(-EPROBE_DEFER)) {
293 } else if (IS_ERR(host->mphy)) {
294 err = PTR_ERR(host->mphy);
302 host->mphy = NULL;
315 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
320 if (host->ref_clk_enabled == on)
328 ufshcd_delay_us(host->ref_clk_gating_wait_us, 10);
347 ufs_mtk_ref_clk_notify(host->ref_clk_enabled, POST_CHANGE, res);
352 host->ref_clk_enabled = on;
354 ufshcd_delay_us(host->ref_clk_ungating_wait_us, 10);
364 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
367 host->ref_clk_gating_wait_us =
370 host->ref_clk_gating_wait_us = gating_us;
373 host->ref_clk_ungating_wait_us = REFCLK_DEFAULT_WAIT_US;
378 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
380 if (((host->ip_ver >> 16) & 0xFF) >= 0x36) {
456 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
457 struct phy *mphy = host->mphy;
461 if (!mphy || !(on ^ host->mphy_powered_on))
466 ret = regulator_enable(host->reg_va09);
478 ret = regulator_disable(host->reg_va09);
488 host->mphy_powered_on = on;
511 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
519 cfg = host->crypt;
581 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
587 host->crypt = devm_kzalloc(dev, sizeof(*(host->crypt)),
589 if (!host->crypt)
605 cfg = host->crypt;
620 host->caps |= UFS_MTK_CAP_BOOST_CRYPT_ENGINE;
628 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
630 host->reg_va09 = regulator_get(hba->dev, "va09");
631 if (IS_ERR(host->reg_va09))
634 host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL;
639 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
649 host->caps |= UFS_MTK_CAP_DISABLE_AH8;
652 host->caps |= UFS_MTK_CAP_BROKEN_VCC;
655 host->caps |= UFS_MTK_CAP_PMC_VIA_FASTAUTO;
658 host->caps |= UFS_MTK_CAP_TX_SKEW_FIX;
661 host->caps |= UFS_MTK_CAP_DISABLE_MCQ;
664 host->caps |= UFS_MTK_CAP_RTFF_MTCMOS;
666 dev_info(hba->dev, "caps: 0x%x", host->caps);
676 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
679 phy_power_on(host->mphy);
687 phy_power_off(host->mphy);
693 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
699 if (host->mcq_nr_intr == 0)
702 for (i = 0; i < host->mcq_nr_intr; i++) {
703 irq = host->mcq_intr_info[i].irq;
706 host->is_mcq_intr_enabled = false;
711 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
717 if (host->mcq_nr_intr == 0)
720 if (host->is_mcq_intr_enabled == true)
723 for (i = 0; i < host->mcq_nr_intr; i++) {
724 irq = host->mcq_intr_info[i].irq;
727 host->is_mcq_intr_enabled = true;
732 * @hba: host controller instance
741 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
750 if (!host)
784 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
787 if (host->hw_ver.major)
791 host->hw_ver.major = 2;
796 host->hw_ver.major = 3;
819 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
821 struct ufs_mtk_clk *mclk = &host->mclk;
831 host->mclk.ufs_sel_clki = clki;
833 host->mclk.ufs_sel_max_clki = clki;
837 host->mclk.ufs_sel_min_clki = clki;
921 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
926 host->mcq_nr_intr = UFSHCD_MAX_Q_NR;
929 if (host->caps & UFS_MTK_CAP_DISABLE_MCQ)
932 for (i = 0; i < host->mcq_nr_intr; i++) {
936 host->mcq_intr_info[i].irq = MTK_MCQ_INVALID_IRQ;
939 host->mcq_intr_info[i].hba = hba;
940 host->mcq_intr_info[i].irq = irq;
947 for (i = 0; i < host->mcq_nr_intr; i++)
948 host->mcq_intr_info[i].irq = MTK_MCQ_INVALID_IRQ;
950 host->mcq_nr_intr = 0;
955 * @hba: host controller instance
967 struct ufs_mtk_host *host;
968 struct Scsi_Host *shost = hba->host;
972 host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL);
973 if (!host) {
975 dev_info(dev, "%s: no memory for mtk ufs host\n", __func__);
979 host->hba = hba;
980 ufshcd_set_variant(hba, host);
988 /* Initialize host capability */
1000 if (host->mphy_reset)
1026 if (host->caps & UFS_MTK_CAP_DISABLE_AH8)
1050 host->ip_ver = ufshcd_readl(hba, REG_UFS_MTK_IP_VER);
1084 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1124 if (host->hw_ver.major >= 3) {
1158 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1167 * the host.
1169 host->unipro_lpm = lpm;
1188 * to make sure that both host and device TX LCC are disabled
1405 /* wait host return to idle state when auto-hibern8 off */
1452 * for completed host reset.
1510 /* Only for the host which have TX skew issue */
1612 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1613 struct ufs_mtk_clk *mclk = &host->mclk;
1661 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1664 if (host->caps & UFS_MTK_CAP_DISABLE_MCQ)
1691 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1694 if (!host->mcq_nr_intr) {
1725 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1729 for (i = 0; i < host->mcq_nr_intr; i++) {
1730 irq = host->mcq_intr_info[i].irq;
1736 host->mcq_intr_info[i].qid = i;
1738 &host->mcq_intr_info[i]);
1753 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1756 if (!host->mcq_set_intr) {
1766 host->mcq_set_intr = true;