apr_v3.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2013-2016, 2019 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. /**
  14. * apr_get_subsys_state - get modem subsys status
  15. *
  16. * Returns apr_subsys_state
  17. */
  18. enum apr_subsys_state apr_get_subsys_state(void)
  19. {
  20. return apr_get_modem_state();
  21. }
  22. EXPORT_SYMBOL(apr_get_subsys_state);
  23. void apr_set_subsys_state(void)
  24. {
  25. apr_set_modem_state(APR_SUBSYS_DOWN);
  26. }
  27. uint16_t apr_get_data_src(struct apr_hdr *hdr)
  28. {
  29. return DEST_ID;
  30. }
  31. int apr_get_dest_id(char *dest)
  32. {
  33. return DEST_ID;
  34. }
  35. void subsys_notif_register(char *client_name, int domain,
  36. struct notifier_block *nb)
  37. {
  38. int ret;
  39. if (domain != AUDIO_NOTIFIER_MODEM_DOMAIN) {
  40. pr_debug("%s: Unused domain %d not registering with notifier\n",
  41. __func__, domain);
  42. return;
  43. }
  44. ret = audio_notifier_register(client_name, domain, nb);
  45. if (ret < 0)
  46. pr_err("%s: Audio notifier register failed for domain %d ret = %d\n",
  47. __func__, domain, ret);
  48. }
  49. void subsys_notif_deregister(char *client_name)
  50. {
  51. int ret;
  52. ret = audio_notifier_deregister(client_name);
  53. if (ret < 0)
  54. pr_err("%s: Audio notifier de-register failed for client %s\n",
  55. __func__, client_name);
  56. }
  57. uint16_t apr_get_reset_domain(uint16_t proc)
  58. {
  59. return APR_DEST_QDSP6;
  60. }