aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-05-24 09:16:43 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-08 22:43:05 -0400
commitf6e114eed0414fbba9eb73480cd8efdaba96aaa7 (patch)
treefcb31574d26bfc20ea3ca46e25968f7f66867495 /include
parente34e658b5a42fb1a12fda2112f0b556cf5d1f1c4 (diff)
V4L/DVB: cx2341x: convert to the control framework
Since this module is also used by drivers that are not yet converted, the old and new code have to co-exist. The source is split into three parts: a common part at the top, which is used by both old and new code, then the old code followed by the new control framework implementation. This new code is much more readable (and shorter!) than the original code. Once all bridge drivers that use this are converted the old code can be deleted. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/cx2341x.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h
index 9ebe8558b9b6..8d08ebfe20b7 100644
--- a/include/media/cx2341x.h
+++ b/include/media/cx2341x.h
@@ -19,6 +19,8 @@
19#ifndef CX2341X_H 19#ifndef CX2341X_H
20#define CX2341X_H 20#define CX2341X_H
21 21
22#include <media/v4l2-ctrls.h>
23
22enum cx2341x_port { 24enum cx2341x_port {
23 CX2341X_PORT_MEMORY = 0, 25 CX2341X_PORT_MEMORY = 0,
24 CX2341X_PORT_STREAMING = 1, 26 CX2341X_PORT_STREAMING = 1,
@@ -99,6 +101,101 @@ int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy,
99void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); 101void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p);
100void cx2341x_log_status(const struct cx2341x_mpeg_params *p, const char *prefix); 102void cx2341x_log_status(const struct cx2341x_mpeg_params *p, const char *prefix);
101 103
104struct cx2341x_handler;
105
106struct cx2341x_handler_ops {
107 /* needed for the video clock freq */
108 int (*s_audio_sampling_freq)(struct cx2341x_handler *hdl, u32 val);
109 /* needed for dualwatch */
110 int (*s_audio_mode)(struct cx2341x_handler *hdl, u32 val);
111 /* needed for setting up the video resolution */
112 int (*s_video_encoding)(struct cx2341x_handler *hdl, u32 val);
113 /* needed for setting up the sliced vbi insertion data structures */
114 int (*s_stream_vbi_fmt)(struct cx2341x_handler *hdl, u32 val);
115};
116
117struct cx2341x_handler {
118 u32 capabilities;
119 enum cx2341x_port port;
120 u16 width;
121 u16 height;
122 u16 is_50hz;
123 u32 audio_properties;
124
125 struct v4l2_ctrl_handler hdl;
126 void *priv;
127 cx2341x_mbox_func func;
128 const struct cx2341x_handler_ops *ops;
129
130 struct v4l2_ctrl *stream_vbi_fmt;
131
132 struct {
133 /* audio cluster */
134 struct v4l2_ctrl *audio_sampling_freq;
135 struct v4l2_ctrl *audio_encoding;
136 struct v4l2_ctrl *audio_l2_bitrate;
137 struct v4l2_ctrl *audio_mode;
138 struct v4l2_ctrl *audio_mode_extension;
139 struct v4l2_ctrl *audio_emphasis;
140 struct v4l2_ctrl *audio_crc;
141 struct v4l2_ctrl *audio_ac3_bitrate;
142 };
143
144 struct {
145 /* video gop cluster */
146 struct v4l2_ctrl *video_b_frames;
147 struct v4l2_ctrl *video_gop_size;
148 };
149
150 struct {
151 /* stream type cluster */
152 struct v4l2_ctrl *stream_type;
153 struct v4l2_ctrl *video_encoding;
154 struct v4l2_ctrl *video_bitrate_mode;
155 struct v4l2_ctrl *video_bitrate;
156 struct v4l2_ctrl *video_bitrate_peak;
157 };
158
159 struct {
160 /* video mute cluster */
161 struct v4l2_ctrl *video_mute;
162 struct v4l2_ctrl *video_mute_yuv;
163 };
164
165 struct {
166 /* video filter mode cluster */
167 struct v4l2_ctrl *video_spatial_filter_mode;
168 struct v4l2_ctrl *video_temporal_filter_mode;
169 struct v4l2_ctrl *video_median_filter_type;
170 };
171
172 struct {
173 /* video filter type cluster */
174 struct v4l2_ctrl *video_luma_spatial_filter_type;
175 struct v4l2_ctrl *video_chroma_spatial_filter_type;
176 };
177
178 struct {
179 /* video filter cluster */
180 struct v4l2_ctrl *video_spatial_filter;
181 struct v4l2_ctrl *video_temporal_filter;
182 };
183
184 struct {
185 /* video median cluster */
186 struct v4l2_ctrl *video_luma_median_filter_top;
187 struct v4l2_ctrl *video_luma_median_filter_bottom;
188 struct v4l2_ctrl *video_chroma_median_filter_top;
189 struct v4l2_ctrl *video_chroma_median_filter_bottom;
190 };
191};
192
193int cx2341x_handler_init(struct cx2341x_handler *cxhdl,
194 unsigned nr_of_controls_hint);
195void cx2341x_handler_set_50hz(struct cx2341x_handler *cxhdl, int is_50hz);
196int cx2341x_handler_setup(struct cx2341x_handler *cxhdl);
197void cx2341x_handler_set_busy(struct cx2341x_handler *cxhdl, int busy);
198
102/* Firmware names */ 199/* Firmware names */
103#define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw" 200#define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw"
104/* Decoder firmware for the cx23415 only */ 201/* Decoder firmware for the cx23415 only */