msm_jpeg.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef __UAPI_LINUX_MSM_JPEG_H
  2. #define __UAPI_LINUX_MSM_JPEG_H
  3. #include <linux/types.h>
  4. #include <linux/ioctl.h>
  5. #define OUTPUT_H2V1 0
  6. #define OUTPUT_H2V2 1
  7. #define OUTPUT_BYTE 6
  8. #define MSM_JPEG_IOCTL_MAGIC 'g'
  9. #define MSM_JPEG_IOCTL_GET_HW_VERSION \
  10. _IOW(MSM_JPEG_IOCTL_MAGIC, 1, struct msm_jpeg_hw_cmd)
  11. #define MSM_JPEG_IOCTL_RESET \
  12. _IOW(MSM_JPEG_IOCTL_MAGIC, 2, struct msm_jpeg_ctrl_cmd)
  13. #define MSM_JPEG_IOCTL_STOP \
  14. _IOW(MSM_JPEG_IOCTL_MAGIC, 3, struct msm_jpeg_hw_cmds)
  15. #define MSM_JPEG_IOCTL_START \
  16. _IOW(MSM_JPEG_IOCTL_MAGIC, 4, struct msm_jpeg_hw_cmds)
  17. #define MSM_JPEG_IOCTL_INPUT_BUF_ENQUEUE \
  18. _IOW(MSM_JPEG_IOCTL_MAGIC, 5, struct msm_jpeg_buf)
  19. #define MSM_JPEG_IOCTL_INPUT_GET \
  20. _IOW(MSM_JPEG_IOCTL_MAGIC, 6, struct msm_jpeg_buf)
  21. #define MSM_JPEG_IOCTL_INPUT_GET_UNBLOCK \
  22. _IOW(MSM_JPEG_IOCTL_MAGIC, 7, int)
  23. #define MSM_JPEG_IOCTL_OUTPUT_BUF_ENQUEUE \
  24. _IOW(MSM_JPEG_IOCTL_MAGIC, 8, struct msm_jpeg_buf)
  25. #define MSM_JPEG_IOCTL_OUTPUT_GET \
  26. _IOW(MSM_JPEG_IOCTL_MAGIC, 9, struct msm_jpeg_buf)
  27. #define MSM_JPEG_IOCTL_OUTPUT_GET_UNBLOCK \
  28. _IOW(MSM_JPEG_IOCTL_MAGIC, 10, int)
  29. #define MSM_JPEG_IOCTL_EVT_GET \
  30. _IOW(MSM_JPEG_IOCTL_MAGIC, 11, struct msm_jpeg_ctrl_cmd)
  31. #define MSM_JPEG_IOCTL_EVT_GET_UNBLOCK \
  32. _IOW(MSM_JPEG_IOCTL_MAGIC, 12, int)
  33. #define MSM_JPEG_IOCTL_HW_CMD \
  34. _IOW(MSM_JPEG_IOCTL_MAGIC, 13, struct msm_jpeg_hw_cmd)
  35. #define MSM_JPEG_IOCTL_HW_CMDS \
  36. _IOW(MSM_JPEG_IOCTL_MAGIC, 14, struct msm_jpeg_hw_cmds)
  37. #define MSM_JPEG_IOCTL_TEST_DUMP_REGION \
  38. _IOW(MSM_JPEG_IOCTL_MAGIC, 15, unsigned long)
  39. #define MSM_JPEG_IOCTL_SET_CLK_RATE \
  40. _IOW(MSM_JPEG_IOCTL_MAGIC, 16, unsigned int)
  41. #define MSM_JPEG_MODE_REALTIME_ENCODE 0
  42. #define MSM_JPEG_MODE_OFFLINE_ENCODE 1
  43. #define MSM_JPEG_MODE_REALTIME_ROTATION 2
  44. #define MSM_JPEG_MODE_OFFLINE_ROTATION 3
  45. struct msm_jpeg_ctrl_cmd {
  46. uint32_t type;
  47. uint32_t len;
  48. void *value;
  49. };
  50. #define MSM_JPEG_EVT_RESET 0
  51. #define MSM_JPEG_EVT_SESSION_DONE 1
  52. #define MSM_JPEG_EVT_ERR 2
  53. struct msm_jpeg_buf {
  54. uint32_t type;
  55. int fd;
  56. void *vaddr;
  57. uint32_t y_off;
  58. uint32_t y_len;
  59. uint32_t framedone_len;
  60. uint32_t cbcr_off;
  61. uint32_t cbcr_len;
  62. uint32_t num_of_mcu_rows;
  63. uint32_t offset;
  64. uint32_t pln2_off;
  65. uint32_t pln2_len;
  66. };
  67. #define MSM_JPEG_HW_CMD_TYPE_READ 0
  68. #define MSM_JPEG_HW_CMD_TYPE_WRITE 1
  69. #define MSM_JPEG_HW_CMD_TYPE_WRITE_OR 2
  70. #define MSM_JPEG_HW_CMD_TYPE_UWAIT 3
  71. #define MSM_JPEG_HW_CMD_TYPE_MWAIT 4
  72. #define MSM_JPEG_HW_CMD_TYPE_MDELAY 5
  73. #define MSM_JPEG_HW_CMD_TYPE_UDELAY 6
  74. struct msm_jpeg_hw_cmd {
  75. uint32_t type:4;
  76. /* n microseconds of timeout for WAIT */
  77. /* n microseconds of time for DELAY */
  78. /* repeat n times for READ/WRITE */
  79. /* max is 0xFFF, 4095 */
  80. uint32_t n:12;
  81. uint32_t offset:16;
  82. uint32_t mask;
  83. union {
  84. uint32_t data; /* for single READ/WRITE/WAIT, n = 1 */
  85. uint32_t *pdata; /* for multiple READ/WRITE/WAIT, n > 1 */
  86. };
  87. };
  88. struct msm_jpeg_hw_cmds {
  89. uint32_t m; /* number of elements in the hw_cmd array */
  90. struct msm_jpeg_hw_cmd hw_cmd[1];
  91. };
  92. #endif