1
2
3
4
5
6
7
8
9
10
11
12
13
14 #ifndef OMAP3_ISP_RESIZER_H
15 #define OMAP3_ISP_RESIZER_H
16
17 #include <linux/spinlock.h>
18 #include <linux/types.h>
19
20
21
22
23 #define COEFF_CNT 32
24
25
26
27
28
29
30
31
32
33
34
35
36 struct isprsz_coef {
37 u16 h_filter_coef_4tap[32];
38 u16 v_filter_coef_4tap[32];
39
40 u16 h_filter_coef_7tap[32];
41 u16 v_filter_coef_7tap[32];
42 };
43
44
45 enum resizer_chroma_algo {
46 RSZ_THE_SAME = 0,
47 RSZ_BILINEAR = 1,
48 };
49
50
51 enum resizer_colors_type {
52 RSZ_YUV422 = 0,
53 RSZ_COLOR8 = 1,
54 };
55
56
57
58
59 struct resizer_ratio {
60 u32 horz;
61 u32 vert;
62 };
63
64
65
66
67 struct resizer_luma_yenh {
68 u8 algo;
69 u8 gain;
70 u8 slope;
71 u8 core;
72 };
73
74 enum resizer_input_entity {
75 RESIZER_INPUT_NONE,
76 RESIZER_INPUT_VP,
77 RESIZER_INPUT_MEMORY,
78 };
79
80
81 #define RESZ_PAD_SINK 0
82 #define RESZ_PAD_SOURCE 1
83 #define RESZ_PADS_NUM 2
84
85
86
87
88
89
90
91 struct isp_res_device {
92 struct v4l2_subdev subdev;
93 struct media_pad pads[RESZ_PADS_NUM];
94 struct v4l2_mbus_framefmt formats[RESZ_PADS_NUM];
95
96 enum resizer_input_entity input;
97 struct isp_video video_in;
98 struct isp_video video_out;
99
100 u32 addr_base;
101 u32 crop_offset;
102 struct resizer_ratio ratio;
103 int pm_state;
104 unsigned int applycrop:1;
105 enum isp_pipeline_stream_state state;
106 wait_queue_head_t wait;
107 atomic_t stopping;
108 spinlock_t lock;
109
110 struct {
111 struct v4l2_rect request;
112 struct v4l2_rect active;
113 } crop;
114 };
115
116 struct isp_device;
117
118 int omap3isp_resizer_init(struct isp_device *isp);
119 void omap3isp_resizer_cleanup(struct isp_device *isp);
120
121 int omap3isp_resizer_register_entities(struct isp_res_device *res,
122 struct v4l2_device *vdev);
123 void omap3isp_resizer_unregister_entities(struct isp_res_device *res);
124 void omap3isp_resizer_isr_frame_sync(struct isp_res_device *res);
125 void omap3isp_resizer_isr(struct isp_res_device *isp_res);
126
127 void omap3isp_resizer_max_rate(struct isp_res_device *res,
128 unsigned int *max_rate);
129
130 void omap3isp_resizer_suspend(struct isp_res_device *isp_res);
131
132 void omap3isp_resizer_resume(struct isp_res_device *isp_res);
133
134 int omap3isp_resizer_busy(struct isp_res_device *isp_res);
135
136 #endif