]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: ufs: exynos: fsd: Gate ref_clk and put UFS device in reset on suspend
authorBharat Uppal <bharat.uppal@samsung.com>
Thu, 21 Aug 2025 05:39:23 +0000 (11:09 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:17 +0000 (15:34 -0500)
[ Upstream commit 6d55af0f0740bf3d77943425fdafb77dc0fa6bb9 ]

On FSD platform, gating the reference clock (ref_clk) and putting the
UFS device in reset by asserting the reset signal during UFS suspend,
improves the power savings and ensures the PHY is fully turned off.

These operations are added as FSD specific suspend hook to avoid
unintended side effects on other SoCs supported by this driver.

Co-developed-by: Nimesh Sati <nimesh.sati@samsung.com>
Signed-off-by: Nimesh Sati <nimesh.sati@samsung.com>
Signed-off-by: Bharat Uppal <bharat.uppal@samsung.com>
Link: https://lore.kernel.org/r/20250821053923.69411-1-bharat.uppal@samsung.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ufs/host/ufs-exynos.c

index 6bd1532bfd1d6dff259a8abe4844ab2429140d80..6a337e058e5c4cfe896ac2452871b0b12cb3a751 100644 (file)
@@ -1882,6 +1882,13 @@ static int fsd_ufs_pre_pwr_change(struct exynos_ufs *ufs,
        return 0;
 }
 
+static int fsd_ufs_suspend(struct exynos_ufs *ufs)
+{
+       exynos_ufs_gate_clks(ufs);
+       hci_writel(ufs, 0, HCI_GPIO_OUT);
+       return 0;
+}
+
 static inline u32 get_mclk_period_unipro_18(struct exynos_ufs *ufs)
 {
        return (16 * 1000 * 1000000UL / ufs->mclk_rate);
@@ -2162,6 +2169,7 @@ static const struct exynos_ufs_drv_data fsd_ufs_drvs = {
        .pre_link               = fsd_ufs_pre_link,
        .post_link              = fsd_ufs_post_link,
        .pre_pwr_change         = fsd_ufs_pre_pwr_change,
+       .suspend                = fsd_ufs_suspend,
 };
 
 static const struct exynos_ufs_drv_data gs101_ufs_drvs = {