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