1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef __UAPI_LINUX_MSMB_CAMERA_H 20 #define __UAPI_LINUX_MSMB_CAMERA_H 21 #include <linux/videodev2.h> 22 #include <linux/types.h> 23 #include <linux/ioctl.h> 24 #include <linux/media.h> 25 #define MSM_CAM_LOGSYNC_FILE_NAME "logsync" 26 #define MSM_CAM_LOGSYNC_FILE_BASEDIR "camera" 27 #define MSM_CAM_V4L2_IOCTL_NOTIFY _IOW('V', BASE_VIDIOC_PRIVATE + 30, struct msm_v4l2_event_data) 28 #define MSM_CAM_V4L2_IOCTL_NOTIFY_META _IOW('V', BASE_VIDIOC_PRIVATE + 31, struct msm_v4l2_event_data) 29 #define MSM_CAM_V4L2_IOCTL_CMD_ACK _IOW('V', BASE_VIDIOC_PRIVATE + 32, struct msm_v4l2_event_data) 30 #define MSM_CAM_V4L2_IOCTL_NOTIFY_ERROR _IOW('V', BASE_VIDIOC_PRIVATE + 33, struct msm_v4l2_event_data) 31 #define MSM_CAM_V4L2_IOCTL_NOTIFY_DEBUG _IOW('V', BASE_VIDIOC_PRIVATE + 34, struct msm_v4l2_event_data) 32 #define MSM_CAM_V4L2_IOCTL_DAEMON_DISABLED _IOW('V', BASE_VIDIOC_PRIVATE + 35, struct msm_v4l2_event_data) 33 #define QCAMERA_VNODE_GROUP_ID MEDIA_ENT_F_IO_V4L 34 #define MSM_CAMERA_NAME "msm_camera" 35 #define MSM_CONFIGURATION_NAME "msm_config" 36 #define MSM_CAMERA_SUBDEV_BASE (MEDIA_ENT_F_OLD_BASE + 0xF00) 37 #define MSM_CAMERA_SUBDEV_CSIPHY (MSM_CAMERA_SUBDEV_BASE + 0) 38 #define MSM_CAMERA_SUBDEV_CSID (MSM_CAMERA_SUBDEV_BASE + 13) 39 #define MSM_CAMERA_SUBDEV_ISPIF (MSM_CAMERA_SUBDEV_BASE + 2) 40 #define MSM_CAMERA_SUBDEV_VFE (MSM_CAMERA_SUBDEV_BASE + 3) 41 #define MSM_CAMERA_SUBDEV_AXI (MSM_CAMERA_SUBDEV_BASE + 4) 42 #define MSM_CAMERA_SUBDEV_VPE (MSM_CAMERA_SUBDEV_BASE + 5) 43 #define MSM_CAMERA_SUBDEV_SENSOR (MSM_CAMERA_SUBDEV_BASE + 6) 44 #define MSM_CAMERA_SUBDEV_ACTUATOR (MSM_CAMERA_SUBDEV_BASE + 7) 45 #define MSM_CAMERA_SUBDEV_EEPROM (MSM_CAMERA_SUBDEV_BASE + 8) 46 #define MSM_CAMERA_SUBDEV_CPP (MSM_CAMERA_SUBDEV_BASE + 9) 47 #define MSM_CAMERA_SUBDEV_CCI (MSM_CAMERA_SUBDEV_BASE + 10) 48 #define MSM_CAMERA_SUBDEV_LED_FLASH (MSM_CAMERA_SUBDEV_BASE + 11) 49 #define MSM_CAMERA_SUBDEV_STROBE_FLASH (MSM_CAMERA_SUBDEV_BASE + 12) 50 #define MSM_CAMERA_SUBDEV_BUF_MNGR (MSM_CAMERA_SUBDEV_BASE + 1) 51 #define MSM_CAMERA_SUBDEV_SENSOR_INIT (MSM_CAMERA_SUBDEV_BASE + 14) 52 #define MSM_CAMERA_SUBDEV_OIS (MSM_CAMERA_SUBDEV_BASE + 15) 53 #define MSM_CAMERA_SUBDEV_FLASH (MSM_CAMERA_SUBDEV_BASE + 16) 54 #define MSM_CAMERA_SUBDEV_IR_LED (MSM_CAMERA_SUBDEV_BASE + 17) 55 #define MSM_CAMERA_SUBDEV_IR_CUT (MSM_CAMERA_SUBDEV_BASE + 18) 56 #define MSM_CAMERA_SUBDEV_EXT (MSM_CAMERA_SUBDEV_BASE + 19) 57 #define MSM_CAMERA_SUBDEV_TOF (MSM_CAMERA_SUBDEV_BASE + 20) 58 #define MSM_CAMERA_SUBDEV_LASER_LED (MSM_CAMERA_SUBDEV_BASE + 21) 59 #define MSM_MAX_CAMERA_SENSORS 5 60 #define MSM_CAMERA_MAX_STREAM_BUF 72 61 #define MSM_CAMERA_MAX_USER_BUFF_CNT 16 62 #define MSM_CAMERA_FEATURE_BASE 0x00010000 63 #define MSM_CAMERA_FEATURE_SHUTDOWN (MSM_CAMERA_FEATURE_BASE + 1) 64 #define MSM_CAMERA_STATUS_BASE 0x00020000 65 #define MSM_CAMERA_STATUS_FAIL (MSM_CAMERA_STATUS_BASE + 1) 66 #define MSM_CAMERA_STATUS_SUCCESS (MSM_CAMERA_STATUS_BASE + 2) 67 #define MSM_CAMERA_V4L2_EVENT_TYPE (V4L2_EVENT_PRIVATE_START + 0x00002000) 68 #define MSM_CAMERA_EVENT_MIN 0 69 #define MSM_CAMERA_NEW_SESSION (MSM_CAMERA_EVENT_MIN + 1) 70 #define MSM_CAMERA_DEL_SESSION (MSM_CAMERA_EVENT_MIN + 2) 71 #define MSM_CAMERA_SET_PARM (MSM_CAMERA_EVENT_MIN + 3) 72 #define MSM_CAMERA_GET_PARM (MSM_CAMERA_EVENT_MIN + 4) 73 #define MSM_CAMERA_MAPPING_CFG (MSM_CAMERA_EVENT_MIN + 5) 74 #define MSM_CAMERA_MAPPING_SES (MSM_CAMERA_EVENT_MIN + 6) 75 #define MSM_CAMERA_MSM_NOTIFY (MSM_CAMERA_EVENT_MIN + 7) 76 #define MSM_CAMERA_EVENT_MAX (MSM_CAMERA_EVENT_MIN + 8) 77 #define MSM_CAMERA_PRIV_S_CROP (V4L2_CID_PRIVATE_BASE + 1) 78 #define MSM_CAMERA_PRIV_G_CROP (V4L2_CID_PRIVATE_BASE + 2) 79 #define MSM_CAMERA_PRIV_G_FMT (V4L2_CID_PRIVATE_BASE + 3) 80 #define MSM_CAMERA_PRIV_S_FMT (V4L2_CID_PRIVATE_BASE + 4) 81 #define MSM_CAMERA_PRIV_TRY_FMT (V4L2_CID_PRIVATE_BASE + 5) 82 #define MSM_CAMERA_PRIV_METADATA (V4L2_CID_PRIVATE_BASE + 6) 83 #define MSM_CAMERA_PRIV_QUERY_CAP (V4L2_CID_PRIVATE_BASE + 7) 84 #define MSM_CAMERA_PRIV_STREAM_ON (V4L2_CID_PRIVATE_BASE + 8) 85 #define MSM_CAMERA_PRIV_STREAM_OFF (V4L2_CID_PRIVATE_BASE + 9) 86 #define MSM_CAMERA_PRIV_NEW_STREAM (V4L2_CID_PRIVATE_BASE + 10) 87 #define MSM_CAMERA_PRIV_DEL_STREAM (V4L2_CID_PRIVATE_BASE + 11) 88 #define MSM_CAMERA_PRIV_SHUTDOWN (V4L2_CID_PRIVATE_BASE + 12) 89 #define MSM_CAMERA_PRIV_STREAM_INFO_SYNC (V4L2_CID_PRIVATE_BASE + 13) 90 #define MSM_CAMERA_PRIV_G_SESSION_ID (V4L2_CID_PRIVATE_BASE + 14) 91 #define MSM_CAMERA_PRIV_CMD_MAX 20 92 #define MSM_CAMERA_CMD_SUCCESS 0x00000001 93 #define MSM_CAMERA_BUF_MAP_SUCCESS 0x00000002 94 #define MSM_CAMERA_ERR_EVT_BASE 0x00010000 95 #define MSM_CAMERA_ERR_CMD_FAIL (MSM_CAMERA_ERR_EVT_BASE + 1) 96 #define MSM_CAMERA_ERR_MAPPING (MSM_CAMERA_ERR_EVT_BASE + 2) 97 #define MSM_CAMERA_ERR_DEVICE_BUSY (MSM_CAMERA_ERR_EVT_BASE + 3) 98 struct msm_v4l2_event_data { 99 unsigned int command; 100 unsigned int status; 101 unsigned int session_id; 102 unsigned int stream_id; 103 unsigned int map_op; 104 unsigned int map_buf_idx; 105 unsigned int notify; 106 unsigned int arg_value; 107 unsigned int ret_value; 108 unsigned int v4l2_event_type; 109 unsigned int v4l2_event_id; 110 unsigned int handle; 111 unsigned int nop6; 112 unsigned int nop7; 113 unsigned int nop8; 114 unsigned int nop9; 115 }; 116 struct msm_v4l2_format_data { 117 enum v4l2_buf_type type; 118 unsigned int width; 119 unsigned int height; 120 unsigned int pixelformat; 121 unsigned char num_planes; 122 unsigned int plane_sizes[VIDEO_MAX_PLANES]; 123 }; 124 #define msm_v4l2_fourcc(a,b,c,d) ((__u32) (a) | ((__u32) (b) << 8) | ((__u32) (c) << 16) | ((__u32) (d) << 24)) 125 #define MSM_V4L2_PIX_FMT_STATS_COMB v4l2_fourcc('S', 'T', 'C', 'M') 126 #define MSM_V4L2_PIX_FMT_STATS_AE v4l2_fourcc('S', 'T', 'A', 'E') 127 #define MSM_V4L2_PIX_FMT_STATS_AF v4l2_fourcc('S', 'T', 'A', 'F') 128 #define MSM_V4L2_PIX_FMT_STATS_AWB v4l2_fourcc('S', 'T', 'W', 'B') 129 #define MSM_V4L2_PIX_FMT_STATS_IHST v4l2_fourcc('I', 'H', 'S', 'T') 130 #define MSM_V4L2_PIX_FMT_STATS_CS v4l2_fourcc('S', 'T', 'C', 'S') 131 #define MSM_V4L2_PIX_FMT_STATS_RS v4l2_fourcc('S', 'T', 'R', 'S') 132 #define MSM_V4L2_PIX_FMT_STATS_BG v4l2_fourcc('S', 'T', 'B', 'G') 133 #define MSM_V4L2_PIX_FMT_STATS_BF v4l2_fourcc('S', 'T', 'B', 'F') 134 #define MSM_V4L2_PIX_FMT_STATS_BHST v4l2_fourcc('B', 'H', 'S', 'T') 135 enum smmu_attach_mode { 136 NON_SECURE_MODE = 0x01, 137 SECURE_MODE = 0x02, 138 MAX_PROTECTION_MODE = 0x03, 139 }; 140 struct msm_camera_smmu_attach_type { 141 enum smmu_attach_mode attach; 142 }; 143 struct msm_camera_user_buf_cont_t { 144 unsigned int buf_cnt; 145 unsigned int buf_idx[MSM_CAMERA_MAX_USER_BUFF_CNT]; 146 }; 147 struct msm_camera_return_buf { 148 __u32 index; 149 __u32 reserved; 150 }; 151 #define MSM_CAMERA_PRIV_IOCTL_ID_BASE 0 152 #define MSM_CAMERA_PRIV_IOCTL_ID_RETURN_BUF 1 153 struct msm_camera_private_ioctl_arg { 154 __u32 id; 155 __u32 size; 156 __u32 result; 157 __u32 reserved; 158 __u64 ioctl_ptr; 159 }; 160 #define VIDIOC_MSM_CAMERA_PRIVATE_IOCTL_CMD _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_camera_private_ioctl_arg) 161 #endif 162 163