s5p_fimc.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Samsung S5P SoC camera interface driver header
  3. *
  4. * Copyright (c) 2010 Samsung Electronics Co., Ltd
  5. * Author: 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. enum cam_bus_type {
  15. FIMC_ITU_601 = 1,
  16. FIMC_ITU_656,
  17. FIMC_MIPI_CSI2,
  18. FIMC_LCD_WB, /* FIFO link from LCD mixer */
  19. };
  20. struct i2c_board_info;
  21. /**
  22. * struct s5p_fimc_isp_info - image sensor information required for host
  23. * interace configuration.
  24. *
  25. * @board_info: pointer to I2C subdevice's board info
  26. * @clk_frequency: frequency of the clock the host interface provides to sensor
  27. * @bus_type: determines bus type, MIPI, ITU-R BT.601 etc.
  28. * @csi_data_align: MIPI-CSI interface data alignment in bits
  29. * @i2c_bus_num: i2c control bus id the sensor is attached to
  30. * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
  31. * @clk_id: index of the SoC peripheral clock for sensors
  32. * @flags: the parallel bus flags defining signals polarity (V4L2_MBUS_*)
  33. */
  34. struct s5p_fimc_isp_info {
  35. struct i2c_board_info *board_info;
  36. unsigned long clk_frequency;
  37. enum cam_bus_type bus_type;
  38. u16 csi_data_align;
  39. u16 i2c_bus_num;
  40. u16 mux_id;
  41. u16 flags;
  42. u8 clk_id;
  43. };
  44. /**
  45. * struct s5p_platform_fimc - camera host interface platform data
  46. *
  47. * @isp_info: properties of camera sensor required for host interface setup
  48. * @num_clients: the number of attached image sensors
  49. */
  50. struct s5p_platform_fimc {
  51. struct s5p_fimc_isp_info *isp_info;
  52. int num_clients;
  53. };
  54. /*
  55. * v4l2_device notification id. This is only for internal use in the kernel.
  56. * Sensor subdevs should issue S5P_FIMC_TX_END_NOTIFY notification in single
  57. * frame capture mode when there is only one VSYNC pulse issued by the sensor
  58. * at begining of the frame transmission.
  59. */
  60. #define S5P_FIMC_TX_END_NOTIFY _IO('e', 0)
  61. enum fimc_subdev_index {
  62. IDX_SENSOR,
  63. IDX_CSIS,
  64. IDX_FLITE,
  65. IDX_FIMC,
  66. IDX_MAX,
  67. };
  68. struct media_pipeline;
  69. struct v4l2_subdev;
  70. struct fimc_pipeline {
  71. struct v4l2_subdev *subdevs[IDX_MAX];
  72. struct media_pipeline *m_pipeline;
  73. };
  74. /*
  75. * Media pipeline operations to be called from within the fimc(-lite)
  76. * video node when it is the last entity of the pipeline. Implemented
  77. * by corresponding media device driver.
  78. */
  79. struct fimc_pipeline_ops {
  80. int (*open)(struct fimc_pipeline *p, struct media_entity *me,
  81. bool resume);
  82. int (*close)(struct fimc_pipeline *p);
  83. int (*set_stream)(struct fimc_pipeline *p, bool state);
  84. };
  85. #define fimc_pipeline_call(f, op, p, args...) \
  86. (!(f) ? -ENODEV : (((f)->pipeline_ops && (f)->pipeline_ops->op) ? \
  87. (f)->pipeline_ops->op((p), ##args) : -ENOIOCTLCMD))
  88. #endif /* S5P_FIMC_H_ */