msm_adsp.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* include/linux/msm_adsp.h
  2. *
  3. * Copyright (C) 2007 Google, Inc.
  4. * Author: Iliyan Malchev <ibm@android.com>
  5. *
  6. * This software is licensed under the terms of the GNU General Public
  7. * License version 2, as published by the Free Software Foundation, and
  8. * may be copied, distributed, and modified under those terms.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. */
  16. #ifndef __LINUX_MSM_ADSP_H
  17. #define __LINUX_MSM_ADSP_H
  18. #include <linux/types.h>
  19. #include <linux/ioctl.h>
  20. #define ADSP_IOCTL_MAGIC 'q'
  21. /* ADSP_IOCTL_WRITE_COMMAND */
  22. struct adsp_command_t {
  23. uint16_t queue;
  24. uint32_t len; /* bytes */
  25. uint8_t *data;
  26. };
  27. /* ADSP_IOCTL_GET_EVENT */
  28. struct adsp_event_t {
  29. uint16_t type; /* 1 == event (RPC), 0 == message (adsp) */
  30. uint32_t timeout_ms; /* -1 for infinite, 0 for immediate return */
  31. uint16_t msg_id;
  32. uint16_t flags; /* 1 == 16--bit event, 0 == 32-bit event */
  33. uint32_t len; /* size in, number of bytes out */
  34. uint8_t *data;
  35. };
  36. #define ADSP_IOCTL_ENABLE \
  37. _IOR(ADSP_IOCTL_MAGIC, 1, unsigned)
  38. #define ADSP_IOCTL_DISABLE \
  39. _IOR(ADSP_IOCTL_MAGIC, 2, unsigned)
  40. #define ADSP_IOCTL_DISABLE_ACK \
  41. _IOR(ADSP_IOCTL_MAGIC, 3, unsigned)
  42. #define ADSP_IOCTL_WRITE_COMMAND \
  43. _IOR(ADSP_IOCTL_MAGIC, 4, struct adsp_command_t *)
  44. #define ADSP_IOCTL_GET_EVENT \
  45. _IOWR(ADSP_IOCTL_MAGIC, 5, struct adsp_event_data_t *)
  46. #define ADSP_IOCTL_SET_CLKRATE \
  47. _IOR(ADSP_IOCTL_MAGIC, 6, unsigned)
  48. #define ADSP_IOCTL_DISABLE_EVENT_RSP \
  49. _IOR(ADSP_IOCTL_MAGIC, 10, unsigned)
  50. #define ADSP_IOCTL_REGISTER_PMEM \
  51. _IOW(ADSP_IOCTL_MAGIC, 13, unsigned)
  52. #define ADSP_IOCTL_UNREGISTER_PMEM \
  53. _IOW(ADSP_IOCTL_MAGIC, 14, unsigned)
  54. /* Cause any further GET_EVENT ioctls to fail (-ENODEV)
  55. * until the device is closed and reopened. Useful for
  56. * terminating event dispatch threads
  57. */
  58. #define ADSP_IOCTL_ABORT_EVENT_READ \
  59. _IOW(ADSP_IOCTL_MAGIC, 15, unsigned)
  60. #define ADSP_IOCTL_LINK_TASK \
  61. _IOW(ADSP_IOCTL_MAGIC, 16, unsigned)
  62. #endif