summaryrefslogtreecommitdiffstats
path: root/drivers/ufs/host/ufs-mediatek.h
diff options
context:
space:
mode:
authorPo-Wen Kao <powen.kao@mediatek.com>2022-06-23 05:50:50 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2022-06-28 05:17:36 +0200
commit2cf5cb2bb13140ecc0f01ebc8844ee8b5203293f (patch)
tree80882cf324f7b0017f3f76b52a801819797b7231 /drivers/ufs/host/ufs-mediatek.h
parentscsi: ufs: ufs-mediatek: Disable reset confirm feature by UniPro (diff)
downloadlinux-2cf5cb2bb13140ecc0f01ebc8844ee8b5203293f.tar.xz
linux-2cf5cb2bb13140ecc0f01ebc8844ee8b5203293f.zip
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.h')
-rw-r--r--drivers/ufs/host/ufs-mediatek.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/ufs/host/ufs-mediatek.h b/drivers/ufs/host/ufs-mediatek.h
index c12ceb4d941f..cdf40851e626 100644
--- a/drivers/ufs/host/ufs-mediatek.h
+++ b/drivers/ufs/host/ufs-mediatek.h
@@ -84,6 +84,7 @@ enum {
#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_GET_VCC_NUM BIT(6)
#define UFS_MTK_SIP_DEVICE_PWR_CTRL BIT(7)
@@ -157,6 +158,14 @@ enum ufs_mtk_vcc_num {
};
/*
+ * Host Power Control options
+ */
+enum {
+ HOST_PWR_HCI = 0,
+ HOST_PWR_MPHY
+};
+
+/*
* SMC call wrapper function
*/
struct ufs_mtk_smc_arg {
@@ -195,6 +204,9 @@ static 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_get_vcc_num(res) \
ufs_mtk_smc(UFS_MTK_SIP_GET_VCC_NUM, &(res))