Skip to content

Commit 52e5035

Browse files
cometzeromartinkpetersen
authored andcommitted
scsi: ufs: ufs-exynos: Add pre/post_hce_enable drv callbacks
Add driver-specific pre/post_hce_enable callbacks to execute extra initializations before and after hce_enable_notify callback. Link: https://lore.kernel.org/r/20211018124216.153072-11-chanho61.park@samsung.com Cc: Alim Akhtar <alim.akhtar@samsung.com> Cc: Kiwoong Kim <kwmad.kim@samsung.com> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Chanho Park <chanho61.park@samsung.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 3f02cc9 commit 52e5035

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/scsi/ufs/ufs-exynos.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,12 @@ static int exynos_ufs_hce_enable_notify(struct ufs_hba *hba,
11361136

11371137
switch (status) {
11381138
case PRE_CHANGE:
1139+
if (ufs->drv_data->pre_hce_enable) {
1140+
ret = ufs->drv_data->pre_hce_enable(ufs);
1141+
if (ret)
1142+
return ret;
1143+
}
1144+
11391145
ret = exynos_ufs_host_reset(hba);
11401146
if (ret)
11411147
return ret;
@@ -1145,6 +1151,10 @@ static int exynos_ufs_hce_enable_notify(struct ufs_hba *hba,
11451151
exynos_ufs_calc_pwm_clk_div(ufs);
11461152
if (!(ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL))
11471153
exynos_ufs_enable_auto_ctrl_hcc(ufs);
1154+
1155+
if (ufs->drv_data->post_hce_enable)
1156+
ret = ufs->drv_data->post_hce_enable(ufs);
1157+
11481158
break;
11491159
}
11501160

drivers/scsi/ufs/ufs-exynos.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ struct exynos_ufs_drv_data {
154154
struct ufs_pa_layer_attr *pwr);
155155
int (*post_pwr_change)(struct exynos_ufs *ufs,
156156
struct ufs_pa_layer_attr *pwr);
157+
int (*pre_hce_enable)(struct exynos_ufs *ufs);
158+
int (*post_hce_enable)(struct exynos_ufs *ufs);
157159
};
158160

159161
struct ufs_phy_time_cfg {

0 commit comments

Comments
 (0)