scsi: ufs: add pre clock controls.
authorhgchu <hg.chu@samsung.com>
Fri, 12 Jan 2018 05:18:03 +0000 (14:18 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:20:30 +0000 (17:20 +0900)
Change-Id: I0356bd21c9a698b9c7d82682cc10b5fbd3127a8a
Signed-off-by: hgchu <hg.chu@samsung.com>
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h

index 1cdaeab9565560d1166fe23e80f798ff91c811e2..5d5164bcf56442cc07cdaebba21f8ebe1490d318 100644 (file)
@@ -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)) {
index cc45d99f4dcc1ab1dec0864a7cb3abbb68401342..b330c1178e19c9a13baba214089e4449e5c86c07 100644 (file)
@@ -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)
 {