0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef S5P_FIMC_H_
0010 #define S5P_FIMC_H_
0011
0012 #include <media/media-entity.h>
0013 #include <media/v4l2-dev.h>
0014 #include <media/v4l2-mediabus.h>
0015
0016
0017
0018
0019 enum fimc_input {
0020 FIMC_INPUT_PARALLEL_0 = 1,
0021 FIMC_INPUT_PARALLEL_1,
0022 FIMC_INPUT_MIPI_CSI2_0 = 3,
0023 FIMC_INPUT_MIPI_CSI2_1,
0024 FIMC_INPUT_WRITEBACK_A = 5,
0025 FIMC_INPUT_WRITEBACK_B,
0026 FIMC_INPUT_WRITEBACK_ISP = 5,
0027 };
0028
0029
0030
0031
0032 enum fimc_bus_type {
0033
0034 FIMC_BUS_TYPE_ITU_601 = 1,
0035
0036 FIMC_BUS_TYPE_ITU_656,
0037
0038 FIMC_BUS_TYPE_MIPI_CSI2,
0039
0040 FIMC_BUS_TYPE_LCD_WRITEBACK_A,
0041
0042 FIMC_BUS_TYPE_LCD_WRITEBACK_B,
0043
0044 FIMC_BUS_TYPE_ISP_WRITEBACK = FIMC_BUS_TYPE_LCD_WRITEBACK_B,
0045 };
0046
0047 #define fimc_input_is_parallel(x) ((x) == 1 || (x) == 2)
0048 #define fimc_input_is_mipi_csi(x) ((x) == 3 || (x) == 4)
0049
0050
0051
0052
0053 #define GRP_ID_SENSOR (1 << 8)
0054 #define GRP_ID_FIMC_IS_SENSOR (1 << 9)
0055 #define GRP_ID_WRITEBACK (1 << 10)
0056 #define GRP_ID_CSIS (1 << 11)
0057 #define GRP_ID_FIMC (1 << 12)
0058 #define GRP_ID_FLITE (1 << 13)
0059 #define GRP_ID_FIMC_IS (1 << 14)
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070 struct fimc_source_info {
0071 enum fimc_bus_type fimc_bus_type;
0072 enum fimc_bus_type sensor_bus_type;
0073 u16 flags;
0074 u16 mux_id;
0075 };
0076
0077
0078
0079
0080
0081
0082
0083 #define S5P_FIMC_TX_END_NOTIFY _IO('e', 0)
0084
0085 #define FIMC_MAX_PLANES 3
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099 struct fimc_fmt {
0100 u32 mbus_code;
0101 u32 fourcc;
0102 u32 color;
0103 u16 memplanes;
0104 u16 colplanes;
0105 u8 colorspace;
0106 u8 depth[FIMC_MAX_PLANES];
0107 u16 mdataplanes;
0108 u16 flags;
0109 #define FMT_FLAGS_CAM (1 << 0)
0110 #define FMT_FLAGS_M2M_IN (1 << 1)
0111 #define FMT_FLAGS_M2M_OUT (1 << 2)
0112 #define FMT_FLAGS_M2M (1 << 1 | 1 << 2)
0113 #define FMT_HAS_ALPHA (1 << 3)
0114 #define FMT_FLAGS_COMPRESSED (1 << 4)
0115 #define FMT_FLAGS_WRITEBACK (1 << 5)
0116 #define FMT_FLAGS_RAW_BAYER (1 << 6)
0117 #define FMT_FLAGS_YUV (1 << 7)
0118 };
0119
0120 struct exynos_media_pipeline;
0121
0122
0123
0124
0125
0126 struct exynos_media_pipeline_ops {
0127 int (*prepare)(struct exynos_media_pipeline *p,
0128 struct media_entity *me);
0129 int (*unprepare)(struct exynos_media_pipeline *p);
0130 int (*open)(struct exynos_media_pipeline *p, struct media_entity *me,
0131 bool resume);
0132 int (*close)(struct exynos_media_pipeline *p);
0133 int (*set_stream)(struct exynos_media_pipeline *p, bool state);
0134 };
0135
0136 struct exynos_video_entity {
0137 struct video_device vdev;
0138 struct exynos_media_pipeline *pipe;
0139 };
0140
0141 struct exynos_media_pipeline {
0142 struct media_pipeline mp;
0143 const struct exynos_media_pipeline_ops *ops;
0144 };
0145
0146 static inline struct exynos_video_entity *vdev_to_exynos_video_entity(
0147 struct video_device *vdev)
0148 {
0149 return container_of(vdev, struct exynos_video_entity, vdev);
0150 }
0151
0152 #define fimc_pipeline_call(ent, op, args...) \
0153 ((!(ent) || !(ent)->pipe) ? -ENOENT : \
0154 (((ent)->pipe->ops && (ent)->pipe->ops->op) ? \
0155 (ent)->pipe->ops->op(((ent)->pipe), ##args) : -ENOIOCTLCMD)) \
0156
0157 #endif