summaryrefslogtreecommitdiff
path: root/drivers/ufs/host/ufs-mediatek.h
diff options
context:
space:
mode:
authorStanley Chu <stanley.chu@mediatek.com>2022-06-16 08:37:24 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2022-06-17 05:08:44 +0300
commitece418d0291117e3fc700f10e7fa9187010e38a0 (patch)
tree7a131cf067c673f890d102df2a4360b747fbea13 /drivers/ufs/host/ufs-mediatek.h
parent1d6f9decb60a23cde2e0fbe0f89d5fc6d462ddd5 (diff)
downloadlinux-ece418d0291117e3fc700f10e7fa9187010e38a0.tar.xz
scsi: ufs: ufs-mediatek: Support multiple VCC sources
Support multiple VCC sources in MediaTek UFS platforms. Two options are provided and distinguished by specific device tree attributes as below examples, [Option 1: By numbering] mediatek,ufs-vcc-by-num; vcc-opt1-supply = <&mt6373_vbuck4_ufs>; vcc-opt2-supply = <&mt6363_vemc>; [Option 2: By UFS version] mediatek,ufs-vcc-by-ver; vcc-ufs3-supply = <&mt6373_vbuck4_ufs>; Link: https://lore.kernel.org/r/20220616053725.5681-11-stanley.chu@mediatek.com Signed-off-by: Alice Chao <alice.chao@mediatek.com> Signed-off-by: Peter Wang <peter.wang@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.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/ufs/host/ufs-mediatek.h b/drivers/ufs/host/ufs-mediatek.h
index 5c6101ac518f..49a2137fb251 100644
--- a/drivers/ufs/host/ufs-mediatek.h
+++ b/drivers/ufs/host/ufs-mediatek.h
@@ -83,6 +83,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_GET_VCC_NUM BIT(6)
#define UFS_MTK_SIP_DEVICE_PWR_CTRL BIT(7)
/*
@@ -145,6 +146,16 @@ struct ufs_mtk_host {
};
/*
+ * Multi-VCC by Numbering
+ */
+enum ufs_mtk_vcc_num {
+ UFS_VCC_NONE = 0,
+ UFS_VCC_1,
+ UFS_VCC_2,
+ UFS_VCC_MAX
+};
+
+/*
* SMC call wrapper function
*/
struct ufs_mtk_smc_arg {
@@ -183,6 +194,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_get_vcc_num(res) \
+ ufs_mtk_smc(UFS_MTK_SIP_GET_VCC_NUM, &(res))
+
#define ufs_mtk_device_pwr_ctrl(on, ufs_ver, res) \
ufs_mtk_smc(UFS_MTK_SIP_DEVICE_PWR_CTRL, &(res), on, ufs_ver)