790-bus-mhi-core-add-SBL-state-callback.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From 5f7c5e1c0d7a79be144e5efc1f24728ddd7fc25c Mon Sep 17 00:00:00 2001
  2. From: Robert Marko <[email protected]>
  3. Date: Sat, 5 Nov 2022 20:02:56 +0100
  4. Subject: [PATCH 1/2] bus: mhi: core: add SBL state callback
  5. Add support for SBL state callback in MHI core.
  6. It is required for ath11k MHI devices in order to be able to set QRTR
  7. instance ID in the SBL state so that QRTR instance ID-s dont conflict in
  8. case of multiple PCI/MHI cards or AHB + PCI/MHI card.
  9. Setting QRTR instance ID is only possible in SBL state and there is
  10. currently no way to ensure that we are in that state, so provide a
  11. callback that the controller can trigger off.
  12. Signed-off-by: Robert Marko <[email protected]>
  13. ---
  14. drivers/bus/mhi/host/main.c | 1 +
  15. include/linux/mhi.h | 2 ++
  16. 2 files changed, 3 insertions(+)
  17. --- a/drivers/bus/mhi/host/main.c
  18. +++ b/drivers/bus/mhi/host/main.c
  19. @@ -906,6 +906,7 @@ int mhi_process_ctrl_ev_ring(struct mhi_
  20. switch (event) {
  21. case MHI_EE_SBL:
  22. st = DEV_ST_TRANSITION_SBL;
  23. + mhi_cntrl->status_cb(mhi_cntrl, MHI_CB_EE_SBL_MODE);
  24. break;
  25. case MHI_EE_WFW:
  26. case MHI_EE_AMSS:
  27. --- a/include/linux/mhi.h
  28. +++ b/include/linux/mhi.h
  29. @@ -34,6 +34,7 @@ struct mhi_buf_info;
  30. * @MHI_CB_SYS_ERROR: MHI device entered error state (may recover)
  31. * @MHI_CB_FATAL_ERROR: MHI device entered fatal error state
  32. * @MHI_CB_BW_REQ: Received a bandwidth switch request from device
  33. + * @MHI_CB_EE_SBL_MODE: MHI device entered SBL mode
  34. */
  35. enum mhi_callback {
  36. MHI_CB_IDLE,
  37. @@ -45,6 +46,7 @@ enum mhi_callback {
  38. MHI_CB_SYS_ERROR,
  39. MHI_CB_FATAL_ERROR,
  40. MHI_CB_BW_REQ,
  41. + MHI_CB_EE_SBL_MODE,
  42. };
  43. /**