Commit 3a887a38 authored by Po-Wen Kao's avatar Po-Wen Kao Committed by Martin K. Petersen

scsi: ufs: mediatek: Rename host power control API

Mediatek host power includes two parts:

 1. ufshci power, which is the main power of ufs host controller.

 2. ufshci crypto sram power, which is the power of ufs crypto engine.

The host power control is actually controlling crypto sram power. Rename
it.
Signed-off-by: default avatarPo-Wen Kao <powen.kao@mediatek.com>
Acked-by: default avatarChun-Hung Wu <Chun-Hung.Wu@mediatek.com>
Reviewed-by: default avatarPeter Wang <peter.wang@mediatek.com>
Signed-off-by: default avatarPeter Wang <peter.wang@mediatek.com>
Reviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20240315083448.7185-6-peter.wang@mediatek.comSigned-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 4bd07f05
......@@ -16,7 +16,7 @@
#define UFS_MTK_SIP_DEVICE_RESET BIT(1)
#define UFS_MTK_SIP_CRYPTO_CTRL BIT(2)
#define UFS_MTK_SIP_REF_CLK_NOTIFICATION BIT(3)
#define UFS_MTK_SIP_HOST_PWR_CTRL BIT(5)
#define UFS_MTK_SIP_SRAM_PWR_CTRL BIT(5)
#define UFS_MTK_SIP_GET_VCC_NUM BIT(6)
#define UFS_MTK_SIP_DEVICE_PWR_CTRL BIT(7)
......@@ -31,13 +31,6 @@ enum ufs_mtk_vcc_num {
UFS_VCC_MAX
};
/*
* Host Power Control options
*/
enum {
HOST_PWR_HCI = 0,
HOST_PWR_MPHY
};
/*
* SMC call wrapper function
......@@ -78,8 +71,8 @@ static inline void _ufs_mtk_smc(struct ufs_mtk_smc_arg s)
#define ufs_mtk_device_reset_ctrl(high, res) \
ufs_mtk_smc(UFS_MTK_SIP_DEVICE_RESET, &(res), high)
#define ufs_mtk_host_pwr_ctrl(opt, on, res) \
ufs_mtk_smc(UFS_MTK_SIP_HOST_PWR_CTRL, &(res), opt, on)
#define ufs_mtk_sram_pwr_ctrl(on, res) \
ufs_mtk_smc(UFS_MTK_SIP_SRAM_PWR_CTRL, &(res), on)
#define ufs_mtk_get_vcc_num(res) \
ufs_mtk_smc(UFS_MTK_SIP_GET_VCC_NUM, &(res))
......
......@@ -1408,7 +1408,7 @@ static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,
if (ufshcd_is_link_off(hba))
ufs_mtk_device_reset_ctrl(0, res);
ufs_mtk_host_pwr_ctrl(HOST_PWR_HCI, false, res);
ufs_mtk_sram_pwr_ctrl(false, res);
return 0;
fail:
......@@ -1429,7 +1429,7 @@ static int ufs_mtk_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
if (hba->ufshcd_state != UFSHCD_STATE_OPERATIONAL)
ufs_mtk_dev_vreg_set_lpm(hba, false);
ufs_mtk_host_pwr_ctrl(HOST_PWR_HCI, true, res);
ufs_mtk_sram_pwr_ctrl(true, res);
err = ufs_mtk_mphy_power_on(hba, true);
if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment