s5p_fimc.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 the FIMC data bus types.
  16. */
  17. enum fimc_bus_type {
  18. /* Camera parallel bus */
  19. FIMC_BUS_TYPE_ITU_601 = 1,
  20. /* Camera parallel bus with embedded synchronization */
  21. FIMC_BUS_TYPE_ITU_656,
  22. /* Camera MIPI-CSI2 serial bus */
  23. FIMC_BUS_TYPE_MIPI_CSI2,
  24. /* FIFO link from LCD controller (WriteBack A) */
  25. FIMC_BUS_TYPE_LCD_WRITEBACK_A,
  26. /* FIFO link from LCD controller (WriteBack B) */
  27. FIMC_BUS_TYPE_LCD_WRITEBACK_B,
  28. /* FIFO link from FIMC-IS */
  29. FIMC_BUS_TYPE_ISP_WRITEBACK = FIMC_BUS_TYPE_LCD_WRITEBACK_B,
  30. };
  31. struct i2c_board_info;
  32. /**
  33. * struct fimc_source_info - video source description required for the host
  34. * interface configuration
  35. *
  36. * @board_info: pointer to I2C subdevice's board info
  37. * @clk_frequency: frequency of the clock the host interface provides to sensor
  38. * @fimc_bus_type: FIMC camera input type
  39. * @sensor_bus_type: image sensor bus type, MIPI, ITU-R BT.601 etc.
  40. * @flags: the parallel sensor bus flags defining signals polarity (V4L2_MBUS_*)
  41. * @i2c_bus_num: i2c control bus id the sensor is attached to
  42. * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
  43. * @clk_id: index of the SoC peripheral clock for sensors
  44. */
  45. struct fimc_source_info {
  46. struct i2c_board_info *board_info;
  47. unsigned long clk_frequency;
  48. enum fimc_bus_type fimc_bus_type;
  49. enum fimc_bus_type sensor_bus_type;
  50. u16 flags;
  51. u16 i2c_bus_num;
  52. u16 mux_id;
  53. u8 clk_id;
  54. };
  55. /**
  56. * struct s5p_platform_fimc - camera host interface platform data
  57. *
  58. * @source_info: properties of an image source for the host interface setup
  59. * @num_clients: the number of attached image sources
  60. */
  61. struct s5p_platform_fimc {
  62. struct fimc_source_info *source_info;
  63. int num_clients;
  64. };
  65. /*
  66. * v4l2_device notification id. This is only for internal use in the kernel.
  67. * Sensor subdevs should issue S5P_FIMC_TX_END_NOTIFY notification in single
  68. * frame capture mode when there is only one VSYNC pulse issued by the sensor
  69. * at begining of the frame transmission.
  70. */
  71. #define S5P_FIMC_TX_END_NOTIFY _IO('e', 0)
  72. enum fimc_subdev_index {
  73. IDX_SENSOR,
  74. IDX_CSIS,
  75. IDX_FLITE,
  76. IDX_FIMC,
  77. IDX_MAX,
  78. };
  79. struct media_pipeline;
  80. struct v4l2_subdev;
  81. struct fimc_pipeline {
  82. struct v4l2_subdev *subdevs[IDX_MAX];
  83. struct media_pipeline *m_pipeline;
  84. };
  85. /*
  86. * Media pipeline operations to be called from within the fimc(-lite)
  87. * video node when it is the last entity of the pipeline. Implemented
  88. * by corresponding media device driver.
  89. */
  90. struct fimc_pipeline_ops {
  91. int (*open)(struct fimc_pipeline *p, struct media_entity *me,
  92. bool resume);
  93. int (*close)(struct fimc_pipeline *p);
  94. int (*set_stream)(struct fimc_pipeline *p, bool state);
  95. };
  96. #define fimc_pipeline_call(f, op, p, args...) \
  97. (!(f) ? -ENODEV : (((f)->pipeline_ops && (f)->pipeline_ops->op) ? \
  98. (f)->pipeline_ops->op((p), ##args) : -ENOIOCTLCMD))
  99. #endif /* S5P_FIMC_H_ */