Lines Matching refs:ab_pci
251 static int ath12k_mhi_get_msi(struct ath12k_pci *ab_pci) in ath12k_mhi_get_msi() argument
253 struct ath12k_base *ab = ab_pci->ab; in ath12k_mhi_get_msi()
275 ab_pci->mhi_ctrl->irq = irq; in ath12k_mhi_get_msi()
276 ab_pci->mhi_ctrl->nr_irqs = num_vectors; in ath12k_mhi_get_msi()
353 int ath12k_mhi_register(struct ath12k_pci *ab_pci) in ath12k_mhi_register() argument
355 struct ath12k_base *ab = ab_pci->ab; in ath12k_mhi_register()
364 ab_pci->amss_path, in ath12k_mhi_register()
365 sizeof(ab_pci->amss_path)); in ath12k_mhi_register()
367 ab_pci->mhi_ctrl = mhi_ctrl; in ath12k_mhi_register()
369 mhi_ctrl->fw_image = ab_pci->amss_path; in ath12k_mhi_register()
373 ret = ath12k_mhi_get_msi(ab_pci); in ath12k_mhi_register()
401 void ath12k_mhi_unregister(struct ath12k_pci *ab_pci) in ath12k_mhi_unregister() argument
403 struct mhi_controller *mhi_ctrl = ab_pci->mhi_ctrl; in ath12k_mhi_unregister()
408 ab_pci->mhi_ctrl = NULL; in ath12k_mhi_unregister()
437 static void ath12k_mhi_set_state_bit(struct ath12k_pci *ab_pci, in ath12k_mhi_set_state_bit() argument
440 struct ath12k_base *ab = ab_pci->ab; in ath12k_mhi_set_state_bit()
444 set_bit(ATH12K_MHI_INIT, &ab_pci->mhi_state); in ath12k_mhi_set_state_bit()
447 clear_bit(ATH12K_MHI_INIT, &ab_pci->mhi_state); in ath12k_mhi_set_state_bit()
450 set_bit(ATH12K_MHI_POWER_ON, &ab_pci->mhi_state); in ath12k_mhi_set_state_bit()
454 clear_bit(ATH12K_MHI_POWER_ON, &ab_pci->mhi_state); in ath12k_mhi_set_state_bit()
455 clear_bit(ATH12K_MHI_TRIGGER_RDDM, &ab_pci->mhi_state); in ath12k_mhi_set_state_bit()
456 clear_bit(ATH12K_MHI_RDDM_DONE, &ab_pci->mhi_state); in ath12k_mhi_set_state_bit()
459 set_bit(ATH12K_MHI_SUSPEND, &ab_pci->mhi_state); in ath12k_mhi_set_state_bit()
462 clear_bit(ATH12K_MHI_SUSPEND, &ab_pci->mhi_state); in ath12k_mhi_set_state_bit()
465 set_bit(ATH12K_MHI_TRIGGER_RDDM, &ab_pci->mhi_state); in ath12k_mhi_set_state_bit()
468 set_bit(ATH12K_MHI_RDDM_DONE, &ab_pci->mhi_state); in ath12k_mhi_set_state_bit()
475 static int ath12k_mhi_check_state_bit(struct ath12k_pci *ab_pci, in ath12k_mhi_check_state_bit() argument
478 struct ath12k_base *ab = ab_pci->ab; in ath12k_mhi_check_state_bit()
482 if (!test_bit(ATH12K_MHI_INIT, &ab_pci->mhi_state)) in ath12k_mhi_check_state_bit()
487 if (test_bit(ATH12K_MHI_INIT, &ab_pci->mhi_state) && in ath12k_mhi_check_state_bit()
488 !test_bit(ATH12K_MHI_POWER_ON, &ab_pci->mhi_state)) in ath12k_mhi_check_state_bit()
492 if (test_bit(ATH12K_MHI_POWER_ON, &ab_pci->mhi_state)) in ath12k_mhi_check_state_bit()
497 if (test_bit(ATH12K_MHI_POWER_ON, &ab_pci->mhi_state) && in ath12k_mhi_check_state_bit()
498 !test_bit(ATH12K_MHI_SUSPEND, &ab_pci->mhi_state)) in ath12k_mhi_check_state_bit()
502 if (test_bit(ATH12K_MHI_SUSPEND, &ab_pci->mhi_state)) in ath12k_mhi_check_state_bit()
506 if (test_bit(ATH12K_MHI_POWER_ON, &ab_pci->mhi_state) && in ath12k_mhi_check_state_bit()
507 !test_bit(ATH12K_MHI_TRIGGER_RDDM, &ab_pci->mhi_state)) in ath12k_mhi_check_state_bit()
519 ab_pci->mhi_state); in ath12k_mhi_check_state_bit()
524 static int ath12k_mhi_set_state(struct ath12k_pci *ab_pci, in ath12k_mhi_set_state() argument
527 struct ath12k_base *ab = ab_pci->ab; in ath12k_mhi_set_state()
530 ret = ath12k_mhi_check_state_bit(ab_pci, mhi_state); in ath12k_mhi_set_state()
539 ret = mhi_prepare_for_power_up(ab_pci->mhi_ctrl); in ath12k_mhi_set_state()
542 mhi_unprepare_after_power_down(ab_pci->mhi_ctrl); in ath12k_mhi_set_state()
546 ret = mhi_async_power_up(ab_pci->mhi_ctrl); in ath12k_mhi_set_state()
549 mhi_power_down(ab_pci->mhi_ctrl, true); in ath12k_mhi_set_state()
553 mhi_power_down(ab_pci->mhi_ctrl, false); in ath12k_mhi_set_state()
557 ret = mhi_pm_suspend(ab_pci->mhi_ctrl); in ath12k_mhi_set_state()
560 ret = mhi_pm_resume(ab_pci->mhi_ctrl); in ath12k_mhi_set_state()
563 ret = mhi_force_rddm_mode(ab_pci->mhi_ctrl); in ath12k_mhi_set_state()
575 ath12k_mhi_set_state_bit(ab_pci, mhi_state); in ath12k_mhi_set_state()
585 int ath12k_mhi_start(struct ath12k_pci *ab_pci) in ath12k_mhi_start() argument
589 ab_pci->mhi_ctrl->timeout_ms = MHI_TIMEOUT_DEFAULT_MS; in ath12k_mhi_start()
591 ret = ath12k_mhi_set_state(ab_pci, ATH12K_MHI_INIT); in ath12k_mhi_start()
595 ret = ath12k_mhi_set_state(ab_pci, ATH12K_MHI_POWER_ON); in ath12k_mhi_start()
605 void ath12k_mhi_stop(struct ath12k_pci *ab_pci) in ath12k_mhi_stop() argument
607 ath12k_mhi_set_state(ab_pci, ATH12K_MHI_POWER_OFF); in ath12k_mhi_stop()
608 ath12k_mhi_set_state(ab_pci, ATH12K_MHI_DEINIT); in ath12k_mhi_stop()
611 void ath12k_mhi_suspend(struct ath12k_pci *ab_pci) in ath12k_mhi_suspend() argument
613 ath12k_mhi_set_state(ab_pci, ATH12K_MHI_SUSPEND); in ath12k_mhi_suspend()
616 void ath12k_mhi_resume(struct ath12k_pci *ab_pci) in ath12k_mhi_resume() argument
618 ath12k_mhi_set_state(ab_pci, ATH12K_MHI_RESUME); in ath12k_mhi_resume()