From 96495cde1bd0d5b376e105f003a6bfe0f0d354e4 Mon Sep 17 00:00:00 2001 From: hgchu Date: Fri, 12 Jan 2018 14:18:03 +0900 Subject: [PATCH] scsi: ufs: add pre clock controls. Change-Id: I0356bd21c9a698b9c7d82682cc10b5fbd3127a8a Signed-off-by: hgchu --- drivers/scsi/ufs/ufshcd.c | 4 +--- drivers/scsi/ufs/ufshcd.h | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 1cdaeab95655..5d5164bcf564 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7063,9 +7063,7 @@ static int __ufshcd_setup_clocks(struct ufs_hba *hba, bool on, if (list_empty(head)) goto out; - ret = ufshcd_vops_setup_clocks(hba, on, PRE_CHANGE); - if (ret) - return ret; + ufshcd_vops_pre_setup_clocks(hba, on); list_for_each_entry(clki, head, list) { if (!IS_ERR_OR_NULL(clki->clk)) { diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index cc45d99f4dcc..b330c1178e19 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -316,6 +316,7 @@ struct ufs_hba_variant_ops { u32 (*get_ufs_hci_version)(struct ufs_hba *); int (*clk_scale_notify)(struct ufs_hba *, bool, enum ufs_notify_change_status); + int (*pre_setup_clocks)(struct ufs_hba *, bool); int (*setup_clocks)(struct ufs_hba *, bool, enum ufs_notify_change_status); int (*setup_regulators)(struct ufs_hba *, bool); @@ -916,6 +917,14 @@ static inline int ufshcd_vops_clk_scale_notify(struct ufs_hba *hba, return 0; } +static inline int ufshcd_vops_pre_setup_clocks(struct ufs_hba *hba, bool on) +{ + if (hba->vops && hba->vops->pre_setup_clocks) + return hba->vops->pre_setup_clocks(hba, on); + return 0; +} + + static inline int ufshcd_vops_setup_clocks(struct ufs_hba *hba, bool on, enum ufs_notify_change_status status) { -- 2.20.1