ispccp2.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. #ifndef OMAP3_ISP_CCP2_H
  17. #define OMAP3_ISP_CCP2_H
  18. #include <linux/videodev2.h>
  19. struct isp_device;
  20. struct isp_csiphy;
  21. /* Sink and source ccp2 pads */
  22. #define CCP2_PAD_SINK 0
  23. #define CCP2_PAD_SOURCE 1
  24. #define CCP2_PADS_NUM 2
  25. /* CCP2 input media entity */
  26. enum ccp2_input_entity {
  27. CCP2_INPUT_NONE,
  28. CCP2_INPUT_SENSOR,
  29. CCP2_INPUT_MEMORY,
  30. };
  31. /* CCP2 output media entity */
  32. enum ccp2_output_entity {
  33. CCP2_OUTPUT_NONE,
  34. CCP2_OUTPUT_CCDC,
  35. CCP2_OUTPUT_MEMORY,
  36. };
  37. /* Logical channel configuration */
  38. struct isp_interface_lcx_config {
  39. int crc;
  40. u32 data_start;
  41. u32 data_size;
  42. u32 format;
  43. };
  44. /* Memory channel configuration */
  45. struct isp_interface_mem_config {
  46. u32 dst_port;
  47. u32 vsize_count;
  48. u32 hsize_count;
  49. u32 src_ofst;
  50. u32 dst_ofst;
  51. };
  52. /* CCP2 device */
  53. struct isp_ccp2_device {
  54. struct v4l2_subdev subdev;
  55. struct v4l2_mbus_framefmt formats[CCP2_PADS_NUM];
  56. struct media_pad pads[CCP2_PADS_NUM];
  57. enum ccp2_input_entity input;
  58. enum ccp2_output_entity output;
  59. struct isp_interface_lcx_config if_cfg;
  60. struct isp_interface_mem_config mem_cfg;
  61. struct isp_video video_in;
  62. struct isp_csiphy *phy;
  63. struct regulator *vdds_csib;
  64. enum isp_pipeline_stream_state state;
  65. wait_queue_head_t wait;
  66. atomic_t stopping;
  67. };
  68. /* Function declarations */
  69. int omap3isp_ccp2_init(struct isp_device *isp);
  70. void omap3isp_ccp2_cleanup(struct isp_device *isp);
  71. int omap3isp_ccp2_register_entities(struct isp_ccp2_device *ccp2,
  72. struct v4l2_device *vdev);
  73. void omap3isp_ccp2_unregister_entities(struct isp_ccp2_device *ccp2);
  74. void omap3isp_ccp2_isr(struct isp_ccp2_device *ccp2);
  75. #endif /* OMAP3_ISP_CCP2_H */