Lines Matching defs:host

96 	struct ufs_mtk_host *host = ufshcd_get_variant(hba);
98 return !!(host->caps & UFS_MTK_CAP_BOOST_CRYPT_ENGINE);
103 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
105 return !!(host->caps & UFS_MTK_CAP_VA09_PWR_CTRL);
110 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
112 return !!(host->caps & UFS_MTK_CAP_BROKEN_VCC);
117 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
119 return !!(host->caps & UFS_MTK_CAP_PMC_VIA_FASTAUTO);
172 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
174 reset_control_assert(host->hci_reset);
175 reset_control_assert(host->crypto_reset);
176 reset_control_assert(host->unipro_reset);
180 reset_control_deassert(host->unipro_reset);
181 reset_control_deassert(host->crypto_reset);
182 reset_control_deassert(host->hci_reset);
199 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
201 ufs_mtk_init_reset_control(hba, &host->hci_reset,
203 ufs_mtk_init_reset_control(hba, &host->unipro_reset,
205 ufs_mtk_init_reset_control(hba, &host->crypto_reset,
212 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
215 if (host->unipro_lpm) {
225 if (host->caps & UFS_MTK_CAP_DISABLE_AH8) {
234 * to prevent host hang issue
246 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
251 host->mphy = devm_of_phy_get_by_index(dev, np, 0);
253 if (host->mphy == ERR_PTR(-EPROBE_DEFER)) {
262 } else if (IS_ERR(host->mphy)) {
263 err = PTR_ERR(host->mphy);
271 host->mphy = NULL;
284 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
289 if (host->ref_clk_enabled == on)
297 ufshcd_delay_us(host->ref_clk_gating_wait_us, 10);
316 ufs_mtk_ref_clk_notify(host->ref_clk_enabled, POST_CHANGE, res);
321 host->ref_clk_enabled = on;
323 ufshcd_delay_us(host->ref_clk_ungating_wait_us, 10);
333 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
336 host->ref_clk_gating_wait_us =
339 host->ref_clk_gating_wait_us = gating_us;
342 host->ref_clk_ungating_wait_us = REFCLK_DEFAULT_WAIT_US;
347 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
349 if (((host->ip_ver >> 16) & 0xFF) >= 0x36) {
425 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
426 struct phy *mphy = host->mphy;
430 if (!mphy || !(on ^ host->mphy_powered_on))
435 ret = regulator_enable(host->reg_va09);
447 ret = regulator_disable(host->reg_va09);
457 host->mphy_powered_on = on;
480 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
488 cfg = host->crypt;
550 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
556 host->crypt = devm_kzalloc(dev, sizeof(*(host->crypt)),
558 if (!host->crypt)
574 cfg = host->crypt;
589 host->caps |= UFS_MTK_CAP_BOOST_CRYPT_ENGINE;
597 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
599 host->reg_va09 = regulator_get(hba->dev, "va09");
600 if (IS_ERR(host->reg_va09))
603 host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL;
608 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
618 host->caps |= UFS_MTK_CAP_DISABLE_AH8;
621 host->caps |= UFS_MTK_CAP_BROKEN_VCC;
624 host->caps |= UFS_MTK_CAP_PMC_VIA_FASTAUTO;
626 dev_info(hba->dev, "caps: 0x%x", host->caps);
631 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
633 if (!host || !host->pm_qos_init)
636 cpu_latency_qos_update_request(&host->pm_qos_req,
648 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
651 phy_power_on(host->mphy);
659 phy_power_off(host->mphy);
665 * @hba: host controller instance
674 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
683 if (!host)
715 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
718 if (host->hw_ver.major)
722 host->hw_ver.major = 2;
727 host->hw_ver.major = 3;
750 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
752 struct ufs_mtk_clk *mclk = &host->mclk;
762 host->mclk.ufs_sel_clki = clki;
764 host->mclk.ufs_sel_max_clki = clki;
768 host->mclk.ufs_sel_min_clki = clki;
852 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
857 host->mcq_nr_intr = UFSHCD_MAX_Q_NR;
860 for (i = 0; i < host->mcq_nr_intr; i++) {
864 host->mcq_intr_info[i].irq = MTK_MCQ_INVALID_IRQ;
867 host->mcq_intr_info[i].hba = hba;
868 host->mcq_intr_info[i].irq = irq;
875 for (i = 0; i < host->mcq_nr_intr; i++)
876 host->mcq_intr_info[i].irq = MTK_MCQ_INVALID_IRQ;
878 host->mcq_nr_intr = 0;
883 * @hba: host controller instance
895 struct ufs_mtk_host *host;
898 host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL);
899 if (!host) {
901 dev_info(dev, "%s: no memory for mtk ufs host\n", __func__);
905 host->hba = hba;
906 ufshcd_set_variant(hba, host);
914 /* Initialize host capability */
945 if (host->caps & UFS_MTK_CAP_DISABLE_AH8)
960 host->ip_ver = ufshcd_readl(hba, REG_UFS_MTK_IP_VER);
963 cpu_latency_qos_add_request(&host->pm_qos_req, PM_QOS_DEFAULT_VALUE);
964 host->pm_qos_init = true;
998 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1040 if (host->hw_ver.major >= 3) {
1074 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1083 * the host.
1085 host->unipro_lpm = lpm;
1104 * to make sure that both host and device TX LCC are disabled
1307 /* wait host return to idle state when auto-hibern8 off */
1354 * for completed host reset.
1503 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1504 struct ufs_mtk_clk *mclk = &host->mclk;
1576 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1579 if (!host->mcq_nr_intr) {
1610 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1614 for (i = 0; i < host->mcq_nr_intr; i++) {
1615 irq = host->mcq_intr_info[i].irq;
1621 host->mcq_intr_info[i].qid = i;
1623 &host->mcq_intr_info[i]);
1638 struct ufs_mtk_host *host = ufshcd_get_variant(hba);
1641 if (!host->mcq_set_intr) {
1651 host->mcq_set_intr = true;