apr_v3.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
  4. */
  5. #include <linux/types.h>
  6. #include <linux/uaccess.h>
  7. #include <linux/spinlock.h>
  8. #include <linux/kernel.h>
  9. #include <dsp/audio_notifier.h>
  10. #include <ipc/apr.h>
  11. #include <ipc/apr_tal.h>
  12. #define DEST_ID APR_DEST_MODEM
  13. enum apr_subsys_state apr_get_subsys_state(void)
  14. {
  15. return apr_get_modem_state();
  16. }
  17. void apr_set_subsys_state(void)
  18. {
  19. apr_set_modem_state(APR_SUBSYS_DOWN);
  20. }
  21. uint16_t apr_get_data_src(struct apr_hdr *hdr)
  22. {
  23. return DEST_ID;
  24. }
  25. int apr_get_dest_id(char *dest)
  26. {
  27. return DEST_ID;
  28. }
  29. void subsys_notif_register(char *client_name, int domain,
  30. struct notifier_block *nb)
  31. {
  32. int ret;
  33. if (domain != AUDIO_NOTIFIER_MODEM_DOMAIN) {
  34. pr_debug("%s: Unused domain %d not registering with notifier\n",
  35. __func__, domain);
  36. return;
  37. }
  38. ret = audio_notifier_register(client_name, domain, nb);
  39. if (ret < 0)
  40. pr_err("%s: Audio notifier register failed for domain %d ret = %d\n",
  41. __func__, domain, ret);
  42. }
  43. void subsys_notif_deregister(char *client_name)
  44. {
  45. int ret;
  46. ret = audio_notifier_deregister(client_name);
  47. if (ret < 0)
  48. pr_err("%s: Audio notifier de-register failed for client %s\n",
  49. __func__, client_name);
  50. }
  51. uint16_t apr_get_reset_domain(uint16_t proc)
  52. {
  53. return APR_DEST_QDSP6;
  54. }