ispccp2.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * ispccp2.h
  3. *
  4. * TI OMAP3 ISP - CCP2 module
  5. *
  6. * Copyright (C) 2010 Nokia Corporation
  7. * Copyright (C) 2010 Texas Instruments, Inc.
  8. *
  9. * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  10. * Sakari Ailus <sakari.ailus@iki.fi>
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  24. * 02110-1301 USA
  25. */
  26. #ifndef OMAP3_ISP_CCP2_H
  27. #define OMAP3_ISP_CCP2_H
  28. #include <linux/videodev2.h>
  29. struct isp_device;
  30. struct isp_csiphy;
  31. /* Sink and source ccp2 pads */
  32. #define CCP2_PAD_SINK 0
  33. #define CCP2_PAD_SOURCE 1
  34. #define CCP2_PADS_NUM 2
  35. /* CCP2 input media entity */
  36. enum ccp2_input_entity {
  37. CCP2_INPUT_NONE,
  38. CCP2_INPUT_SENSOR,
  39. CCP2_INPUT_MEMORY,
  40. };
  41. /* CCP2 output media entity */
  42. enum ccp2_output_entity {
  43. CCP2_OUTPUT_NONE,
  44. CCP2_OUTPUT_CCDC,
  45. CCP2_OUTPUT_MEMORY,
  46. };
  47. /* Logical channel configuration */
  48. struct isp_interface_lcx_config {
  49. int crc;
  50. u32 data_start;
  51. u32 data_size;
  52. u32 format;
  53. };
  54. /* Memory channel configuration */
  55. struct isp_interface_mem_config {
  56. u32 dst_port;
  57. u32 vsize_count;
  58. u32 hsize_count;
  59. u32 src_ofst;
  60. u32 dst_ofst;
  61. };
  62. /* CCP2 device */
  63. struct isp_ccp2_device {
  64. struct v4l2_subdev subdev;
  65. struct v4l2_mbus_framefmt formats[CCP2_PADS_NUM];
  66. struct media_pad pads[CCP2_PADS_NUM];
  67. enum ccp2_input_entity input;
  68. enum ccp2_output_entity output;
  69. struct isp_interface_lcx_config if_cfg;
  70. struct isp_interface_mem_config mem_cfg;
  71. struct isp_video video_in;
  72. struct isp_csiphy *phy;
  73. struct regulator *vdds_csib;
  74. enum isp_pipeline_stream_state state;
  75. wait_queue_head_t wait;
  76. atomic_t stopping;
  77. };
  78. /* Function declarations */
  79. int omap3isp_ccp2_init(struct isp_device *isp);
  80. void omap3isp_ccp2_cleanup(struct isp_device *isp);
  81. int omap3isp_ccp2_register_entities(struct isp_ccp2_device *ccp2,
  82. struct v4l2_device *vdev);
  83. void omap3isp_ccp2_unregister_entities(struct isp_ccp2_device *ccp2);
  84. void omap3isp_ccp2_isr(struct isp_ccp2_device *ccp2);
  85. #endif /* OMAP3_ISP_CCP2_H */