Skip to content

Commit 0e9f437

Browse files
Mani-Sadhasivammartinkpetersen
authored andcommitted
scsi: ufs: qcom: Use ufshcd_rmwl() where applicable
Instead of using both ufshcd_readl() and ufshcd_writel() to read/modify/ write a register, let's make use of the existing helper. Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Andrew Halaney <[email protected]> # sa8775p-ride Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 104cd58 commit 0e9f437

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

drivers/ufs/host/ufs-qcom.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,8 @@ static int ufs_qcom_power_up_sequence(struct ufs_hba *hba)
387387
*/
388388
static void ufs_qcom_enable_hw_clk_gating(struct ufs_hba *hba)
389389
{
390-
ufshcd_writel(hba,
391-
ufshcd_readl(hba, REG_UFS_CFG2) | REG_UFS_CFG2_CGC_EN_ALL,
392-
REG_UFS_CFG2);
390+
ufshcd_rmwl(hba, REG_UFS_CFG2_CGC_EN_ALL, REG_UFS_CFG2_CGC_EN_ALL,
391+
REG_UFS_CFG2);
393392

394393
/* Ensure that HW clock gating is enabled before next operations */
395394
mb();
@@ -1689,11 +1688,8 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
16891688
platform_msi_domain_free_irqs(hba->dev);
16901689
} else {
16911690
if (host->hw_ver.major == 6 && host->hw_ver.minor == 0 &&
1692-
host->hw_ver.step == 0) {
1693-
ufshcd_writel(hba,
1694-
ufshcd_readl(hba, REG_UFS_CFG3) | 0x1F000,
1695-
REG_UFS_CFG3);
1696-
}
1691+
host->hw_ver.step == 0)
1692+
ufshcd_rmwl(hba, ESI_VEC_MASK, 0x1f00, REG_UFS_CFG3);
16971693
ufshcd_mcq_enable_esi(hba);
16981694
}
16991695

drivers/ufs/host/ufs-qcom.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ enum {
102102
#define TMRLUT_HW_CGC_EN BIT(6)
103103
#define OCSC_HW_CGC_EN BIT(7)
104104

105+
/* bit definitions for REG_UFS_CFG3 register */
106+
#define ESI_VEC_MASK GENMASK(22, 12)
107+
105108
/* bit definitions for REG_UFS_PARAM0 */
106109
#define MAX_HS_GEAR_MASK GENMASK(6, 4)
107110
#define UFS_QCOM_MAX_GEAR(x) FIELD_GET(MAX_HS_GEAR_MASK, (x))

0 commit comments

Comments
 (0)