s5p_fimc.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*
  2. * Samsung S5P/Exynos4 SoC series camera interface driver header
  3. *
  4. * Copyright (C) 2010 - 2013 Samsung Electronics Co., Ltd.
  5. * Sylwester Nawrocki <s.nawrocki@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef S5P_FIMC_H_
  12. #define S5P_FIMC_H_
  13. #include <media/media-entity.h>
  14. /*
  15. * Enumeration of data inputs to the camera subsystem.
  16. */
  17. enum fimc_input {
  18. FIMC_INPUT_PARALLEL_0 = 1,
  19. FIMC_INPUT_PARALLEL_1,
  20. FIMC_INPUT_MIPI_CSI2_0 = 3,
  21. FIMC_INPUT_MIPI_CSI2_1,
  22. FIMC_INPUT_WRITEBACK_A = 5,
  23. FIMC_INPUT_WRITEBACK_B,
  24. FIMC_INPUT_WRITEBACK_ISP = 5,
  25. };
  26. /*
  27. * Enumeration of the FIMC data bus types.
  28. */
  29. enum fimc_bus_type {
  30. /* Camera parallel bus */
  31. FIMC_BUS_TYPE_ITU_601 = 1,
  32. /* Camera parallel bus with embedded synchronization */
  33. FIMC_BUS_TYPE_ITU_656,
  34. /* Camera MIPI-CSI2 serial bus */
  35. FIMC_BUS_TYPE_MIPI_CSI2,
  36. /* FIFO link from LCD controller (WriteBack A) */
  37. FIMC_BUS_TYPE_LCD_WRITEBACK_A,
  38. /* FIFO link from LCD controller (WriteBack B) */
  39. FIMC_BUS_TYPE_LCD_WRITEBACK_B,
  40. /* FIFO link from FIMC-IS */
  41. FIMC_BUS_TYPE_ISP_WRITEBACK = FIMC_BUS_TYPE_LCD_WRITEBACK_B,
  42. };
  43. struct i2c_board_info;
  44. /**
  45. * struct fimc_source_info - video source description required for the host
  46. * interface configuration
  47. *
  48. * @board_info: pointer to I2C subdevice's board info
  49. * @clk_frequency: frequency of the clock the host interface provides to sensor
  50. * @fimc_bus_type: FIMC camera input type
  51. * @sensor_bus_type: image sensor bus type, MIPI, ITU-R BT.601 etc.
  52. * @flags: the parallel sensor bus flags defining signals polarity (V4L2_MBUS_*)
  53. * @i2c_bus_num: i2c control bus id the sensor is attached to
  54. * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
  55. * @clk_id: index of the SoC peripheral clock for sensors
  56. */
  57. struct fimc_source_info {
  58. struct i2c_board_info *board_info;
  59. unsigned long clk_frequency;
  60. enum fimc_bus_type fimc_bus_type;
  61. enum fimc_bus_type sensor_bus_type;
  62. u16 flags;
  63. u16 i2c_bus_num;
  64. u16 mux_id;
  65. u8 clk_id;
  66. };
  67. /**
  68. * struct s5p_platform_fimc - camera host interface platform data
  69. *
  70. * @source_info: properties of an image source for the host interface setup
  71. * @num_clients: the number of attached image sources
  72. */
  73. struct s5p_platform_fimc {
  74. struct fimc_source_info *source_info;
  75. int num_clients;
  76. };
  77. /*
  78. * v4l2_device notification id. This is only for internal use in the kernel.
  79. * Sensor subdevs should issue S5P_FIMC_TX_END_NOTIFY notification in single
  80. * frame capture mode when there is only one VSYNC pulse issued by the sensor
  81. * at begining of the frame transmission.
  82. */
  83. #define S5P_FIMC_TX_END_NOTIFY _IO('e', 0)
  84. enum fimc_subdev_index {
  85. IDX_SENSOR,
  86. IDX_CSIS,
  87. IDX_FLITE,
  88. IDX_IS_ISP,
  89. IDX_FIMC,
  90. IDX_MAX,
  91. };
  92. struct media_pipeline;
  93. struct v4l2_subdev;
  94. struct fimc_pipeline {
  95. struct v4l2_subdev *subdevs[IDX_MAX];
  96. struct media_pipeline *m_pipeline;
  97. };
  98. /*
  99. * Media pipeline operations to be called from within the fimc(-lite)
  100. * video node when it is the last entity of the pipeline. Implemented
  101. * by corresponding media device driver.
  102. */
  103. struct fimc_pipeline_ops {
  104. int (*open)(struct fimc_pipeline *p, struct media_entity *me,
  105. bool resume);
  106. int (*close)(struct fimc_pipeline *p);
  107. int (*set_stream)(struct fimc_pipeline *p, bool state);
  108. };
  109. #define fimc_pipeline_call(f, op, p, args...) \
  110. (!(f) ? -ENODEV : (((f)->pipeline_ops && (f)->pipeline_ops->op) ? \
  111. (f)->pipeline_ops->op((p), ##args) : -ENOIOCTLCMD))
  112. #endif /* S5P_FIMC_H_ */