msm_gemini.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. #ifndef __LINUX_MSM_GEMINI_H
  2. #define __LINUX_MSM_GEMINI_H
  3. #include <linux/types.h>
  4. #include <linux/ioctl.h>
  5. #define MSM_GMN_IOCTL_MAGIC 'g'
  6. #define MSM_GMN_IOCTL_GET_HW_VERSION \
  7. _IOW(MSM_GMN_IOCTL_MAGIC, 1, struct msm_gemini_hw_cmd *)
  8. #define MSM_GMN_IOCTL_RESET \
  9. _IOW(MSM_GMN_IOCTL_MAGIC, 2, struct msm_gemini_ctrl_cmd *)
  10. #define MSM_GMN_IOCTL_STOP \
  11. _IOW(MSM_GMN_IOCTL_MAGIC, 3, struct msm_gemini_hw_cmds *)
  12. #define MSM_GMN_IOCTL_START \
  13. _IOW(MSM_GMN_IOCTL_MAGIC, 4, struct msm_gemini_hw_cmds *)
  14. #define MSM_GMN_IOCTL_INPUT_BUF_ENQUEUE \
  15. _IOW(MSM_GMN_IOCTL_MAGIC, 5, struct msm_gemini_buf *)
  16. #define MSM_GMN_IOCTL_INPUT_GET \
  17. _IOW(MSM_GMN_IOCTL_MAGIC, 6, struct msm_gemini_buf *)
  18. #define MSM_GMN_IOCTL_INPUT_GET_UNBLOCK \
  19. _IOW(MSM_GMN_IOCTL_MAGIC, 7, int)
  20. #define MSM_GMN_IOCTL_OUTPUT_BUF_ENQUEUE \
  21. _IOW(MSM_GMN_IOCTL_MAGIC, 8, struct msm_gemini_buf *)
  22. #define MSM_GMN_IOCTL_OUTPUT_GET \
  23. _IOW(MSM_GMN_IOCTL_MAGIC, 9, struct msm_gemini_buf *)
  24. #define MSM_GMN_IOCTL_OUTPUT_GET_UNBLOCK \
  25. _IOW(MSM_GMN_IOCTL_MAGIC, 10, int)
  26. #define MSM_GMN_IOCTL_EVT_GET \
  27. _IOW(MSM_GMN_IOCTL_MAGIC, 11, struct msm_gemini_ctrl_cmd *)
  28. #define MSM_GMN_IOCTL_EVT_GET_UNBLOCK \
  29. _IOW(MSM_GMN_IOCTL_MAGIC, 12, int)
  30. #define MSM_GMN_IOCTL_HW_CMD \
  31. _IOW(MSM_GMN_IOCTL_MAGIC, 13, struct msm_gemini_hw_cmd *)
  32. #define MSM_GMN_IOCTL_HW_CMDS \
  33. _IOW(MSM_GMN_IOCTL_MAGIC, 14, struct msm_gemini_hw_cmds *)
  34. #define MSM_GMN_IOCTL_TEST_DUMP_REGION \
  35. _IOW(MSM_GMN_IOCTL_MAGIC, 15, unsigned long)
  36. #define MSM_GMN_IOCTL_SET_MODE \
  37. _IOW(MSM_GMN_IOCTL_MAGIC, 16, enum msm_gmn_out_mode)
  38. #define MSM_GEMINI_MODE_REALTIME_ENCODE 0
  39. #define MSM_GEMINI_MODE_OFFLINE_ENCODE 1
  40. #define MSM_GEMINI_MODE_REALTIME_ROTATION 2
  41. #define MSM_GEMINI_MODE_OFFLINE_ROTATION 3
  42. enum msm_gmn_out_mode {
  43. MSM_GMN_OUTMODE_FRAGMENTED,
  44. MSM_GMN_OUTMODE_SINGLE
  45. };
  46. struct msm_gemini_ctrl_cmd {
  47. uint32_t type;
  48. uint32_t len;
  49. void *value;
  50. };
  51. #define MSM_GEMINI_EVT_RESET 0
  52. #define MSM_GEMINI_EVT_FRAMEDONE 1
  53. #define MSM_GEMINI_EVT_ERR 2
  54. struct msm_gemini_buf {
  55. uint32_t type;
  56. int fd;
  57. void *vaddr;
  58. uint32_t y_off;
  59. uint32_t y_len;
  60. uint32_t framedone_len;
  61. uint32_t cbcr_off;
  62. uint32_t cbcr_len;
  63. uint32_t num_of_mcu_rows;
  64. uint32_t offset;
  65. };
  66. #define MSM_GEMINI_HW_CMD_TYPE_READ 0
  67. #define MSM_GEMINI_HW_CMD_TYPE_WRITE 1
  68. #define MSM_GEMINI_HW_CMD_TYPE_WRITE_OR 2
  69. #define MSM_GEMINI_HW_CMD_TYPE_UWAIT 3
  70. #define MSM_GEMINI_HW_CMD_TYPE_MWAIT 4
  71. #define MSM_GEMINI_HW_CMD_TYPE_MDELAY 5
  72. #define MSM_GEMINI_HW_CMD_TYPE_UDELAY 6
  73. struct msm_gemini_hw_cmd {
  74. uint32_t type:4;
  75. /* n microseconds of timeout for WAIT */
  76. /* n microseconds of time for DELAY */
  77. /* repeat n times for READ/WRITE */
  78. /* max is 0xFFF, 4095 */
  79. uint32_t n:12;
  80. uint32_t offset:16;
  81. uint32_t mask;
  82. union {
  83. uint32_t data; /* for single READ/WRITE/WAIT, n = 1 */
  84. uint32_t *pdata; /* for multiple READ/WRITE/WAIT, n > 1 */
  85. };
  86. };
  87. struct msm_gemini_hw_cmds {
  88. uint32_t m; /* number of elements in the hw_cmd array */
  89. struct msm_gemini_hw_cmd hw_cmd[1];
  90. };
  91. #endif /* __LINUX_MSM_GEMINI_H */