Skip to content

Commit cd4c002

Browse files
petegriffinmartinkpetersen
authored andcommitted
scsi: ufs: exynos: gs101: Put UFS device in reset on .suspend()
GPIO_OUT[0] is connected to the reset pin of embedded UFS device. Before powering off the phy assert the reset signal. This is added as a gs101 specific suspend hook so as not to have any unintended consequences for other SoCs supported by this driver. Signed-off-by: Peter Griffin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 67e4085 commit cd4c002

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

drivers/ufs/host/ufs-exynos.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,6 +1700,12 @@ static void exynos_ufs_hibern8_notify(struct ufs_hba *hba,
17001700
}
17011701
}
17021702

1703+
static int gs101_ufs_suspend(struct exynos_ufs *ufs)
1704+
{
1705+
hci_writel(ufs, 0 << 0, HCI_GPIO_OUT);
1706+
return 0;
1707+
}
1708+
17031709
static int exynos_ufs_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,
17041710
enum ufs_notify_change_status status)
17051711
{
@@ -1708,6 +1714,9 @@ static int exynos_ufs_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,
17081714
if (status == PRE_CHANGE)
17091715
return 0;
17101716

1717+
if (ufs->drv_data->suspend)
1718+
ufs->drv_data->suspend(ufs);
1719+
17111720
if (!ufshcd_is_link_active(hba))
17121721
phy_power_off(ufs->phy);
17131722

@@ -2170,6 +2179,7 @@ static const struct exynos_ufs_drv_data gs101_ufs_drvs = {
21702179
.pre_link = gs101_ufs_pre_link,
21712180
.post_link = gs101_ufs_post_link,
21722181
.pre_pwr_change = gs101_ufs_pre_pwr_change,
2182+
.suspend = gs101_ufs_suspend,
21732183
};
21742184

21752185
static const struct of_device_id exynos_ufs_of_match[] = {

drivers/ufs/host/ufs-exynos.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ struct exynos_ufs_drv_data {
192192
struct ufs_pa_layer_attr *pwr);
193193
int (*pre_hce_enable)(struct exynos_ufs *ufs);
194194
int (*post_hce_enable)(struct exynos_ufs *ufs);
195+
int (*suspend)(struct exynos_ufs *ufs);
195196
};
196197

197198
struct ufs_phy_time_cfg {

0 commit comments

Comments
 (0)