sensors_io.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. /*
  2. * Copyright(C)2014 MediaTek Inc.
  3. * Modification based on code covered by the below mentioned copyright
  4. * and/or permission notice(S).
  5. */
  6. #ifndef SENSORS_IO_H
  7. #define SENSORS_IO_H
  8. #include <linux/ioctl.h>
  9. #ifdef CONFIG_COMPAT
  10. #include <linux/compat.h>
  11. #endif
  12. struct GSENSOR_VECTOR3D {
  13. unsigned short x; /**< X axis */
  14. unsigned short y; /**< Y axis */
  15. unsigned short z; /**< Z axis */
  16. };
  17. struct SENSOR_DATA {
  18. int x;
  19. int y;
  20. int z;
  21. };
  22. #define GSENSOR 0x85
  23. #define GSENSOR_IOCTL_INIT _IO(GSENSOR, 0x01)
  24. #define GSENSOR_IOCTL_READ_CHIPINFO _IOR(GSENSOR, 0x02, int)
  25. #define GSENSOR_IOCTL_READ_SENSORDATA _IOR(GSENSOR, 0x03, int)
  26. #define GSENSOR_IOCTL_READ_OFFSET _IOR(GSENSOR, 0x04, struct GSENSOR_VECTOR3D)
  27. #define GSENSOR_IOCTL_READ_GAIN _IOR(GSENSOR, 0x05, struct GSENSOR_VECTOR3D)
  28. #define GSENSOR_IOCTL_READ_RAW_DATA _IOR(GSENSOR, 0x06, int)
  29. #define GSENSOR_IOCTL_SET_CALI _IOW(GSENSOR, 0x06, struct SENSOR_DATA)
  30. #define GSENSOR_IOCTL_GET_CALI _IOW(GSENSOR, 0x07, struct SENSOR_DATA)
  31. #define GSENSOR_IOCTL_CLR_CALI _IO(GSENSOR, 0x08)
  32. #ifdef CONFIG_COMPAT
  33. #define COMPAT_GSENSOR_IOCTL_INIT _IO(GSENSOR, 0x01)
  34. #define COMPAT_GSENSOR_IOCTL_READ_CHIPINFO _IOR(GSENSOR, 0x02, compat_int_t)
  35. #define COMPAT_GSENSOR_IOCTL_READ_SENSORDATA _IOR(GSENSOR, 0x03, compat_int_t)
  36. #define COMPAT_GSENSOR_IOCTL_READ_OFFSET _IOR(GSENSOR, 0x04, struct GSENSOR_VECTOR3D)
  37. #define COMPAT_GSENSOR_IOCTL_READ_GAIN _IOR(GSENSOR, 0x05, struct GSENSOR_VECTOR3D)
  38. #define COMPAT_GSENSOR_IOCTL_READ_RAW_DATA _IOR(GSENSOR, 0x06, compat_int_t)
  39. #define COMPAT_GSENSOR_IOCTL_SET_CALI _IOW(GSENSOR, 0x06, struct SENSOR_DATA)
  40. #define COMPAT_GSENSOR_IOCTL_GET_CALI _IOW(GSENSOR, 0x07, struct SENSOR_DATA)
  41. #define COMPAT_GSENSOR_IOCTL_CLR_CALI _IO(GSENSOR, 0x08)
  42. #endif
  43. /* mCube add start */
  44. /* G-sensor */
  45. #define GSENSOR_MCUBE_IOCTL_READ_RBM_DATA _IOR(GSENSOR, 0x09, struct SENSOR_DATA)
  46. #define GSENSOR_MCUBE_IOCTL_SET_RBM_MODE _IO(GSENSOR, 0x0a)
  47. #define GSENSOR_MCUBE_IOCTL_CLEAR_RBM_MODE _IO(GSENSOR, 0x0b)
  48. #define GSENSOR_MCUBE_IOCTL_SET_CALI _IOW(GSENSOR, 0x0c, struct SENSOR_DATA)
  49. #define GSENSOR_MCUBE_IOCTL_REGISTER_MAP _IO(GSENSOR, 0x0d)
  50. #define GSENSOR_IOCTL_SET_CALI_MODE _IOW(GSENSOR, 0x0e, int)
  51. #define GSENSOR_MCUBE_IOCTL_READ_PRODUCT_ID _IOR(GSENSOR, 0x0f, int)
  52. #define GSENSOR_MCUBE_IOCTL_READ_FILEPATH _IOR(GSENSOR, 0x10, char[256])
  53. #define GSENSOR_MCUBE_IOCTL_VIRTUAL_Z _IOR(GSENSOR, 0x11, int)
  54. #define GSENSOR_MCUBE_IOCTL_READ_PCODE _IOR(GSENSOR, 0x12, char)
  55. #define GSENSOR_MCUBE_IOCTL_GET_OFLAG _IOR(GSENSOR, 0x13, short)
  56. #ifdef CONFIG_COMPAT
  57. #define COMPAT_GSENSOR_MCUBE_IOCTL_READ_RBM_DATA _IOR(GSENSOR, 0x09, struct SENSOR_DATA)
  58. #define COMPAT_GSENSOR_MCUBE_IOCTL_SET_RBM_MODE _IO(GSENSOR, 0x0a)
  59. #define COMPAT_GSENSOR_MCUBE_IOCTL_CLEAR_RBM_MODE _IO(GSENSOR, 0x0b)
  60. #define COMPAT_GSENSOR_MCUBE_IOCTL_SET_CALI _IOW(GSENSOR, 0x0c, struct SENSOR_DATA)
  61. #define COMPAT_GSENSOR_MCUBE_IOCTL_REGISTER_MAP _IO(GSENSOR, 0x0d)
  62. #define COMPAT_GSENSOR_IOCTL_SET_CALI_MODE _IOW(GSENSOR, 0x0e, compat_int_t)
  63. #define COMPAT_GSENSOR_MCUBE_IOCTL_READ_PRODUCT_ID _IOR(GSENSOR, 0x0f, compat_int_t)
  64. #define COMPAT_GSENSOR_MCUBE_IOCTL_READ_FILEPATH _IOR(GSENSOR, 0x10, char[256])
  65. #define COMPAT_GSENSOR_MCUBE_IOCTL_VIRTUAL_Z _IOR(GSENSOR, 0x11, compat_int_t)
  66. #define COMPAT_GSENSOR_MCUBE_IOCTL_READ_PCODE _IOR(GSENSOR, 0x12, char)
  67. #define COMPAT_GSENSOR_MCUBE_IOCTL_GET_OFLAG _IOR(GSENSOR, 0x13, compat_short_t)
  68. #endif
  69. /* IOCTLs for Msensor misc. device library */
  70. #define MSENSOR 0x83
  71. #define MSENSOR_IOCTL_INIT _IO(MSENSOR, 0x01)
  72. #define MSENSOR_IOCTL_READ_CHIPINFO _IOR(MSENSOR, 0x02, int)
  73. #define MSENSOR_IOCTL_READ_SENSORDATA _IOR(MSENSOR, 0x03, int)
  74. #define MSENSOR_IOCTL_READ_POSTUREDATA _IOR(MSENSOR, 0x04, int)
  75. #define MSENSOR_IOCTL_READ_CALIDATA _IOR(MSENSOR, 0x05, int)
  76. #define MSENSOR_IOCTL_READ_CONTROL _IOR(MSENSOR, 0x06, int)
  77. #define MSENSOR_IOCTL_SET_CONTROL _IOW(MSENSOR, 0x07, int)
  78. #define MSENSOR_IOCTL_SET_MODE _IOW(MSENSOR, 0x08, int)
  79. #define MSENSOR_IOCTL_SET_POSTURE _IOW(MSENSOR, 0x09, int)
  80. #define MSENSOR_IOCTL_SET_CALIDATA _IOW(MSENSOR, 0x0a, int)
  81. #define MSENSOR_IOCTL_SENSOR_ENABLE _IOW(MSENSOR, 0x51, int)
  82. #define MSENSOR_IOCTL_READ_FACTORY_SENSORDATA _IOW(MSENSOR, 0x52, int)
  83. #ifdef CONFIG_COMPAT
  84. /*COMPACT IOCTL for 64bit kernel running 32bit daemon*/
  85. #define COMPAT_MSENSOR_IOCTL_INIT _IO(MSENSOR, 0x01)
  86. #define COMPAT_MSENSOR_IOCTL_READ_CHIPINFO _IOR(MSENSOR, 0x02, compat_int_t)
  87. #define COMPAT_MSENSOR_IOCTL_READ_SENSORDATA _IOR(MSENSOR, 0x03, compat_int_t)
  88. #define COMPAT_MSENSOR_IOCTL_READ_POSTUREDATA _IOR(MSENSOR, 0x04, compat_int_t)
  89. #define COMPAT_MSENSOR_IOCTL_READ_CALIDATA _IOR(MSENSOR, 0x05, compat_int_t)
  90. #define COMPAT_MSENSOR_IOCTL_READ_CONTROL _IOR(MSENSOR, 0x06, compat_int_t)
  91. #define COMPAT_MSENSOR_IOCTL_SET_CONTROL _IOW(MSENSOR, 0x07, compat_int_t)
  92. #define COMPAT_MSENSOR_IOCTL_SET_MODE _IOW(MSENSOR, 0x08, compat_int_t)
  93. #define COMPAT_MSENSOR_IOCTL_SET_POSTURE _IOW(MSENSOR, 0x09, compat_int_t)
  94. #define COMPAT_MSENSOR_IOCTL_SET_CALIDATA _IOW(MSENSOR, 0x0a, compat_int_t)
  95. #define COMPAT_MSENSOR_IOCTL_SENSOR_ENABLE _IOW(MSENSOR, 0x51, compat_int_t)
  96. #define COMPAT_MSENSOR_IOCTL_READ_FACTORY_SENSORDATA _IOW(MSENSOR, 0x52, compat_int_t)
  97. #endif
  98. /* IOCTLs for AKM library */
  99. #define ECS_IOCTL_WRITE _IOW(MSENSOR, 0x0b, char*)
  100. #define ECS_IOCTL_READ _IOWR(MSENSOR, 0x0c, char*)
  101. #define ECS_IOCTL_RESET _IO(MSENSOR, 0x0d) /* NOT used in AK8975 */
  102. #define ECS_IOCTL_SET_MODE _IOW(MSENSOR, 0x0e, short)
  103. #define ECS_IOCTL_GETDATA _IOR(MSENSOR, 0x0f, char[SENSOR_DATA_SIZE])
  104. #define ECS_IOCTL_SET_YPR _IOW(MSENSOR, 0x10, short[12])
  105. #define ECS_IOCTL_GET_OPEN_STATUS _IOR(MSENSOR, 0x11, int)
  106. #define ECS_IOCTL_GET_CLOSE_STATUS _IOR(MSENSOR, 0x12, int)
  107. #define ECS_IOCTL_GET_OSENSOR_STATUS _IOR(MSENSOR, 0x13, int)
  108. #define ECS_IOCTL_GET_DELAY _IOR(MSENSOR, 0x14, short)
  109. #define ECS_IOCTL_GET_PROJECT_NAME _IOR(MSENSOR, 0x15, char[64])
  110. #define ECS_IOCTL_GET_MATRIX _IOR(MSENSOR, 0x16, short [4][3][3])
  111. #define ECS_IOCTL_GET_LAYOUT _IOR(MSENSOR, 0x17, int[3])
  112. #define ECS_IOCTL_GET_OUTBIT _IOR(MSENSOR, 0x23, char)
  113. #define ECS_IOCTL_GET_ACCEL _IOR(MSENSOR, 0x24, short[3])
  114. #define MMC31XX_IOC_RM _IO(MSENSOR, 0x25)
  115. #define MMC31XX_IOC_RRM _IO(MSENSOR, 0x26)
  116. /* IOCTLs for akm09911 device */
  117. #define ECS_IOCTL_GET_INFO _IOR(MSENSOR, 0x27, unsigned char[AKM_SENSOR_INFO_SIZE])
  118. #define ECS_IOCTL_GET_CONF _IOR(MSENSOR, 0x28, unsigned char[AKM_SENSOR_CONF_SIZE])
  119. #define ECS_IOCTL_SET_YPR_09911 _IOW(MSENSOR, 0x29, int[26])
  120. #define ECS_IOCTL_GET_DELAY_09911 _IOR(MSENSOR, 0x30, int64_t[3])
  121. #define ECS_IOCTL_GET_LAYOUT_09911 _IOR(MSENSOR, 0x31, char)
  122. /* IOCTLs for MMC31XX device */
  123. #define MMC31XX_IOC_TM _IO(MSENSOR, 0x18)
  124. #define MMC31XX_IOC_SET _IO(MSENSOR, 0x19)
  125. #define MMC31XX_IOC_RESET _IO(MSENSOR, 0x1a)
  126. #define MMC31XX_IOC_READ _IOR(MSENSOR, 0x1b, int[3])
  127. #define MMC31XX_IOC_READXYZ _IOR(MSENSOR, 0x1c, int[3])
  128. #define ECOMPASS_IOC_GET_DELAY _IOR(MSENSOR, 0x1d, int)
  129. #define ECOMPASS_IOC_GET_MFLAG _IOR(MSENSOR, 0x1e, short)
  130. #define ECOMPASS_IOC_GET_OFLAG _IOR(MSENSOR, 0x1f, short)
  131. #define ECOMPASS_IOC_GET_OPEN_STATUS _IOR(MSENSOR, 0x20, int)
  132. #define ECOMPASS_IOC_SET_YPR _IOW(MSENSOR, 0x21, int[12])
  133. #define ECOMPASS_IOC_GET_LAYOUT _IOR(MSENSOR, 0X22, int)
  134. #ifdef CONFIG_COMPAT
  135. /*COMPAT IOCTLs for AKM library */
  136. #define COMPAT_ECS_IOCTL_WRITE _IOW(MSENSOR, 0x0b, compat_uptr_t)
  137. #define COMPAT_ECS_IOCTL_READ _IOWR(MSENSOR, 0x0c, compat_uptr_t)
  138. #define COMPAT_ECS_IOCTL_RESET _IO(MSENSOR, 0x0d) /* NOT used in AK8975 */
  139. #define COMPAT_ECS_IOCTL_SET_MODE _IOW(MSENSOR, 0x0e, compat_short_t)
  140. #define COMPAT_ECS_IOCTL_GETDATA _IOR(MSENSOR, 0x0f, char[SENSOR_DATA_SIZE])
  141. #define COMPAT_ECS_IOCTL_SET_YPR _IOW(MSENSOR, 0x10, compat_short_t[12])
  142. #define COMPAT_ECS_IOCTL_GET_OPEN_STATUS _IOR(MSENSOR, 0x11, compat_int_t)
  143. #define COMPAT_ECS_IOCTL_GET_CLOSE_STATUS _IOR(MSENSOR, 0x12, compat_int_t)
  144. #define COMPAT_ECS_IOCTL_GET_OSENSOR_STATUS _IOR(MSENSOR, 0x13, compat_int_t)
  145. #define COMPAT_ECS_IOCTL_GET_DELAY _IOR(MSENSOR, 0x14, compat_short_t)
  146. #define COMPAT_ECS_IOCTL_GET_PROJECT_NAME _IOR(MSENSOR, 0x15, char[64])
  147. #define COMPAT_ECS_IOCTL_GET_MATRIX _IOR(MSENSOR, 0x16, compat_short_t [4][3][3])
  148. #define COMPAT_ECS_IOCTL_GET_LAYOUT _IOR(MSENSOR, 0x17, compat_int_t[3])
  149. #define COMPAT_ECS_IOCTL_GET_OUTBIT _IOR(MSENSOR, 0x23, char)
  150. #define COMPAT_ECS_IOCTL_GET_ACCEL _IOR(MSENSOR, 0x24, compat_short_t[3])
  151. #define COMPAT_MMC31XX_IOC_RM _IO(MSENSOR, 0x25)
  152. #define COMPAT_MMC31XX_IOC_RRM _IO(MSENSOR, 0x26)
  153. /*COMPAT IOCTLs for akm09911 device */
  154. #define COMPAT_ECS_IOCTL_GET_INFO _IOR(MSENSOR, 0x27, unsigned char[AKM_SENSOR_INFO_SIZE])
  155. #define COMPAT_ECS_IOCTL_GET_CONF _IOR(MSENSOR, 0x28, unsigned char[AKM_SENSOR_CONF_SIZE])
  156. #define COMPAT_ECS_IOCTL_SET_YPR_09911 _IOW(MSENSOR, 0x29, compat_int_t[26])
  157. #define COMPAT_ECS_IOCTL_GET_DELAY_09911 _IOR(MSENSOR, 0x30, int64_t[3])
  158. #define COMPAT_ECS_IOCTL_GET_LAYOUT_09911 _IOR(MSENSOR, 0x31, char)
  159. /*COPMPAT IOCTLs for MMC31XX device */
  160. #define COMPAT_MMC31XX_IOC_TM _IO(MSENSOR, 0x18)
  161. #define COMPAT_MMC31XX_IOC_SET _IO(MSENSOR, 0x19)
  162. #define COMPAT_MMC31XX_IOC_RESET _IO(MSENSOR, 0x1a)
  163. #define COMPAT_MMC31XX_IOC_READ _IOR(MSENSOR, 0x1b, compat_int_t[3])
  164. #define COMPAT_MMC31XX_IOC_READXYZ _IOR(MSENSOR, 0x1c, compat_int_t[3])
  165. #define COMPAT_ECOMPASS_IOC_GET_DELAY _IOR(MSENSOR, 0x1d, compat_int_t)
  166. #define COMPAT_ECOMPASS_IOC_GET_MFLAG _IOR(MSENSOR, 0x1e, compat_short_t)
  167. #define COMPAT_ECOMPASS_IOC_GET_OFLAG _IOR(MSENSOR, 0x1f, compat_short_t)
  168. #define COMPAT_ECOMPASS_IOC_GET_OPEN_STATUS _IOR(MSENSOR, 0x20, compat_int_t)
  169. #define COMPAT_ECOMPASS_IOC_SET_YPR _IOW(MSENSOR, 0x21, compat_int_t[12])
  170. #define COMPAT_ECOMPASS_IOC_GET_LAYOUT _IOR(MSENSOR, 0X22, compat_int_t)
  171. #endif
  172. /* IOCTLs for QMCX983 device */
  173. #define QMC_IOCTL_WRITE _IOW(MSENSOR, 0x40, char*)
  174. #define QMC_IOCTL_READ _IOWR(MSENSOR, 0x41, char*)
  175. #define QMC_IOCTL_RESET _IO(MSENSOR, 0x42)
  176. #define QMC_IOCTL_SET_MODE _IOW(MSENSOR, 0x43, short)
  177. #define QMC_IOCTL_GETDATA _IOR(MSENSOR, 0x44, char[SENSOR_DATA_SIZE])
  178. #define QMC_IOCTL_SET_YPR _IOW(MSENSOR, 0x45, short[28])
  179. #define QMC_IOCTL_GET_OPEN_STATUS _IOR(MSENSOR, 0x46, int)
  180. #define QMC_IOCTL_GET_CLOSE_STATUS _IOR(MSENSOR, 0x47, int)
  181. #define QMC_IOC_GET_MFLAG _IOR(MSENSOR, 0x48, int)
  182. #define QMC_IOC_GET_OFLAG _IOR(MSENSOR, 0x49, int)
  183. #define QMC_IOCTL_GET_DELAY _IOR(MSENSOR, 0x4a, short)
  184. #ifdef CONFIG_COMPAT
  185. /* compat IOCTLs for QMCX983 device */
  186. #define COMPAT_QMC_IOCTL_WRITE _IOW(MSENSOR, 0x40, compat_uptr_t)
  187. #define COMPAT_QMC_IOCTL_READ _IOWR(MSENSOR, 0x41, compat_uptr_t)
  188. #define COMPAT_QMC_IOCTL_RESET _IO(MSENSOR, 0x42)
  189. #define COMPAT_QMC_IOCTL_SET_MODE _IOW(MSENSOR, 0x43, compat_short_t)
  190. #define COMPAT_QMC_IOCTL_GETDATA _IOR(MSENSOR, 0x44, char[SENSOR_DATA_SIZE])
  191. #define COMPAT_QMC_IOCTL_SET_YPR _IOW(MSENSOR, 0x45, compat_short_t[28])
  192. #define COMPAT_QMC_IOCTL_GET_OPEN_STATUS _IOR(MSENSOR, 0x46, compat_int_t)
  193. #define COMPAT_QMC_IOCTL_GET_CLOSE_STATUS _IOR(MSENSOR, 0x47, compat_int_t)
  194. #define COMPAT_QMC_IOC_GET_MFLAG _IOR(MSENSOR, 0x48, compat_int_t)
  195. #define COMPAT_QMC_IOC_GET_OFLAG _IOR(MSENSOR, 0x49, compat_int_t)
  196. #define COMPAT_QMC_IOCTL_GET_DELAY _IOR(MSENSOR, 0x4a, compat_short_t)
  197. #endif
  198. #define ALSPS 0X84
  199. #define ALSPS_SET_PS_MODE _IOW(ALSPS, 0x01, int)
  200. #define ALSPS_GET_PS_MODE _IOR(ALSPS, 0x02, int)
  201. #define ALSPS_GET_PS_DATA _IOR(ALSPS, 0x03, int)
  202. #define ALSPS_GET_PS_RAW_DATA _IOR(ALSPS, 0x04, int)
  203. #define ALSPS_SET_ALS_MODE _IOW(ALSPS, 0x05, int)
  204. #define ALSPS_GET_ALS_MODE _IOR(ALSPS, 0x06, int)
  205. #define ALSPS_GET_ALS_DATA _IOR(ALSPS, 0x07, int)
  206. #define ALSPS_GET_ALS_RAW_DATA _IOR(ALSPS, 0x08, int)
  207. /*-------------------MTK add-------------------------------------------*/
  208. #define ALSPS_GET_PS_TEST_RESULT _IOR(ALSPS, 0x09, int)
  209. #define ALSPS_GET_ALS_TEST_RESULT _IOR(ALSPS, 0x0A, int)
  210. #define ALSPS_GET_PS_THRESHOLD_HIGH _IOR(ALSPS, 0x0B, int)
  211. #define ALSPS_GET_PS_THRESHOLD_LOW _IOR(ALSPS, 0x0C, int)
  212. #define ALSPS_GET_ALS_THRESHOLD_HIGH _IOR(ALSPS, 0x0D, int)
  213. #define ALSPS_GET_ALS_THRESHOLD_LOW _IOR(ALSPS, 0x0E, int)
  214. #define ALSPS_IOCTL_CLR_CALI _IOW(ALSPS, 0x0F, int)
  215. #define ALSPS_IOCTL_GET_CALI _IOR(ALSPS, 0x10, int)
  216. #define ALSPS_IOCTL_SET_CALI _IOW(ALSPS, 0x11, int)
  217. #define ALSPS_SET_PS_THRESHOLD _IOW(ALSPS, 0x12, int)
  218. #define ALSPS_SET_ALS_THRESHOLD _IOW(ALSPS, 0x13, int)
  219. #define AAL_SET_ALS_MODE _IOW(ALSPS, 0x14, int)
  220. #define AAL_GET_ALS_MODE _IOR(ALSPS, 0x15, int)
  221. #define AAL_GET_ALS_DATA _IOR(ALSPS, 0x16, int)
  222. #ifdef CONFIG_COMPAT
  223. #define COMPAT_ALSPS_SET_PS_MODE _IOW(ALSPS, 0x01, compat_int_t)
  224. #define COMPAT_ALSPS_GET_PS_MODE _IOR(ALSPS, 0x02, compat_int_t)
  225. #define COMPAT_ALSPS_GET_PS_DATA _IOR(ALSPS, 0x03, compat_int_t)
  226. #define COMPAT_ALSPS_GET_PS_RAW_DATA _IOR(ALSPS, 0x04, compat_int_t)
  227. #define COMPAT_ALSPS_SET_ALS_MODE _IOW(ALSPS, 0x05, compat_int_t)
  228. #define COMPAT_ALSPS_GET_ALS_MODE _IOR(ALSPS, 0x06, compat_int_t)
  229. #define COMPAT_ALSPS_GET_ALS_DATA _IOR(ALSPS, 0x07, compat_int_t)
  230. #define COMPAT_ALSPS_GET_ALS_RAW_DATA _IOR(ALSPS, 0x08, compat_int_t)
  231. /*-------------------MTK add-------------------------------------------*/
  232. #define COMPAT_ALSPS_GET_PS_TEST_RESULT _IOR(ALSPS, 0x09, compat_int_t)
  233. #define COMPAT_ALSPS_GET_ALS_TEST_RESULT _IOR(ALSPS, 0x0A, compat_int_t)
  234. #define COMPAT_ALSPS_GET_PS_THRESHOLD_HIGH _IOR(ALSPS, 0x0B, compat_int_t)
  235. #define COMPAT_ALSPS_GET_PS_THRESHOLD_LOW _IOR(ALSPS, 0x0C, compat_int_t)
  236. #define COMPAT_ALSPS_GET_ALS_THRESHOLD_HIGH _IOR(ALSPS, 0x0D, compat_int_t)
  237. #define COMPAT_ALSPS_GET_ALS_THRESHOLD_LOW _IOR(ALSPS, 0x0E, compat_int_t)
  238. #define COMPAT_ALSPS_IOCTL_CLR_CALI _IOW(ALSPS, 0x0F, compat_int_t)
  239. #define COMPAT_ALSPS_IOCTL_GET_CALI _IOR(ALSPS, 0x10, compat_int_t)
  240. #define COMPAT_ALSPS_IOCTL_SET_CALI _IOW(ALSPS, 0x11, compat_int_t)
  241. #define COMPAT_ALSPS_SET_PS_THRESHOLD _IOW(ALSPS, 0x12, compat_int_t)
  242. #define COMPAT_ALSPS_SET_ALS_THRESHOLD _IOW(ALSPS, 0x13, compat_int_t)
  243. #define COMPAT_AAL_SET_ALS_MODE _IOW(ALSPS, 0x14, compat_int_t)
  244. #define COMPAT_AAL_GET_ALS_MODE _IOR(ALSPS, 0x15, compat_int_t)
  245. #define COMPAT_AAL_GET_ALS_DATA _IOR(ALSPS, 0x16, compat_int_t)
  246. #endif
  247. #define GYROSCOPE 0X86
  248. #define GYROSCOPE_IOCTL_INIT _IO(GYROSCOPE, 0x01)
  249. #define GYROSCOPE_IOCTL_SMT_DATA _IOR(GYROSCOPE, 0x02, int)
  250. #define GYROSCOPE_IOCTL_READ_SENSORDATA _IOR(GYROSCOPE, 0x03, int)
  251. #define GYROSCOPE_IOCTL_SET_CALI _IOW(GYROSCOPE, 0x04, struct SENSOR_DATA)
  252. #define GYROSCOPE_IOCTL_GET_CALI _IOW(GYROSCOPE, 0x05, struct SENSOR_DATA)
  253. #define GYROSCOPE_IOCTL_CLR_CALI _IO(GYROSCOPE, 0x06)
  254. #define GYROSCOPE_IOCTL_READ_SENSORDATA_RAW _IOR(GYROSCOPE, 0x07, int)
  255. #define GYROSCOPE_IOCTL_READ_TEMPERATURE _IOR(GYROSCOPE, 0x08, int)
  256. #define GYROSCOPE_IOCTL_GET_POWER_STATUS _IOR(GYROSCOPE, 0x09, int)
  257. #ifdef CONFIG_COMPAT
  258. #define GYROSCOPE 0X86
  259. #define COMPAT_GYROSCOPE_IOCTL_INIT _IO(GYROSCOPE, 0x01)
  260. #define COMPAT_GYROSCOPE_IOCTL_SMT_DATA _IOR(GYROSCOPE, 0x02, compat_int_t)
  261. #define COMPAT_GYROSCOPE_IOCTL_READ_SENSORDATA _IOR(GYROSCOPE, 0x03, compat_int_t)
  262. #define COMPAT_GYROSCOPE_IOCTL_SET_CALI _IOW(GYROSCOPE, 0x04, struct SENSOR_DATA)
  263. #define COMPAT_GYROSCOPE_IOCTL_GET_CALI _IOW(GYROSCOPE, 0x05, struct SENSOR_DATA)
  264. #define COMPAT_GYROSCOPE_IOCTL_CLR_CALI _IO(GYROSCOPE, 0x06)
  265. #define COMPAT_GYROSCOPE_IOCTL_READ_SENSORDATA_RAW _IOR(GYROSCOPE, 0x07, compat_int_t)
  266. #define COMPAT_GYROSCOPE_IOCTL_READ_TEMPERATURE _IOR(GYROSCOPE, 0x08, compat_int_t)
  267. #define COMPAT_GYROSCOPE_IOCTL_GET_POWER_STATUS _IOR(GYROSCOPE, 0x09, compat_int_t)
  268. #endif
  269. #define BROMETER 0X87
  270. #define BAROMETER_IOCTL_INIT _IO(BROMETER, 0x01)
  271. #define BAROMETER_GET_PRESS_DATA _IOR(BROMETER, 0x02, int)
  272. #define BAROMETER_GET_TEMP_DATA _IOR(BROMETER, 0x03, int)
  273. #define BAROMETER_IOCTL_READ_CHIPINFO _IOR(BROMETER, 0x04, int)
  274. #ifdef CONFIG_COMPAT
  275. #define COMPAT_BAROMETER_IOCTL_INIT _IO(BROMETER, 0x01)
  276. #define COMPAT_BAROMETER_GET_PRESS_DATA _IOR(BROMETER, 0x02, compat_int_t)
  277. #define COMPAT_BAROMETER_GET_TEMP_DATA _IOR(BROMETER, 0x03, compat_int_t)
  278. #define COMPAT_BAROMETER_IOCTL_READ_CHIPINFO _IOR(BROMETER, 0x04, compat_int_t)
  279. #endif
  280. #define HEARTMONITOR 0x88
  281. #define HRM_IOCTL_INIT _IO(HEARTMONITOR, 0x01)
  282. #define HRM_READ_SENSOR_DATA _IOR(HEARTMONITOR, 0x02, int)
  283. #define HUMIDITY 0X89
  284. #define HUMIDITY_IOCTL_INIT _IO(HUMIDITY, 0x01)
  285. #define HUMIDITY_GET_HMDY_DATA _IOR(HUMIDITY, 0x02, int)
  286. #define HUMIDITY_GET_TEMP_DATA _IOR(HUMIDITY, 0x03, int)
  287. #define HUMIDITY_IOCTL_READ_CHIPINFO _IOR(HUMIDITY, 0x04, int)
  288. #endif