From: hgchu Date: Fri, 12 Jan 2018 05:18:03 +0000 (+0900) Subject: scsi: ufs: add pre clock controls. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=96495cde1bd0d5b376e105f003a6bfe0f0d354e4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git scsi: ufs: add pre clock controls. Change-Id: I0356bd21c9a698b9c7d82682cc10b5fbd3127a8a Signed-off-by: hgchu --- 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) {