audio_ssr.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2016, 2020 The Linux Foundation. All rights reserved.
  4. */
  5. #include <linux/module.h>
  6. #include <linux/remoteproc.h>
  7. #include <linux/remoteproc/qcom_rproc.h>
  8. #include "audio_ssr.h"
  9. /**
  10. * audio_ssr_register -
  11. * register to SSR framework
  12. *
  13. * @domain_id: Domain ID to register with
  14. * @nb: notifier block
  15. *
  16. * Returns handle pointer on success or error PTR on failure
  17. */
  18. void *audio_ssr_register(const char *domain_name, struct notifier_block *nb)
  19. {
  20. if (domain_name == NULL) {
  21. pr_err("%s: Invalid domain name\n", __func__);
  22. return ERR_PTR(-EINVAL);
  23. }
  24. return qcom_register_ssr_notifier(domain_name, nb);
  25. }
  26. EXPORT_SYMBOL(audio_ssr_register);
  27. /**
  28. * audio_ssr_deregister -
  29. * Deregister handle from SSR framework
  30. *
  31. * @handle: SSR handle
  32. * @nb: notifier block
  33. *
  34. * Returns 0 on success or error on failure
  35. */
  36. int audio_ssr_deregister(void *handle, struct notifier_block *nb)
  37. {
  38. return qcom_unregister_ssr_notifier(handle, nb);
  39. }
  40. EXPORT_SYMBOL(audio_ssr_deregister);