omap3isp.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * omap3isp.h
  3. *
  4. * TI OMAP3 ISP - Bus Configuration
  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. #ifndef __OMAP3ISP_H__
  21. #define __OMAP3ISP_H__
  22. enum isp_interface_type {
  23. ISP_INTERFACE_PARALLEL,
  24. ISP_INTERFACE_CSI2A_PHY2,
  25. ISP_INTERFACE_CCP2B_PHY1,
  26. ISP_INTERFACE_CCP2B_PHY2,
  27. ISP_INTERFACE_CSI2C_PHY1,
  28. };
  29. /**
  30. * struct isp_parallel_cfg - Parallel interface configuration
  31. * @data_lane_shift: Data lane shifter
  32. * 0 - CAMEXT[13:0] -> CAM[13:0]
  33. * 1 - CAMEXT[13:2] -> CAM[11:0]
  34. * 2 - CAMEXT[13:4] -> CAM[9:0]
  35. * 3 - CAMEXT[13:6] -> CAM[7:0]
  36. * @clk_pol: Pixel clock polarity
  37. * 0 - Sample on rising edge, 1 - Sample on falling edge
  38. * @hs_pol: Horizontal synchronization polarity
  39. * 0 - Active high, 1 - Active low
  40. * @vs_pol: Vertical synchronization polarity
  41. * 0 - Active high, 1 - Active low
  42. * @fld_pol: Field signal polarity
  43. * 0 - Positive, 1 - Negative
  44. * @data_pol: Data polarity
  45. * 0 - Normal, 1 - One's complement
  46. */
  47. struct isp_parallel_cfg {
  48. unsigned int data_lane_shift:2;
  49. unsigned int clk_pol:1;
  50. unsigned int hs_pol:1;
  51. unsigned int vs_pol:1;
  52. unsigned int fld_pol:1;
  53. unsigned int data_pol:1;
  54. };
  55. enum {
  56. ISP_CCP2_PHY_DATA_CLOCK = 0,
  57. ISP_CCP2_PHY_DATA_STROBE = 1,
  58. };
  59. enum {
  60. ISP_CCP2_MODE_MIPI = 0,
  61. ISP_CCP2_MODE_CCP2 = 1,
  62. };
  63. /**
  64. * struct isp_csiphy_lane: CCP2/CSI2 lane position and polarity
  65. * @pos: position of the lane
  66. * @pol: polarity of the lane
  67. */
  68. struct isp_csiphy_lane {
  69. u8 pos;
  70. u8 pol;
  71. };
  72. #define ISP_CSIPHY1_NUM_DATA_LANES 1
  73. #define ISP_CSIPHY2_NUM_DATA_LANES 2
  74. /**
  75. * struct isp_csiphy_lanes_cfg - CCP2/CSI2 lane configuration
  76. * @data: Configuration of one or two data lanes
  77. * @clk: Clock lane configuration
  78. */
  79. struct isp_csiphy_lanes_cfg {
  80. struct isp_csiphy_lane data[ISP_CSIPHY2_NUM_DATA_LANES];
  81. struct isp_csiphy_lane clk;
  82. };
  83. /**
  84. * struct isp_ccp2_cfg - CCP2 interface configuration
  85. * @strobe_clk_pol: Strobe/clock polarity
  86. * 0 - Non Inverted, 1 - Inverted
  87. * @crc: Enable the cyclic redundancy check
  88. * @ccp2_mode: Enable CCP2 compatibility mode
  89. * ISP_CCP2_MODE_MIPI - MIPI-CSI1 mode
  90. * ISP_CCP2_MODE_CCP2 - CCP2 mode
  91. * @phy_layer: Physical layer selection
  92. * ISP_CCP2_PHY_DATA_CLOCK - Data/clock physical layer
  93. * ISP_CCP2_PHY_DATA_STROBE - Data/strobe physical layer
  94. * @vpclk_div: Video port output clock control
  95. */
  96. struct isp_ccp2_cfg {
  97. unsigned int strobe_clk_pol:1;
  98. unsigned int crc:1;
  99. unsigned int ccp2_mode:1;
  100. unsigned int phy_layer:1;
  101. unsigned int vpclk_div:2;
  102. struct isp_csiphy_lanes_cfg lanecfg;
  103. };
  104. /**
  105. * struct isp_csi2_cfg - CSI2 interface configuration
  106. * @crc: Enable the cyclic redundancy check
  107. */
  108. struct isp_csi2_cfg {
  109. unsigned crc:1;
  110. struct isp_csiphy_lanes_cfg lanecfg;
  111. };
  112. struct isp_bus_cfg {
  113. enum isp_interface_type interface;
  114. union {
  115. struct isp_parallel_cfg parallel;
  116. struct isp_ccp2_cfg ccp2;
  117. struct isp_csi2_cfg csi2;
  118. } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */
  119. };
  120. #endif /* __OMAP3ISP_H__ */