diff options
Diffstat (limited to 'arch/x86/platform/intel/iosf_mbi.c')
-rw-r--r-- | arch/x86/platform/intel/iosf_mbi.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/x86/platform/intel/iosf_mbi.c b/arch/x86/platform/intel/iosf_mbi.c index a952ac199741..6f37a2137a79 100644 --- a/arch/x86/platform/intel/iosf_mbi.c +++ b/arch/x86/platform/intel/iosf_mbi.c | |||
@@ -218,14 +218,23 @@ int iosf_mbi_register_pmic_bus_access_notifier(struct notifier_block *nb) | |||
218 | } | 218 | } |
219 | EXPORT_SYMBOL(iosf_mbi_register_pmic_bus_access_notifier); | 219 | EXPORT_SYMBOL(iosf_mbi_register_pmic_bus_access_notifier); |
220 | 220 | ||
221 | int iosf_mbi_unregister_pmic_bus_access_notifier_unlocked( | ||
222 | struct notifier_block *nb) | ||
223 | { | ||
224 | iosf_mbi_assert_punit_acquired(); | ||
225 | |||
226 | return blocking_notifier_chain_unregister( | ||
227 | &iosf_mbi_pmic_bus_access_notifier, nb); | ||
228 | } | ||
229 | EXPORT_SYMBOL(iosf_mbi_unregister_pmic_bus_access_notifier_unlocked); | ||
230 | |||
221 | int iosf_mbi_unregister_pmic_bus_access_notifier(struct notifier_block *nb) | 231 | int iosf_mbi_unregister_pmic_bus_access_notifier(struct notifier_block *nb) |
222 | { | 232 | { |
223 | int ret; | 233 | int ret; |
224 | 234 | ||
225 | /* Wait for the bus to go inactive before unregistering */ | 235 | /* Wait for the bus to go inactive before unregistering */ |
226 | mutex_lock(&iosf_mbi_punit_mutex); | 236 | mutex_lock(&iosf_mbi_punit_mutex); |
227 | ret = blocking_notifier_chain_unregister( | 237 | ret = iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(nb); |
228 | &iosf_mbi_pmic_bus_access_notifier, nb); | ||
229 | mutex_unlock(&iosf_mbi_punit_mutex); | 238 | mutex_unlock(&iosf_mbi_punit_mutex); |
230 | 239 | ||
231 | return ret; | 240 | return ret; |
@@ -239,6 +248,12 @@ int iosf_mbi_call_pmic_bus_access_notifier_chain(unsigned long val, void *v) | |||
239 | } | 248 | } |
240 | EXPORT_SYMBOL(iosf_mbi_call_pmic_bus_access_notifier_chain); | 249 | EXPORT_SYMBOL(iosf_mbi_call_pmic_bus_access_notifier_chain); |
241 | 250 | ||
251 | void iosf_mbi_assert_punit_acquired(void) | ||
252 | { | ||
253 | WARN_ON(!mutex_is_locked(&iosf_mbi_punit_mutex)); | ||
254 | } | ||
255 | EXPORT_SYMBOL(iosf_mbi_assert_punit_acquired); | ||
256 | |||
242 | #ifdef CONFIG_IOSF_MBI_DEBUG | 257 | #ifdef CONFIG_IOSF_MBI_DEBUG |
243 | static u32 dbg_mdr; | 258 | static u32 dbg_mdr; |
244 | static u32 dbg_mcr; | 259 | static u32 dbg_mcr; |