Commit f6e114ee authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

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: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent e34e658b
This diff is collapsed.
......@@ -19,6 +19,8 @@
#ifndef CX2341X_H
#define CX2341X_H
#include <media/v4l2-ctrls.h>
enum cx2341x_port {
CX2341X_PORT_MEMORY = 0,
CX2341X_PORT_STREAMING = 1,
......@@ -99,6 +101,101 @@ int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy,
void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p);
void cx2341x_log_status(const struct cx2341x_mpeg_params *p, const char *prefix);
struct cx2341x_handler;
struct cx2341x_handler_ops {
/* needed for the video clock freq */
int (*s_audio_sampling_freq)(struct cx2341x_handler *hdl, u32 val);
/* needed for dualwatch */
int (*s_audio_mode)(struct cx2341x_handler *hdl, u32 val);
/* needed for setting up the video resolution */
int (*s_video_encoding)(struct cx2341x_handler *hdl, u32 val);
/* needed for setting up the sliced vbi insertion data structures */
int (*s_stream_vbi_fmt)(struct cx2341x_handler *hdl, u32 val);
};
struct cx2341x_handler {
u32 capabilities;
enum cx2341x_port port;
u16 width;
u16 height;
u16 is_50hz;
u32 audio_properties;
struct v4l2_ctrl_handler hdl;
void *priv;
cx2341x_mbox_func func;
const struct cx2341x_handler_ops *ops;
struct v4l2_ctrl *stream_vbi_fmt;
struct {
/* audio cluster */
struct v4l2_ctrl *audio_sampling_freq;
struct v4l2_ctrl *audio_encoding;
struct v4l2_ctrl *audio_l2_bitrate;
struct v4l2_ctrl *audio_mode;
struct v4l2_ctrl *audio_mode_extension;
struct v4l2_ctrl *audio_emphasis;
struct v4l2_ctrl *audio_crc;
struct v4l2_ctrl *audio_ac3_bitrate;
};
struct {
/* video gop cluster */
struct v4l2_ctrl *video_b_frames;
struct v4l2_ctrl *video_gop_size;
};
struct {
/* stream type cluster */
struct v4l2_ctrl *stream_type;
struct v4l2_ctrl *video_encoding;
struct v4l2_ctrl *video_bitrate_mode;
struct v4l2_ctrl *video_bitrate;
struct v4l2_ctrl *video_bitrate_peak;
};
struct {
/* video mute cluster */
struct v4l2_ctrl *video_mute;
struct v4l2_ctrl *video_mute_yuv;
};
struct {
/* video filter mode cluster */
struct v4l2_ctrl *video_spatial_filter_mode;
struct v4l2_ctrl *video_temporal_filter_mode;
struct v4l2_ctrl *video_median_filter_type;
};
struct {
/* video filter type cluster */
struct v4l2_ctrl *video_luma_spatial_filter_type;
struct v4l2_ctrl *video_chroma_spatial_filter_type;
};
struct {
/* video filter cluster */
struct v4l2_ctrl *video_spatial_filter;
struct v4l2_ctrl *video_temporal_filter;
};
struct {
/* video median cluster */
struct v4l2_ctrl *video_luma_median_filter_top;
struct v4l2_ctrl *video_luma_median_filter_bottom;
struct v4l2_ctrl *video_chroma_median_filter_top;
struct v4l2_ctrl *video_chroma_median_filter_bottom;
};
};
int cx2341x_handler_init(struct cx2341x_handler *cxhdl,
unsigned nr_of_controls_hint);
void cx2341x_handler_set_50hz(struct cx2341x_handler *cxhdl, int is_50hz);
int cx2341x_handler_setup(struct cx2341x_handler *cxhdl);
void cx2341x_handler_set_busy(struct cx2341x_handler *cxhdl, int busy);
/* Firmware names */
#define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw"
/* Decoder firmware for the cx23415 only */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment