Skip to content

Commit 6b481af

Browse files
Mani-Sadhasivammartinkpetersen
authored andcommitted
scsi: ufs: qcom: Simplify ufs_qcom_{assert/deassert}_reset
In both the functions, UFS_PHY_SOFT_RESET contains the mask of the reset bit. So this can be passed directly as the value to be written for asserting the reset. For deasserting, 0 can be passed. This gets rid of the FIELD_PREP() inside these functions and also UFS_PHY_RESET_{ENABLE/DISABLE} definitions. Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Andrew Halaney <[email protected]> Tested-by: Andrew Halaney <[email protected]> # sa8775p-ride Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 3b60f45 commit 6b481af

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/ufs/host/ufs-qcom.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ enum {
9292
#define TEST_BUS_SEL GENMASK(22, 19)
9393
#define UFS_REG_TEST_BUS_EN BIT(30)
9494

95-
#define UFS_PHY_RESET_ENABLE 1
96-
#define UFS_PHY_RESET_DISABLE 0
97-
9895
/* bit definitions for REG_UFS_CFG2 register */
9996
#define UAWM_HW_CGC_EN BIT(0)
10097
#define UARM_HW_CGC_EN BIT(1)
@@ -157,8 +154,7 @@ ufs_qcom_get_controller_revision(struct ufs_hba *hba,
157154

158155
static inline void ufs_qcom_assert_reset(struct ufs_hba *hba)
159156
{
160-
ufshcd_rmwl(hba, UFS_PHY_SOFT_RESET, FIELD_PREP(UFS_PHY_SOFT_RESET, UFS_PHY_RESET_ENABLE),
161-
REG_UFS_CFG1);
157+
ufshcd_rmwl(hba, UFS_PHY_SOFT_RESET, UFS_PHY_SOFT_RESET, REG_UFS_CFG1);
162158

163159
/*
164160
* Make sure assertion of ufs phy reset is written to
@@ -169,8 +165,7 @@ static inline void ufs_qcom_assert_reset(struct ufs_hba *hba)
169165

170166
static inline void ufs_qcom_deassert_reset(struct ufs_hba *hba)
171167
{
172-
ufshcd_rmwl(hba, UFS_PHY_SOFT_RESET, FIELD_PREP(UFS_PHY_SOFT_RESET, UFS_PHY_RESET_DISABLE),
173-
REG_UFS_CFG1);
168+
ufshcd_rmwl(hba, UFS_PHY_SOFT_RESET, 0, REG_UFS_CFG1);
174169

175170
/*
176171
* Make sure de-assertion of ufs phy reset is written to

0 commit comments

Comments
 (0)