@@ -173,6 +173,9 @@ static int ufshcd_mcq_config_resource(struct ufs_hba *hba)
struct resource *res_mem, *res_mcq;
int i, ret = 0;
+ if (ufshcd_mcq_vops_config_resource(hba) == 0)
+ return 0;
+
memcpy(hba->res, ufs_res_info, sizeof(ufs_res_info));
for (i = 0; i < RES_MAX; i++) {
@@ -257,6 +257,14 @@ static inline int ufshcd_vops_get_outstanding_cqs(struct ufs_hba *hba,
return -EOPNOTSUPP;
}
+static inline int ufshcd_mcq_vops_config_resource(struct ufs_hba *hba)
+{
+ if (hba->vops && hba->vops->config_mcq_resource)
+ return hba->vops->config_mcq_resource(hba);
+
+ return -EOPNOTSUPP;
+}
+
extern const struct ufs_pm_lvl_states ufs_pm_lvl_states[];
/**
@@ -339,6 +339,7 @@ struct ufs_hba_variant_ops {
int (*op_runtime_config)(struct ufs_hba *hba);
int (*get_outstanding_cqs)(struct ufs_hba *hba,
unsigned long *ocqs);
+ int (*config_mcq_resource)(struct ufs_hba *hba);
};
/* clock gating state */
SoCs vendor config MCQ register address resource in config_mcq_resource vops Signed-off-by: Eddie Huang <eddie.huang@mediatek.com> --- drivers/ufs/core/ufs-mcq.c | 3 +++ drivers/ufs/core/ufshcd-priv.h | 8 ++++++++ include/ufs/ufshcd.h | 1 + 3 files changed, 12 insertions(+)