1
2
3
4
5
6 #ifndef __SOC_QCOM_TCS_H__
7 #define __SOC_QCOM_TCS_H__
8
9 #define MAX_RPMH_PAYLOAD 16
10
11
12
13
14
15
16
17
18
19
20
21
22 enum rpmh_state {
23 RPMH_SLEEP_STATE,
24 RPMH_WAKE_ONLY_STATE,
25 RPMH_ACTIVE_ONLY_STATE,
26 };
27
28
29
30
31
32
33
34
35 struct tcs_cmd {
36 u32 addr;
37 u32 data;
38 u32 wait;
39 };
40
41
42
43
44
45
46
47
48
49 struct tcs_request {
50 enum rpmh_state state;
51 u32 wait_for_compl;
52 u32 num_cmds;
53 struct tcs_cmd *cmds;
54 };
55
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
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
74 #endif