audio_ssr.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* Copyright (c) 2016, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #ifndef __AUDIO_SSR_H_
  14. #define __AUDIO_SSR_H_
  15. enum {
  16. AUDIO_SSR_DOMAIN_ADSP,
  17. AUDIO_SSR_DOMAIN_MODEM,
  18. AUDIO_SSR_DOMAIN_MAX
  19. };
  20. #ifdef CONFIG_MSM_QDSP6_SSR
  21. /*
  22. * Use audio_ssr_register to register with the SSR subsystem
  23. *
  24. * domain_id - Service to use, example: AUDIO_SSR_DOMAIN_ADSP
  25. * *nb - Pointer to a notifier block. Provide a callback function
  26. * to be notified of an event for that service. The ioctls
  27. * used by the callback are defined in subsystem_notif.h.
  28. *
  29. * Returns: Success: Client handle
  30. * Failure: Pointer error code
  31. */
  32. void *audio_ssr_register(int domain_id, struct notifier_block *nb);
  33. /*
  34. * Use audio_ssr_deregister to register with the SSR subsystem
  35. *
  36. * handle - Handle received from audio_ssr_register
  37. * *nb - Pointer to a notifier block. Callback function
  38. * Used from audio_ssr_register.
  39. *
  40. * Returns: Success: 0
  41. * Failure: Error code
  42. */
  43. int audio_ssr_deregister(void *handle, struct notifier_block *nb);
  44. /*
  45. * Use audio_ssr_send_nmi to force a RAM dump on ADSP
  46. * down event.
  47. *
  48. * *ssr_cb_data - *data received from notifier callback
  49. */
  50. void audio_ssr_send_nmi(void *ssr_cb_data);
  51. #else
  52. static inline void *audio_ssr_register(int domain_id,
  53. struct notifier_block *nb)
  54. {
  55. return NULL;
  56. }
  57. static inline int audio_ssr_deregister(void *handle, struct notifier_block *nb)
  58. {
  59. return 0;
  60. }
  61. static inline void audio_ssr_send_nmi(void *ssr_cb_data)
  62. {
  63. }
  64. #endif /* CONFIG_MSM_QDSP6_SSR */
  65. #endif