hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/soc/qcom/tcs.h
....@@ -1,6 +1,6 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 /*
3
- * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
3
+ * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
44 */
55
66 #ifndef __SOC_QCOM_TCS_H__
....@@ -53,4 +53,22 @@
5353 struct tcs_cmd *cmds;
5454 };
5555
56
+#define BCM_TCS_CMD_COMMIT_SHFT 30
57
+#define BCM_TCS_CMD_COMMIT_MASK 0x40000000
58
+#define BCM_TCS_CMD_VALID_SHFT 29
59
+#define BCM_TCS_CMD_VALID_MASK 0x20000000
60
+#define BCM_TCS_CMD_VOTE_X_SHFT 14
61
+#define BCM_TCS_CMD_VOTE_MASK 0x3fff
62
+#define BCM_TCS_CMD_VOTE_Y_SHFT 0
63
+#define BCM_TCS_CMD_VOTE_Y_MASK 0xfffc000
64
+
65
+/* Construct a Bus Clock Manager (BCM) specific TCS command */
66
+#define BCM_TCS_CMD(commit, valid, vote_x, vote_y) \
67
+ (((commit) << BCM_TCS_CMD_COMMIT_SHFT) | \
68
+ ((valid) << BCM_TCS_CMD_VALID_SHFT) | \
69
+ ((cpu_to_le32(vote_x) & \
70
+ BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_X_SHFT) | \
71
+ ((cpu_to_le32(vote_y) & \
72
+ BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_Y_SHFT))
73
+
5674 #endif /* __SOC_QCOM_TCS_H__ */