1
2
3
4
5
6
7
8
9
10
11
12#ifndef S5P_FIMC_H_
13#define S5P_FIMC_H_
14
15#include <media/media-entity.h>
16#include <media/v4l2-dev.h>
17#include <media/v4l2-mediabus.h>
18
19
20
21
22enum fimc_input {
23 FIMC_INPUT_PARALLEL_0 = 1,
24 FIMC_INPUT_PARALLEL_1,
25 FIMC_INPUT_MIPI_CSI2_0 = 3,
26 FIMC_INPUT_MIPI_CSI2_1,
27 FIMC_INPUT_WRITEBACK_A = 5,
28 FIMC_INPUT_WRITEBACK_B,
29 FIMC_INPUT_WRITEBACK_ISP = 5,
30};
31
32
33
34
35enum fimc_bus_type {
36
37 FIMC_BUS_TYPE_ITU_601 = 1,
38
39 FIMC_BUS_TYPE_ITU_656,
40
41 FIMC_BUS_TYPE_MIPI_CSI2,
42
43 FIMC_BUS_TYPE_LCD_WRITEBACK_A,
44
45 FIMC_BUS_TYPE_LCD_WRITEBACK_B,
46
47 FIMC_BUS_TYPE_ISP_WRITEBACK = FIMC_BUS_TYPE_LCD_WRITEBACK_B,
48};
49
50#define fimc_input_is_parallel(x) ((x) == 1 || (x) == 2)
51#define fimc_input_is_mipi_csi(x) ((x) == 3 || (x) == 4)
52
53
54
55
56#define GRP_ID_SENSOR (1 << 8)
57#define GRP_ID_FIMC_IS_SENSOR (1 << 9)
58#define GRP_ID_WRITEBACK (1 << 10)
59#define GRP_ID_CSIS (1 << 11)
60#define GRP_ID_FIMC (1 << 12)
61#define GRP_ID_FLITE (1 << 13)
62#define GRP_ID_FIMC_IS (1 << 14)
63
64
65
66
67
68
69
70
71
72
73struct fimc_source_info {
74 enum fimc_bus_type fimc_bus_type;
75 enum fimc_bus_type sensor_bus_type;
76 u16 flags;
77 u16 mux_id;
78};
79
80
81
82
83
84
85
86#define S5P_FIMC_TX_END_NOTIFY _IO('e', 0)
87
88#define FIMC_MAX_PLANES 3
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103struct fimc_fmt {
104 u32 mbus_code;
105 char *name;
106 u32 fourcc;
107 u32 color;
108 u16 memplanes;
109 u16 colplanes;
110 u8 colorspace;
111 u8 depth[FIMC_MAX_PLANES];
112 u16 mdataplanes;
113 u16 flags;
114#define FMT_FLAGS_CAM (1 << 0)
115#define FMT_FLAGS_M2M_IN (1 << 1)
116#define FMT_FLAGS_M2M_OUT (1 << 2)
117#define FMT_FLAGS_M2M (1 << 1 | 1 << 2)
118#define FMT_HAS_ALPHA (1 << 3)
119#define FMT_FLAGS_COMPRESSED (1 << 4)
120#define FMT_FLAGS_WRITEBACK (1 << 5)
121#define FMT_FLAGS_RAW_BAYER (1 << 6)
122#define FMT_FLAGS_YUV (1 << 7)
123};
124
125struct exynos_media_pipeline;
126
127
128
129
130
131struct exynos_media_pipeline_ops {
132 int (*prepare)(struct exynos_media_pipeline *p,
133 struct media_entity *me);
134 int (*unprepare)(struct exynos_media_pipeline *p);
135 int (*open)(struct exynos_media_pipeline *p, struct media_entity *me,
136 bool resume);
137 int (*close)(struct exynos_media_pipeline *p);
138 int (*set_stream)(struct exynos_media_pipeline *p, bool state);
139};
140
141struct exynos_video_entity {
142 struct video_device vdev;
143 struct exynos_media_pipeline *pipe;
144};
145
146struct exynos_media_pipeline {
147 struct media_pipeline mp;
148 const struct exynos_media_pipeline_ops *ops;
149};
150
151static inline struct exynos_video_entity *vdev_to_exynos_video_entity(
152 struct video_device *vdev)
153{
154 return container_of(vdev, struct exynos_video_entity, vdev);
155}
156
157#define fimc_pipeline_call(ent, op, args...) \
158 ((!(ent) || !(ent)->pipe) ? -ENOENT : \
159 (((ent)->pipe->ops && (ent)->pipe->ops->op) ? \
160 (ent)->pipe->ops->op(((ent)->pipe), ##args) : -ENOIOCTLCMD)) \
161
162#endif
163