This source file includes following definitions.
- iosf_mbi_available
- iosf_mbi_read
- iosf_mbi_write
- iosf_mbi_modify
- iosf_mbi_punit_acquire
- iosf_mbi_punit_release
- iosf_mbi_register_pmic_bus_access_notifier
- iosf_mbi_unregister_pmic_bus_access_notifier
- iosf_mbi_unregister_pmic_bus_access_notifier_unlocked
- iosf_mbi_call_pmic_bus_access_notifier_chain
- iosf_mbi_assert_punit_acquired
1
2
3
4
5
6 #ifndef IOSF_MBI_SYMS_H
7 #define IOSF_MBI_SYMS_H
8
9 #include <linux/notifier.h>
10
11 #define MBI_MCR_OFFSET 0xD0
12 #define MBI_MDR_OFFSET 0xD4
13 #define MBI_MCRX_OFFSET 0xD8
14
15 #define MBI_RD_MASK 0xFEFFFFFF
16 #define MBI_WR_MASK 0X01000000
17
18 #define MBI_MASK_HI 0xFFFFFF00
19 #define MBI_MASK_LO 0x000000FF
20 #define MBI_ENABLE 0xF0
21
22
23 #define MBI_MMIO_READ 0x00
24 #define MBI_MMIO_WRITE 0x01
25 #define MBI_CFG_READ 0x04
26 #define MBI_CFG_WRITE 0x05
27 #define MBI_CR_READ 0x06
28 #define MBI_CR_WRITE 0x07
29 #define MBI_REG_READ 0x10
30 #define MBI_REG_WRITE 0x11
31 #define MBI_ESRAM_READ 0x12
32 #define MBI_ESRAM_WRITE 0x13
33
34
35 #define BT_MBI_UNIT_AUNIT 0x00
36 #define BT_MBI_UNIT_SMC 0x01
37 #define BT_MBI_UNIT_CPU 0x02
38 #define BT_MBI_UNIT_BUNIT 0x03
39 #define BT_MBI_UNIT_PMC 0x04
40 #define BT_MBI_UNIT_GFX 0x06
41 #define BT_MBI_UNIT_SMI 0x0C
42 #define BT_MBI_UNIT_USB 0x43
43 #define BT_MBI_UNIT_SATA 0xA3
44 #define BT_MBI_UNIT_PCIE 0xA6
45
46
47 #define QRK_MBI_UNIT_HBA 0x00
48 #define QRK_MBI_UNIT_HB 0x03
49 #define QRK_MBI_UNIT_RMU 0x04
50 #define QRK_MBI_UNIT_MM 0x05
51 #define QRK_MBI_UNIT_SOC 0x31
52
53
54 #define MBI_PMIC_BUS_ACCESS_BEGIN 1
55 #define MBI_PMIC_BUS_ACCESS_END 2
56
57 #if IS_ENABLED(CONFIG_IOSF_MBI)
58
59 bool iosf_mbi_available(void);
60
61
62
63
64
65
66
67
68
69
70
71 int iosf_mbi_read(u8 port, u8 opcode, u32 offset, u32 *mdr);
72
73
74
75
76
77
78
79
80
81
82
83 int iosf_mbi_write(u8 port, u8 opcode, u32 offset, u32 mdr);
84
85
86
87
88
89
90
91
92
93
94
95
96 int iosf_mbi_modify(u8 port, u8 opcode, u32 offset, u32 mdr, u32 mask);
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120 void iosf_mbi_punit_acquire(void);
121
122
123
124
125 void iosf_mbi_punit_release(void);
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143 int iosf_mbi_block_punit_i2c_access(void);
144
145
146
147
148
149
150 void iosf_mbi_unblock_punit_i2c_access(void);
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167 int iosf_mbi_register_pmic_bus_access_notifier(struct notifier_block *nb);
168
169
170
171
172
173
174 int iosf_mbi_unregister_pmic_bus_access_notifier(struct notifier_block *nb);
175
176
177
178
179
180
181
182
183
184
185 int iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(
186 struct notifier_block *nb);
187
188
189
190
191 void iosf_mbi_assert_punit_acquired(void);
192
193 #else
194 static inline
195 bool iosf_mbi_available(void)
196 {
197 return false;
198 }
199
200 static inline
201 int iosf_mbi_read(u8 port, u8 opcode, u32 offset, u32 *mdr)
202 {
203 WARN(1, "IOSF_MBI driver not available");
204 return -EPERM;
205 }
206
207 static inline
208 int iosf_mbi_write(u8 port, u8 opcode, u32 offset, u32 mdr)
209 {
210 WARN(1, "IOSF_MBI driver not available");
211 return -EPERM;
212 }
213
214 static inline
215 int iosf_mbi_modify(u8 port, u8 opcode, u32 offset, u32 mdr, u32 mask)
216 {
217 WARN(1, "IOSF_MBI driver not available");
218 return -EPERM;
219 }
220
221 static inline void iosf_mbi_punit_acquire(void) {}
222 static inline void iosf_mbi_punit_release(void) {}
223
224 static inline
225 int iosf_mbi_register_pmic_bus_access_notifier(struct notifier_block *nb)
226 {
227 return 0;
228 }
229
230 static inline
231 int iosf_mbi_unregister_pmic_bus_access_notifier(struct notifier_block *nb)
232 {
233 return 0;
234 }
235
236 static inline int
237 iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(struct notifier_block *nb)
238 {
239 return 0;
240 }
241
242 static inline
243 int iosf_mbi_call_pmic_bus_access_notifier_chain(unsigned long val, void *v)
244 {
245 return 0;
246 }
247
248 static inline void iosf_mbi_assert_punit_acquired(void) {}
249
250 #endif
251
252 #endif