summaryrefslogtreecommitdiff
path: root/drivers/ufs/host/ufs-mediatek.c
diff options
context:
space:
mode:
authorPo-Wen Kao <powen.kao@mediatek.com>2022-06-23 11:50:50 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2022-06-27 23:17:36 -0400
commit2cf5cb2bb13140ecc0f01ebc8844ee8b5203293f (patch)
tree80882cf324f7b0017f3f76b52a801819797b7231 /drivers/ufs/host/ufs-mediatek.c
parent4918694ccd6974f3ec8eeda3f34ace0ce480153e (diff)
scsi: ufs: ufs-mediatek: Support host power control
Add interfaces for controlling the host power to optimize the power consumption in MediaTek UFS platforms. Link: https://lore.kernel.org/r/20220623035052.18802-7-stanley.chu@mediatek.com Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Po-Wen Kao <powen.kao@mediatek.com> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs/host/ufs-mediatek.c')
-rw-r--r--drivers/ufs/host/ufs-mediatek.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index a7482f530f27..7254629484ab 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -1190,6 +1190,8 @@ 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);
+
return 0;
fail:
/*
@@ -1204,10 +1206,13 @@ fail:
static int ufs_mtk_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
{
int err;
+ struct arm_smccc_res res;
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);
+
err = ufs_mtk_mphy_power_on(hba, true);
if (err)
goto fail;