msmb_ispif.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. #ifndef UAPI_MSMB_ISPIF_H
  2. #define UAPI_MSMB_ISPIF_H
  3. #include <linux/types.h>
  4. #include <linux/ioctl.h>
  5. #include <linux/videodev2.h>
  6. #define CSID_VERSION_V20 0x02000011
  7. #define CSID_VERSION_V22 0x02001000
  8. #define CSID_VERSION_V30 0x30000000
  9. #define CSID_VERSION_V3 0x30000000
  10. enum msm_ispif_vfe_intf {
  11. VFE0,
  12. VFE1,
  13. VFE_MAX
  14. };
  15. #define VFE0_MASK (1 << VFE0)
  16. #define VFE1_MASK (1 << VFE1)
  17. enum msm_ispif_intftype {
  18. PIX0,
  19. RDI0,
  20. PIX1,
  21. RDI1,
  22. RDI2,
  23. INTF_MAX
  24. };
  25. #define MAX_PARAM_ENTRIES (INTF_MAX * 2)
  26. #define MAX_CID_CH 8
  27. #define MAX_CID_CH_PARAM_ENTRY 3
  28. #define PIX0_MASK (1 << PIX0)
  29. #define PIX1_MASK (1 << PIX1)
  30. #define RDI0_MASK (1 << RDI0)
  31. #define RDI1_MASK (1 << RDI1)
  32. #define RDI2_MASK (1 << RDI2)
  33. enum msm_ispif_vc {
  34. VC0,
  35. VC1,
  36. VC2,
  37. VC3,
  38. VC_MAX
  39. };
  40. enum msm_ispif_cid {
  41. CID0,
  42. CID1,
  43. CID2,
  44. CID3,
  45. CID4,
  46. CID5,
  47. CID6,
  48. CID7,
  49. CID8,
  50. CID9,
  51. CID10,
  52. CID11,
  53. CID12,
  54. CID13,
  55. CID14,
  56. CID15,
  57. CID_MAX
  58. };
  59. enum msm_ispif_csid {
  60. CSID0,
  61. CSID1,
  62. CSID2,
  63. CSID3,
  64. CSID_MAX
  65. };
  66. enum msm_ispif_pixel_odd_even {
  67. PIX_EVEN,
  68. PIX_ODD
  69. };
  70. enum msm_ispif_pixel_pack_mode {
  71. PACK_BYTE,
  72. PACK_PLAIN_PACK,
  73. PACK_NV_P8,
  74. PACK_NV_P16
  75. };
  76. struct msm_ispif_pack_cfg {
  77. int pixel_swap_en;
  78. enum msm_ispif_pixel_odd_even even_odd_sel;
  79. enum msm_ispif_pixel_pack_mode pack_mode;
  80. };
  81. struct msm_ispif_params_entry {
  82. enum msm_ispif_vfe_intf vfe_intf;
  83. enum msm_ispif_intftype intftype;
  84. int num_cids;
  85. enum msm_ispif_cid cids[MAX_CID_CH_PARAM_ENTRY];
  86. enum msm_ispif_csid csid;
  87. int crop_enable;
  88. uint16_t crop_start_pixel;
  89. uint16_t crop_end_pixel;
  90. };
  91. struct msm_ispif_right_param_entry {
  92. enum msm_ispif_cid cids[MAX_CID_CH_PARAM_ENTRY];
  93. enum msm_ispif_csid csid;
  94. };
  95. struct msm_ispif_param_data_ext {
  96. uint32_t num;
  97. struct msm_ispif_params_entry entries[MAX_PARAM_ENTRIES];
  98. struct msm_ispif_pack_cfg pack_cfg[CID_MAX];
  99. struct msm_ispif_right_param_entry right_entries[MAX_PARAM_ENTRIES];
  100. uint32_t stereo_enable;
  101. uint16_t line_width[VFE_MAX];
  102. };
  103. struct msm_ispif_param_data {
  104. uint32_t num;
  105. struct msm_ispif_params_entry entries[MAX_PARAM_ENTRIES];
  106. };
  107. struct msm_isp_info {
  108. uint32_t max_resolution;
  109. uint32_t id;
  110. uint32_t ver;
  111. };
  112. struct msm_ispif_vfe_info {
  113. int num_vfe;
  114. struct msm_isp_info info[VFE_MAX];
  115. };
  116. enum ispif_cfg_type_t {
  117. ISPIF_CLK_ENABLE,
  118. ISPIF_CLK_DISABLE,
  119. ISPIF_INIT,
  120. ISPIF_CFG,
  121. ISPIF_START_FRAME_BOUNDARY,
  122. ISPIF_RESTART_FRAME_BOUNDARY,
  123. ISPIF_STOP_FRAME_BOUNDARY,
  124. ISPIF_STOP_IMMEDIATELY,
  125. ISPIF_RELEASE,
  126. ISPIF_ENABLE_REG_DUMP,
  127. ISPIF_SET_VFE_INFO,
  128. ISPIF_CFG2,
  129. ISPIF_CFG_STEREO,
  130. };
  131. struct ispif_cfg_data {
  132. enum ispif_cfg_type_t cfg_type;
  133. union {
  134. int reg_dump; /* ISPIF_ENABLE_REG_DUMP */
  135. uint32_t csid_version; /* ISPIF_INIT */
  136. struct msm_ispif_vfe_info vfe_info; /* ISPIF_SET_VFE_INFO */
  137. struct msm_ispif_param_data params; /* CFG, START, STOP */
  138. };
  139. };
  140. struct ispif_cfg_data_ext {
  141. enum ispif_cfg_type_t cfg_type;
  142. void __user *data;
  143. uint32_t size;
  144. };
  145. #define ISPIF_RDI_PACK_MODE_SUPPORT 1
  146. #define ISPIF_3D_SUPPORT 1
  147. #define ISPIF_LINE_WIDTH_SUPPORT 1
  148. #define VIDIOC_MSM_ISPIF_CFG \
  149. _IOWR('V', BASE_VIDIOC_PRIVATE, struct ispif_cfg_data)
  150. #define VIDIOC_MSM_ISPIF_CFG_EXT \
  151. _IOWR('V', BASE_VIDIOC_PRIVATE+1, struct ispif_cfg_data_ext)
  152. #endif