apr_v3.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #include <linux/types.h>
  14. #include <linux/uaccess.h>
  15. #include <linux/spinlock.h>
  16. #include <linux/kernel.h>
  17. #include <linux/qdsp6v2/apr.h>
  18. #include <linux/qdsp6v2/apr_tal.h>
  19. #include <linux/qdsp6v2/dsp_debug.h>
  20. #include <linux/qdsp6v2/audio_notifier.h>
  21. #define DEST_ID APR_DEST_MODEM
  22. enum apr_subsys_state apr_get_subsys_state(void)
  23. {
  24. return apr_get_modem_state();
  25. }
  26. void apr_set_subsys_state(void)
  27. {
  28. apr_set_modem_state(APR_SUBSYS_DOWN);
  29. }
  30. uint16_t apr_get_data_src(struct apr_hdr *hdr)
  31. {
  32. return DEST_ID;
  33. }
  34. int apr_get_dest_id(char *dest)
  35. {
  36. return DEST_ID;
  37. }
  38. void subsys_notif_register(char *client_name, int domain,
  39. struct notifier_block *nb)
  40. {
  41. int ret;
  42. if (domain != AUDIO_NOTIFIER_MODEM_DOMAIN) {
  43. pr_debug("%s: Unused domain %d not registering with notifier\n",
  44. __func__, domain);
  45. return;
  46. }
  47. ret = audio_notifier_register(client_name, domain, nb);
  48. if (ret < 0)
  49. pr_err("%s: Audio notifier register failed for domain %d ret = %d\n",
  50. __func__, domain, ret);
  51. }
  52. uint16_t apr_get_reset_domain(uint16_t proc)
  53. {
  54. return APR_DEST_QDSP6;
  55. }