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. Link: https://lore.kernel.org/r/20200207070357.17169-3-stanley.chu@mediatek.com Reviewed-by: Can Guo <cang@codeaurora.org> Reviewed-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
618b4d07a4
commit
984eaac133
|
@ -192,7 +192,7 @@ static int cdns_ufs_link_startup_notify(struct ufs_hba *hba,
|
||||||
* and device TX LCC are disabled once link startup is
|
* and device TX LCC are disabled once link startup is
|
||||||
* completed.
|
* 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
|
* Disabling Autohibern8 feature in cadence UFS
|
||||||
|
|
|
@ -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);
|
ufshcd_writel(hba, reg, REG_AUTO_HIBERNATE_IDLE_TIMER);
|
||||||
|
|
||||||
/* Unipro PA_Local_TX_LCC_Enable */
|
/* 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 */
|
/* close Unipro VS_Mk2ExtnSupport */
|
||||||
ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD0AB, 0x0), 0x0);
|
ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD0AB, 0x0), 0x0);
|
||||||
ufshcd_dme_get(hba, UIC_ARG_MIB_SEL(0xD0AB, 0x0), &value);
|
ufshcd_dme_get(hba, UIC_ARG_MIB_SEL(0xD0AB, 0x0), &value);
|
||||||
|
|
|
@ -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
|
* to make sure that both host and device TX LCC are disabled
|
||||||
* once link startup is completed.
|
* 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)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
|
@ -554,9 +554,7 @@ static int ufs_qcom_link_startup_notify(struct ufs_hba *hba,
|
||||||
* completed.
|
* completed.
|
||||||
*/
|
*/
|
||||||
if (ufshcd_get_local_unipro_ver(hba) != UFS_UNIPRO_VER_1_41)
|
if (ufshcd_get_local_unipro_ver(hba) != UFS_UNIPRO_VER_1_41)
|
||||||
err = ufshcd_dme_set(hba,
|
err = ufshcd_disable_host_tx_lcc(hba);
|
||||||
UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE),
|
|
||||||
0);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case POST_CHANGE:
|
case POST_CHANGE:
|
||||||
|
|
|
@ -44,7 +44,7 @@ static int ufs_intel_disable_lcc(struct ufs_hba *hba)
|
||||||
|
|
||||||
ufshcd_dme_get(hba, attr, &lcc_enable);
|
ufshcd_dme_get(hba, attr, &lcc_enable);
|
||||||
if (lcc_enable)
|
if (lcc_enable)
|
||||||
ufshcd_dme_set(hba, attr, 0);
|
ufshcd_disable_host_tx_lcc(hba);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -914,6 +914,11 @@ static inline bool ufshcd_is_hs_mode(struct ufs_pa_layer_attr *pwr_info)
|
||||||
pwr_info->pwr_tx == FASTAUTO_MODE);
|
pwr_info->pwr_tx == FASTAUTO_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int ufshcd_disable_host_tx_lcc(struct ufs_hba *hba)
|
||||||
|
{
|
||||||
|
return ufshcd_dme_set(hba, UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE), 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* Expose Query-Request API */
|
/* Expose Query-Request API */
|
||||||
int ufshcd_query_descriptor_retry(struct ufs_hba *hba,
|
int ufshcd_query_descriptor_retry(struct ufs_hba *hba,
|
||||||
enum query_opcode opcode,
|
enum query_opcode opcode,
|
||||||
|
|
Loading…
Reference in New Issue