am437x-vpfe.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Copyright (C) 2013 - 2014 Texas Instruments, Inc.
  3. *
  4. * Benoit Parrot <bparrot@ti.com>
  5. * Lad, Prabhakar <prabhakar.csengg@gmail.com>
  6. *
  7. * This program is free software; you may redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; version 2 of the License.
  10. *
  11. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  12. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  13. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  14. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  15. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  16. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  17. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  18. * SOFTWARE.
  19. */
  20. #ifndef AM437X_VPFE_USER_H
  21. #define AM437X_VPFE_USER_H
  22. #include <linux/videodev2.h>
  23. enum vpfe_ccdc_data_size {
  24. VPFE_CCDC_DATA_16BITS = 0,
  25. VPFE_CCDC_DATA_15BITS,
  26. VPFE_CCDC_DATA_14BITS,
  27. VPFE_CCDC_DATA_13BITS,
  28. VPFE_CCDC_DATA_12BITS,
  29. VPFE_CCDC_DATA_11BITS,
  30. VPFE_CCDC_DATA_10BITS,
  31. VPFE_CCDC_DATA_8BITS,
  32. };
  33. /* enum for No of pixel per line to be avg. in Black Clamping*/
  34. enum vpfe_ccdc_sample_length {
  35. VPFE_CCDC_SAMPLE_1PIXELS = 0,
  36. VPFE_CCDC_SAMPLE_2PIXELS,
  37. VPFE_CCDC_SAMPLE_4PIXELS,
  38. VPFE_CCDC_SAMPLE_8PIXELS,
  39. VPFE_CCDC_SAMPLE_16PIXELS,
  40. };
  41. /* enum for No of lines in Black Clamping */
  42. enum vpfe_ccdc_sample_line {
  43. VPFE_CCDC_SAMPLE_1LINES = 0,
  44. VPFE_CCDC_SAMPLE_2LINES,
  45. VPFE_CCDC_SAMPLE_4LINES,
  46. VPFE_CCDC_SAMPLE_8LINES,
  47. VPFE_CCDC_SAMPLE_16LINES,
  48. };
  49. /* enum for Alaw gamma width */
  50. enum vpfe_ccdc_gamma_width {
  51. VPFE_CCDC_GAMMA_BITS_15_6 = 0, /* use bits 15-6 for gamma */
  52. VPFE_CCDC_GAMMA_BITS_14_5,
  53. VPFE_CCDC_GAMMA_BITS_13_4,
  54. VPFE_CCDC_GAMMA_BITS_12_3,
  55. VPFE_CCDC_GAMMA_BITS_11_2,
  56. VPFE_CCDC_GAMMA_BITS_10_1,
  57. VPFE_CCDC_GAMMA_BITS_09_0, /* use bits 9-0 for gamma */
  58. };
  59. /* structure for ALaw */
  60. struct vpfe_ccdc_a_law {
  61. /* Enable/disable A-Law */
  62. unsigned char enable;
  63. /* Gamma Width Input */
  64. enum vpfe_ccdc_gamma_width gamma_wd;
  65. };
  66. /* structure for Black Clamping */
  67. struct vpfe_ccdc_black_clamp {
  68. unsigned char enable;
  69. /* only if bClampEnable is TRUE */
  70. enum vpfe_ccdc_sample_length sample_pixel;
  71. /* only if bClampEnable is TRUE */
  72. enum vpfe_ccdc_sample_line sample_ln;
  73. /* only if bClampEnable is TRUE */
  74. unsigned short start_pixel;
  75. /* only if bClampEnable is TRUE */
  76. unsigned short sgain;
  77. /* only if bClampEnable is FALSE */
  78. unsigned short dc_sub;
  79. };
  80. /* structure for Black Level Compensation */
  81. struct vpfe_ccdc_black_compensation {
  82. /* Constant value to subtract from Red component */
  83. char r;
  84. /* Constant value to subtract from Gr component */
  85. char gr;
  86. /* Constant value to subtract from Blue component */
  87. char b;
  88. /* Constant value to subtract from Gb component */
  89. char gb;
  90. };
  91. /* Structure for CCDC configuration parameters for raw capture mode passed
  92. * by application
  93. */
  94. struct vpfe_ccdc_config_params_raw {
  95. /* data size value from 8 to 16 bits */
  96. enum vpfe_ccdc_data_size data_sz;
  97. /* Structure for Optional A-Law */
  98. struct vpfe_ccdc_a_law alaw;
  99. /* Structure for Optical Black Clamp */
  100. struct vpfe_ccdc_black_clamp blk_clamp;
  101. /* Structure for Black Compensation */
  102. struct vpfe_ccdc_black_compensation blk_comp;
  103. };
  104. /*
  105. * Private IOCTL
  106. * VIDIOC_AM437X_CCDC_CFG - Set CCDC configuration for raw capture
  107. * This is an experimental ioctl that will change in future kernels. So use
  108. * this ioctl with care !
  109. **/
  110. #define VIDIOC_AM437X_CCDC_CFG \
  111. _IOW('V', BASE_VIDIOC_PRIVATE + 1, void *)
  112. #endif /* AM437X_VPFE_USER_H */