audio_ssr.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2016, 2020 The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __AUDIO_SSR_H_
  6. #define __AUDIO_SSR_H_
  7. enum {
  8. AUDIO_SSR_DOMAIN_ADSP,
  9. AUDIO_SSR_DOMAIN_MODEM,
  10. AUDIO_SSR_DOMAIN_MAX
  11. };
  12. #ifdef CONFIG_MSM_QDSP6_SSR
  13. /*
  14. * Use audio_ssr_register to register with the SSR subsystem
  15. *
  16. * domain_id - Service to use, example: AUDIO_SSR_DOMAIN_ADSP
  17. * *nb - Pointer to a notifier block. Provide a callback function
  18. * to be notified of an event for that service. The ioctls
  19. * used by the callback are defined in subsystem_notif.h.
  20. *
  21. * Returns: Success: Client handle
  22. * Failure: Pointer error code
  23. */
  24. void *audio_ssr_register(const char *domain_name, struct notifier_block *nb);
  25. /*
  26. * Use audio_ssr_deregister to register with the SSR subsystem
  27. *
  28. * handle - Handle received from audio_ssr_register
  29. * *nb - Pointer to a notifier block. Callback function
  30. * Used from audio_ssr_register.
  31. *
  32. * Returns: Success: 0
  33. * Failure: Error code
  34. */
  35. int audio_ssr_deregister(void *handle, struct notifier_block *nb);
  36. /*
  37. * Use audio_ssr_send_nmi to force a RAM dump on ADSP
  38. * down event.
  39. *
  40. * *ssr_cb_data - *data received from notifier callback
  41. */
  42. void audio_ssr_send_nmi(void *ssr_cb_data);
  43. #else
  44. static inline void *audio_ssr_register(int domain_id,
  45. struct notifier_block *nb)
  46. {
  47. return NULL;
  48. }
  49. static inline int audio_ssr_deregister(void *handle, struct notifier_block *nb)
  50. {
  51. return 0;
  52. }
  53. static inline void audio_ssr_send_nmi(void *ssr_cb_data)
  54. {
  55. }
  56. #endif /* CONFIG_MSM_QDSP6_SSR */
  57. #endif