audio_pdr.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2016-2018, 2020 The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __AUDIO_PDR_H_
  6. #define __AUDIO_PDR_H_
  7. #include <linux/soc/qcom/pdr.h>
  8. enum {
  9. AUDIO_PDR_DOMAIN_ADSP,
  10. AUDIO_PDR_DOMAIN_MAX
  11. };
  12. #ifdef CONFIG_MSM_QDSP6_PDR
  13. /*
  14. * Use audio_pdr_service_register to register with a PDR service
  15. * Function should be called after nb callback registered with
  16. * audio_pdr_register has been called back with the
  17. * AUDIO_PDR_FRAMEWORK_UP ioctl.
  18. *
  19. * domain_id - Domain to use, example: AUDIO_PDR_ADSP
  20. * *cb - Pointer to a callback function that will be notified of the state
  21. * of the domain requested. The ioctls received by the callback are
  22. * defined in pdr.h.
  23. *
  24. * Returns: Success: Client handle
  25. * Failure: Pointer error code
  26. */
  27. void *audio_pdr_service_register(int domain_id, void (*cb)(int, char *, void *));
  28. /*
  29. * Use audio_pdr_service_deregister to deregister with a PDR
  30. * service that was registered using the audio_pdr_service_register
  31. * API.
  32. *
  33. * domain_id - Domain to use, example: AUDIO_PDR_ADSP
  34. *
  35. * Returns: Success: zero
  36. * Failure: Error code
  37. */
  38. int audio_pdr_service_deregister(int domain_id);
  39. #else
  40. static inline void *audio_pdr_service_register(int domain_id, void (*cb)(int, char *, void *))
  41. {
  42. return NULL;
  43. }
  44. static inline int audio_pdr_service_deregister(int domain_id)
  45. {
  46. return 0;
  47. }
  48. #endif /* CONFIG_MSM_QDSP6_PDR */
  49. #endif