hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/x86/include/asm/iosf_mbi.h
....@@ -39,6 +39,7 @@
3939 #define BT_MBI_UNIT_PMC 0x04
4040 #define BT_MBI_UNIT_GFX 0x06
4141 #define BT_MBI_UNIT_SMI 0x0C
42
+#define BT_MBI_UNIT_CCK 0x14
4243 #define BT_MBI_UNIT_USB 0x43
4344 #define BT_MBI_UNIT_SATA 0xA3
4445 #define BT_MBI_UNIT_PCIE 0xA6
....@@ -105,8 +106,10 @@
105106 * the PMIC bus while another driver is also accessing the PMIC bus various bad
106107 * things happen.
107108 *
108
- * To avoid these problems this function must be called before accessing the
109
- * P-Unit or the PMIC, be it through iosf_mbi* functions or through other means.
109
+ * Call this function before sending requests to the P-Unit which may make it
110
+ * access the PMIC, be it through iosf_mbi* functions or through other means.
111
+ * This function will block all kernel access to the PMIC I2C bus, so that the
112
+ * P-Unit can safely access the PMIC over the shared I2C bus.
110113 *
111114 * Note on these systems the i2c-bus driver will request a sempahore from the
112115 * P-Unit for exclusive access to the PMIC bus when i2c drivers are accessing
....@@ -121,6 +124,31 @@
121124 * iosf_mbi_punit_release() - Release access to the P-Unit
122125 */
123126 void iosf_mbi_punit_release(void);
127
+
128
+/**
129
+ * iosf_mbi_block_punit_i2c_access() - Block P-Unit accesses to the PMIC bus
130
+ *
131
+ * Call this function to block P-Unit access to the PMIC I2C bus, so that the
132
+ * kernel can safely access the PMIC over the shared I2C bus.
133
+ *
134
+ * This function acquires the P-Unit bus semaphore and notifies
135
+ * pmic_bus_access_notifier listeners that they may no longer access the
136
+ * P-Unit in a way which may cause it to access the shared I2C bus.
137
+ *
138
+ * Note this function may be called multiple times and the bus will not
139
+ * be released until iosf_mbi_unblock_punit_i2c_access() has been called the
140
+ * same amount of times.
141
+ *
142
+ * Return: Nonzero on error
143
+ */
144
+int iosf_mbi_block_punit_i2c_access(void);
145
+
146
+/*
147
+ * iosf_mbi_unblock_punit_i2c_access() - Release PMIC I2C bus block
148
+ *
149
+ * Release i2c access block gotten through iosf_mbi_block_punit_i2c_access().
150
+ */
151
+void iosf_mbi_unblock_punit_i2c_access(void);
124152
125153 /**
126154 * iosf_mbi_register_pmic_bus_access_notifier - Register PMIC bus notifier
....@@ -157,14 +185,6 @@
157185 */
158186 int iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(
159187 struct notifier_block *nb);
160
-
161
-/**
162
- * iosf_mbi_call_pmic_bus_access_notifier_chain - Call PMIC bus notifier chain
163
- *
164
- * @val: action to pass into listener's notifier_call function
165
- * @v: data pointer to pass into listener's notifier_call function
166
- */
167
-int iosf_mbi_call_pmic_bus_access_notifier_chain(unsigned long val, void *v);
168188
169189 /**
170190 * iosf_mbi_assert_punit_acquired - Assert that the P-Unit has been acquired.