msm_mercury.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #ifndef __LINUX_MSM_MERCURY_H
  2. #define __LINUX_MSM_MERCURY_H
  3. #include <linux/types.h>
  4. #include <linux/ioctl.h>
  5. #define MSM_MERCURY_HW_VERSION_REG 0x0004/* this offset does not exist in HW*/
  6. #define OUTPUT_H2V1 0
  7. #define OUTPUT_H2V2 1
  8. #define OUTPUT_BYTE 6
  9. #define MSM_MERCURY_MODE_REALTIME_ENCODE 0
  10. #define MSM_MERCURY_MODE_OFFLINE_ENCODE 1
  11. #define MSM_MERCURY_MODE_REALTIME_ROTATION 2
  12. #define MSM_MERCURY_MODE_OFFLINE_ROTATION 3
  13. #define MSM_MERCURY_EVT_RESET 1
  14. #define MSM_MERCURY_EVT_FRAMEDONE 2
  15. #define MSM_MERCURY_EVT_ERR 3
  16. #define MSM_MERCURY_EVT_UNBLOCK 4
  17. #define MSM_MERCURY_HW_CMD_TYPE_READ 0
  18. #define MSM_MERCURY_HW_CMD_TYPE_WRITE 1
  19. #define MSM_MERCURY_HW_CMD_TYPE_WRITE_OR 2
  20. #define MSM_MERCURY_HW_CMD_TYPE_UWAIT 3
  21. #define MSM_MERCURY_HW_CMD_TYPE_MWAIT 4
  22. #define MSM_MERCURY_HW_CMD_TYPE_MDELAY 5
  23. #define MSM_MERCURY_HW_CMD_TYPE_UDELAY 6
  24. #define MSM_MCR_IOCTL_MAGIC 'g'
  25. #define MSM_MCR_IOCTL_GET_HW_VERSION \
  26. _IOW(MSM_MCR_IOCTL_MAGIC, 1, struct msm_mercury_hw_cmd *)
  27. #define MSM_MCR_IOCTL_RESET \
  28. _IOW(MSM_MCR_IOCTL_MAGIC, 2, struct msm_mercury_ctrl_cmd *)
  29. #define MSM_MCR_IOCTL_STOP \
  30. _IOW(MSM_MCR_IOCTL_MAGIC, 3, struct msm_mercury_hw_cmds *)
  31. #define MSM_MCR_IOCTL_START \
  32. _IOW(MSM_MCR_IOCTL_MAGIC, 4, struct msm_mercury_hw_cmds *)
  33. #define MSM_MCR_IOCTL_INPUT_BUF_CFG \
  34. _IOW(MSM_MCR_IOCTL_MAGIC, 5, struct msm_mercury_buf *)
  35. #define MSM_MCR_IOCTL_INPUT_GET \
  36. _IOW(MSM_MCR_IOCTL_MAGIC, 6, struct msm_mercury_buf *)
  37. #define MSM_MCR_IOCTL_INPUT_GET_UNBLOCK \
  38. _IOW(MSM_MCR_IOCTL_MAGIC, 7, int)
  39. #define MSM_MCR_IOCTL_OUTPUT_BUF_CFG \
  40. _IOW(MSM_MCR_IOCTL_MAGIC, 8, struct msm_mercury_buf *)
  41. #define MSM_MCR_IOCTL_OUTPUT_GET \
  42. _IOW(MSM_MCR_IOCTL_MAGIC, 9, struct msm_mercury_buf *)
  43. #define MSM_MCR_IOCTL_OUTPUT_GET_UNBLOCK \
  44. _IOW(MSM_MCR_IOCTL_MAGIC, 10, int)
  45. #define MSM_MCR_IOCTL_EVT_GET \
  46. _IOW(MSM_MCR_IOCTL_MAGIC, 11, struct msm_mercury_ctrl_cmd *)
  47. #define MSM_MCR_IOCTL_EVT_GET_UNBLOCK \
  48. _IOW(MSM_MCR_IOCTL_MAGIC, 12, int)
  49. #define MSM_MCR_IOCTL_HW_CMD \
  50. _IOW(MSM_MCR_IOCTL_MAGIC, 13, struct msm_mercury_hw_cmd *)
  51. #define MSM_MCR_IOCTL_HW_CMDS \
  52. _IOW(MSM_MCR_IOCTL_MAGIC, 14, struct msm_mercury_hw_cmds *)
  53. #define MSM_MCR_IOCTL_TEST_DUMP_REGION \
  54. _IOW(MSM_MCR_IOCTL_MAGIC, 15, unsigned long)
  55. struct msm_mercury_ctrl_cmd {
  56. uint32_t type;
  57. uint32_t len;
  58. void *value;
  59. };
  60. struct msm_mercury_buf {
  61. uint32_t type;
  62. int fd;
  63. void *vaddr;
  64. uint32_t y_off;
  65. uint32_t y_len;
  66. uint32_t framedone_len;
  67. uint32_t cbcr_off;
  68. uint32_t cbcr_len;
  69. uint32_t num_of_mcu_rows;
  70. uint32_t offset;
  71. };
  72. struct msm_mercury_hw_cmd {
  73. uint32_t type:4;
  74. /* n microseconds of timeout for WAIT */
  75. /* n microseconds of time for DELAY */
  76. /* repeat n times for READ/WRITE */
  77. /* max is 0xFFF, 4095 */
  78. uint32_t n:12;
  79. uint32_t offset:16;
  80. uint32_t mask;
  81. union {
  82. /* for single READ/WRITE/WAIT, n = 1 */
  83. uint32_t data;
  84. uint32_t *pdata;/* for multiple READ/WRITE/WAIT, n > 1 */
  85. };
  86. };
  87. struct msm_mercury_hw_cmds {
  88. uint32_t m; /* number of elements in the hw_cmd array */
  89. struct msm_mercury_hw_cmd hw_cmd[1];
  90. };
  91. #endif /* __LINUX_MSM_MERCURY_H */