s5p_fimc.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. * @i2c_bus_num: i2c control bus id the sensor is attached to
  29. * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
  30. * @clk_id: index of the SoC peripheral clock for sensors
  31. * @flags: the parallel bus flags defining signals polarity (V4L2_MBUS_*)
  32. */
  33. struct s5p_fimc_isp_info {
  34. struct i2c_board_info *board_info;
  35. unsigned long clk_frequency;
  36. enum cam_bus_type bus_type;
  37. u16 i2c_bus_num;
  38. u16 mux_id;
  39. u16 flags;
  40. u8 clk_id;
  41. };
  42. /**
  43. * struct s5p_platform_fimc - camera host interface platform data
  44. *
  45. * @isp_info: properties of camera sensor required for host interface setup
  46. * @num_clients: the number of attached image sensors
  47. */
  48. struct s5p_platform_fimc {
  49. struct s5p_fimc_isp_info *isp_info;
  50. int num_clients;
  51. };
  52. /*
  53. * v4l2_device notification id. This is only for internal use in the kernel.
  54. * Sensor subdevs should issue S5P_FIMC_TX_END_NOTIFY notification in single
  55. * frame capture mode when there is only one VSYNC pulse issued by the sensor
  56. * at begining of the frame transmission.
  57. */
  58. #define S5P_FIMC_TX_END_NOTIFY _IO('e', 0)
  59. enum fimc_subdev_index {
  60. IDX_SENSOR,
  61. IDX_CSIS,
  62. IDX_FLITE,
  63. IDX_FIMC,
  64. IDX_MAX,
  65. };
  66. struct media_pipeline;
  67. struct v4l2_subdev;
  68. struct fimc_pipeline {
  69. struct v4l2_subdev *subdevs[IDX_MAX];
  70. struct media_pipeline *m_pipeline;
  71. };
  72. /*
  73. * Media pipeline operations to be called from within the fimc(-lite)
  74. * video node when it is the last entity of the pipeline. Implemented
  75. * by corresponding media device driver.
  76. */
  77. struct fimc_pipeline_ops {
  78. int (*open)(struct fimc_pipeline *p, struct media_entity *me,
  79. bool resume);
  80. int (*close)(struct fimc_pipeline *p);
  81. int (*set_stream)(struct fimc_pipeline *p, bool state);
  82. };
  83. #define fimc_pipeline_call(f, op, p, args...) \
  84. (!(f) ? -ENODEV : (((f)->pipeline_ops && (f)->pipeline_ops->op) ? \
  85. (f)->pipeline_ops->op((p), ##args) : -ENOIOCTLCMD))
  86. #endif /* S5P_FIMC_H_ */