omap3isp.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. * omap3isp.h
  3. *
  4. * TI OMAP3 ISP - Platform data
  5. *
  6. * Copyright (C) 2011 Nokia Corporation
  7. *
  8. * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  9. * Sakari Ailus <sakari.ailus@iki.fi>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  23. * 02110-1301 USA
  24. */
  25. #ifndef __MEDIA_OMAP3ISP_H__
  26. #define __MEDIA_OMAP3ISP_H__
  27. struct i2c_board_info;
  28. struct isp_device;
  29. enum isp_interface_type {
  30. ISP_INTERFACE_PARALLEL,
  31. ISP_INTERFACE_CSI2A_PHY2,
  32. ISP_INTERFACE_CCP2B_PHY1,
  33. ISP_INTERFACE_CCP2B_PHY2,
  34. ISP_INTERFACE_CSI2C_PHY1,
  35. };
  36. enum {
  37. ISP_BRIDGE_DISABLE = 0,
  38. ISP_BRIDGE_LITTLE_ENDIAN = 2,
  39. ISP_BRIDGE_BIG_ENDIAN = 3,
  40. };
  41. enum {
  42. ISP_LANE_SHIFT_0 = 0,
  43. ISP_LANE_SHIFT_2 = 1,
  44. ISP_LANE_SHIFT_4 = 2,
  45. ISP_LANE_SHIFT_6 = 3,
  46. };
  47. /**
  48. * struct isp_parallel_platform_data - Parallel interface platform data
  49. * @data_lane_shift: Data lane shifter
  50. * ISP_LANE_SHIFT_0 - CAMEXT[13:0] -> CAM[13:0]
  51. * ISP_LANE_SHIFT_2 - CAMEXT[13:2] -> CAM[11:0]
  52. * ISP_LANE_SHIFT_4 - CAMEXT[13:4] -> CAM[9:0]
  53. * ISP_LANE_SHIFT_6 - CAMEXT[13:6] -> CAM[7:0]
  54. * @clk_pol: Pixel clock polarity
  55. * 0 - Sample on rising edge, 1 - Sample on falling edge
  56. * @hs_pol: Horizontal synchronization polarity
  57. * 0 - Active high, 1 - Active low
  58. * @vs_pol: Vertical synchronization polarity
  59. * 0 - Active high, 1 - Active low
  60. * @bridge: CCDC Bridge input control
  61. * ISP_BRIDGE_DISABLE - Disable
  62. * ISP_BRIDGE_LITTLE_ENDIAN - Little endian
  63. * ISP_BRIDGE_BIG_ENDIAN - Big endian
  64. */
  65. struct isp_parallel_platform_data {
  66. unsigned int data_lane_shift:2;
  67. unsigned int clk_pol:1;
  68. unsigned int hs_pol:1;
  69. unsigned int vs_pol:1;
  70. unsigned int bridge:2;
  71. };
  72. enum {
  73. ISP_CCP2_PHY_DATA_CLOCK = 0,
  74. ISP_CCP2_PHY_DATA_STROBE = 1,
  75. };
  76. enum {
  77. ISP_CCP2_MODE_MIPI = 0,
  78. ISP_CCP2_MODE_CCP2 = 1,
  79. };
  80. /**
  81. * struct isp_ccp2_platform_data - CCP2 interface platform data
  82. * @strobe_clk_pol: Strobe/clock polarity
  83. * 0 - Non Inverted, 1 - Inverted
  84. * @crc: Enable the cyclic redundancy check
  85. * @ccp2_mode: Enable CCP2 compatibility mode
  86. * ISP_CCP2_MODE_MIPI - MIPI-CSI1 mode
  87. * ISP_CCP2_MODE_CCP2 - CCP2 mode
  88. * @phy_layer: Physical layer selection
  89. * ISP_CCP2_PHY_DATA_CLOCK - Data/clock physical layer
  90. * ISP_CCP2_PHY_DATA_STROBE - Data/strobe physical layer
  91. * @vpclk_div: Video port output clock control
  92. */
  93. struct isp_ccp2_platform_data {
  94. unsigned int strobe_clk_pol:1;
  95. unsigned int crc:1;
  96. unsigned int ccp2_mode:1;
  97. unsigned int phy_layer:1;
  98. unsigned int vpclk_div:2;
  99. };
  100. /**
  101. * struct isp_csi2_platform_data - CSI2 interface platform data
  102. * @crc: Enable the cyclic redundancy check
  103. * @vpclk_div: Video port output clock control
  104. */
  105. struct isp_csi2_platform_data {
  106. unsigned crc:1;
  107. unsigned vpclk_div:2;
  108. };
  109. struct isp_subdev_i2c_board_info {
  110. struct i2c_board_info *board_info;
  111. int i2c_adapter_id;
  112. };
  113. struct isp_v4l2_subdevs_group {
  114. struct isp_subdev_i2c_board_info *subdevs;
  115. enum isp_interface_type interface;
  116. union {
  117. struct isp_parallel_platform_data parallel;
  118. struct isp_ccp2_platform_data ccp2;
  119. struct isp_csi2_platform_data csi2;
  120. } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */
  121. };
  122. struct isp_platform_data {
  123. struct isp_v4l2_subdevs_group *subdevs;
  124. void (*set_constraints)(struct isp_device *isp, bool enable);
  125. };
  126. #endif /* __MEDIA_OMAP3ISP_H__ */