Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71d7a866 authored by Stanley Chu's avatar Stanley Chu
Browse files

UPSTREAM: scsi: ufs: introduce common function to disable host TX LCC

Many vendors would like to disable host TX LCC during initialization
flow. Introduce a common function for all users to make drivers easier to
read and maintained. This patch does not change any functionality.

Bug: 151050916
(cherry picked from commit 984eaac133e3d6d993ffd4de9e4bdc2c94de742b)
Link: https://lore.kernel.org/r/20200207070357.17169-3-stanley.chu@mediatek.com


Reviewed-by: default avatarCan Guo <cang@codeaurora.org>
Reviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
Reviewed-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
Signed-off-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Change-Id: Ib40f9228475e74377178b41f0ffa6f46470c52e3
parent 3de2be2b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ static int cdns_ufs_link_startup_notify(struct ufs_hba *hba,
	 * and device TX LCC are disabled once link startup is
	 * completed.
	 */
	ufshcd_dme_set(hba, UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE), 0);
	ufshcd_disable_host_tx_lcc(hba);

	/*
	 * Disabling Autohibern8 feature in cadence UFS
+1 −1
Original line number Diff line number Diff line
@@ -235,7 +235,7 @@ static int ufs_hisi_link_startup_pre_change(struct ufs_hba *hba)
	ufshcd_writel(hba, reg, REG_AUTO_HIBERNATE_IDLE_TIMER);

	/* Unipro PA_Local_TX_LCC_Enable */
	ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x155E, 0x0), 0x0);
	ufshcd_disable_host_tx_lcc(hba);
	/* close Unipro VS_Mk2ExtnSupport */
	ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD0AB, 0x0), 0x0);
	ufshcd_dme_get(hba, UIC_ARG_MIB_SEL(0xD0AB, 0x0), &value);
+1 −1
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ static int ufs_mtk_pre_link(struct ufs_hba *hba)
	 * to make sure that both host and device TX LCC are disabled
	 * once link startup is completed.
	 */
	ret = ufshcd_dme_set(hba, UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE), 0);
	ret = ufshcd_disable_host_tx_lcc(hba);
	if (ret)
		return ret;

+1 −3
Original line number Diff line number Diff line
@@ -553,9 +553,7 @@ static int ufs_qcom_link_startup_notify(struct ufs_hba *hba,
		 * completed.
		 */
		if (ufshcd_get_local_unipro_ver(hba) != UFS_UNIPRO_VER_1_41)
			err = ufshcd_dme_set(hba,
					UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE),
					0);
			err = ufshcd_disable_host_tx_lcc(hba);

		break;
	case POST_CHANGE:
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ static int ufs_intel_disable_lcc(struct ufs_hba *hba)

	ufshcd_dme_get(hba, attr, &lcc_enable);
	if (lcc_enable)
		ufshcd_dme_set(hba, attr, 0);
		ufshcd_disable_host_tx_lcc(hba);

	return 0;
}
Loading