]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (10698): v4l2-common: remove v4l2_ctrl_query_fill_std
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 21 Feb 2009 21:47:24 +0000 (18:47 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:42:54 +0000 (12:42 -0300)
The v4l2_ctrl_query_fill_std() function wasn't one the best idea I ever had.
It doesn't add anything valuable that cannot be expressed equally well with
v4l2_ctrl_query_fill and only adds overhead.

Replace it with v4l2_ctrl_query_fill() everywhere it is used and remove it
from v4l2_common.c.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 files changed:
drivers/media/video/cx18/cx18-av-core.c
drivers/media/video/cx2341x.c
drivers/media/video/cx25840/cx25840-core.c
drivers/media/video/msp3400-driver.c
drivers/media/video/saa7115.c
drivers/media/video/saa7134/saa6752hs.c
drivers/media/video/saa7134/saa7134-empress.c
drivers/media/video/tda7432.c
drivers/media/video/tda9875.c
drivers/media/video/tvaudio.c
drivers/media/video/tvp514x.c
drivers/media/video/v4l2-common.c
include/media/v4l2-common.h

index a3bd2c95f582d91bbfb8b7c3fd45f0593a151fb2..fc576cf1a8b596d7e3d7df3d219013024489a9f5 100644 (file)
@@ -788,10 +788,12 @@ int cx18_av_cmd(struct cx18 *cx, unsigned int cmd, void *arg)
 
                switch (qc->id) {
                case V4L2_CID_BRIGHTNESS:
+                       return v4l2_ctrl_query_fill(qc, 0, 255, 1, 128);
                case V4L2_CID_CONTRAST:
                case V4L2_CID_SATURATION:
+                       return v4l2_ctrl_query_fill(qc, 0, 127, 1, 64);
                case V4L2_CID_HUE:
-                       return v4l2_ctrl_query_fill_std(qc);
+                       return v4l2_ctrl_query_fill(qc, -128, 127, 1, 0);
                default:
                        break;
                }
@@ -801,10 +803,11 @@ int cx18_av_cmd(struct cx18 *cx, unsigned int cmd, void *arg)
                        return v4l2_ctrl_query_fill(qc, 0, 65535,
                                65535 / 100, state->default_volume);
                case V4L2_CID_AUDIO_MUTE:
+                       return v4l2_ctrl_query_fill(qc, 0, 1, 1, 0);
                case V4L2_CID_AUDIO_BALANCE:
                case V4L2_CID_AUDIO_BASS:
                case V4L2_CID_AUDIO_TREBLE:
-                       return v4l2_ctrl_query_fill_std(qc);
+                       return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 32768);
                default:
                        return -EINVAL;
                }
index b36f522d2c5575a6c62ba11b529dcb61f857ca88..8ded52946334e2abcec10d04f776492c91952373 100644 (file)
@@ -500,6 +500,29 @@ int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params,
        int err;
 
        switch (qctrl->id) {
+       case V4L2_CID_MPEG_STREAM_TYPE:
+               return v4l2_ctrl_query_fill(qctrl,
+                               V4L2_MPEG_STREAM_TYPE_MPEG2_PS,
+                               V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD, 1,
+                               V4L2_MPEG_STREAM_TYPE_MPEG2_PS);
+
+       case V4L2_CID_MPEG_STREAM_VBI_FMT:
+               if (params->capabilities & CX2341X_CAP_HAS_SLICED_VBI)
+                       return v4l2_ctrl_query_fill(qctrl,
+                                       V4L2_MPEG_STREAM_VBI_FMT_NONE,
+                                       V4L2_MPEG_STREAM_VBI_FMT_IVTV, 1,
+                                       V4L2_MPEG_STREAM_VBI_FMT_NONE);
+               return cx2341x_ctrl_query_fill(qctrl,
+                               V4L2_MPEG_STREAM_VBI_FMT_NONE,
+                               V4L2_MPEG_STREAM_VBI_FMT_NONE, 1,
+                               default_params.stream_vbi_fmt);
+
+       case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
+               return v4l2_ctrl_query_fill(qctrl,
+                               V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100,
+                               V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000, 1,
+                               V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000);
+
        case V4L2_CID_MPEG_AUDIO_ENCODING:
                if (params->capabilities & CX2341X_CAP_HAS_AC3) {
                        /*
@@ -531,9 +554,36 @@ int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params,
                        qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE;
                return 0;
 
-       case V4L2_CID_MPEG_AUDIO_L1_BITRATE:
-       case V4L2_CID_MPEG_AUDIO_L3_BITRATE:
-               return -EINVAL;
+       case V4L2_CID_MPEG_AUDIO_MODE:
+               return v4l2_ctrl_query_fill(qctrl,
+                               V4L2_MPEG_AUDIO_MODE_STEREO,
+                               V4L2_MPEG_AUDIO_MODE_MONO, 1,
+                               V4L2_MPEG_AUDIO_MODE_STEREO);
+
+       case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION:
+               err = v4l2_ctrl_query_fill(qctrl,
+                               V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4,
+                               V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16, 1,
+                               V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4);
+               if (err == 0 &&
+                   params->audio_mode != V4L2_MPEG_AUDIO_MODE_JOINT_STEREO)
+                       qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE;
+               return err;
+
+       case V4L2_CID_MPEG_AUDIO_EMPHASIS:
+               return v4l2_ctrl_query_fill(qctrl,
+                               V4L2_MPEG_AUDIO_EMPHASIS_NONE,
+                               V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17, 1,
+                               V4L2_MPEG_AUDIO_EMPHASIS_NONE);
+
+       case V4L2_CID_MPEG_AUDIO_CRC:
+               return v4l2_ctrl_query_fill(qctrl,
+                               V4L2_MPEG_AUDIO_CRC_NONE,
+                               V4L2_MPEG_AUDIO_CRC_CRC16, 1,
+                               V4L2_MPEG_AUDIO_CRC_NONE);
+
+       case V4L2_CID_MPEG_AUDIO_MUTE:
+               return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0);
 
        case V4L2_CID_MPEG_AUDIO_AC3_BITRATE:
                err = v4l2_ctrl_query_fill(qctrl,
@@ -550,13 +600,6 @@ int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params,
                        qctrl->flags |= V4L2_CTRL_FLAG_DISABLED;
                return 0;
 
-       case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION:
-               err = v4l2_ctrl_query_fill_std(qctrl);
-               if (err == 0 &&
-                   params->audio_mode != V4L2_MPEG_AUDIO_MODE_JOINT_STEREO)
-                       qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE;
-               return err;
-
        case V4L2_CID_MPEG_VIDEO_ENCODING:
                /* this setting is read-only for the cx2341x since the
                   V4L2_CID_MPEG_STREAM_TYPE really determines the
@@ -569,32 +612,51 @@ int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params,
                        qctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
                return err;
 
+       case V4L2_CID_MPEG_VIDEO_ASPECT:
+               return v4l2_ctrl_query_fill(qctrl,
+                               V4L2_MPEG_VIDEO_ASPECT_1x1,
+                               V4L2_MPEG_VIDEO_ASPECT_221x100, 1,
+                               V4L2_MPEG_VIDEO_ASPECT_4x3);
+
+       case V4L2_CID_MPEG_VIDEO_B_FRAMES:
+               return v4l2_ctrl_query_fill(qctrl, 0, 33, 1, 2);
+
+       case V4L2_CID_MPEG_VIDEO_GOP_SIZE:
+               return v4l2_ctrl_query_fill(qctrl, 1, 34, 1,
+                               params->is_50hz ? 12 : 15);
+
+       case V4L2_CID_MPEG_VIDEO_GOP_CLOSURE:
+               return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 1);
+
        case V4L2_CID_MPEG_VIDEO_BITRATE_MODE:
-               err = v4l2_ctrl_query_fill_std(qctrl);
+               err = v4l2_ctrl_query_fill(qctrl,
+                               V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,
+                               V4L2_MPEG_VIDEO_BITRATE_MODE_CBR, 1,
+                               V4L2_MPEG_VIDEO_BITRATE_MODE_VBR);
                if (err == 0 &&
                    params->video_encoding == V4L2_MPEG_VIDEO_ENCODING_MPEG_1)
                        qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE;
                return err;
 
+       case V4L2_CID_MPEG_VIDEO_BITRATE:
+               return v4l2_ctrl_query_fill(qctrl, 0, 27000000, 1, 6000000);
+
        case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK:
-               err = v4l2_ctrl_query_fill_std(qctrl);
+               err = v4l2_ctrl_query_fill(qctrl, 0, 27000000, 1, 8000000);
                if (err == 0 &&
                    params->video_bitrate_mode ==
                                V4L2_MPEG_VIDEO_BITRATE_MODE_CBR)
                        qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE;
                return err;
 
-       case V4L2_CID_MPEG_STREAM_VBI_FMT:
-               if (params->capabilities & CX2341X_CAP_HAS_SLICED_VBI)
-                       return v4l2_ctrl_query_fill_std(qctrl);
-               return cx2341x_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_STREAM_VBI_FMT_NONE,
-                               V4L2_MPEG_STREAM_VBI_FMT_NONE, 1,
-                               default_params.stream_vbi_fmt);
+       case V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION:
+               return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0);
 
-       case V4L2_CID_MPEG_VIDEO_GOP_SIZE:
-               return v4l2_ctrl_query_fill(qctrl, 1, 34, 1,
-                               params->is_50hz ? 12 : 15);
+       case V4L2_CID_MPEG_VIDEO_MUTE:
+               return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0);
+
+       case V4L2_CID_MPEG_VIDEO_MUTE_YUV:  /* Init YUV (really YCbCr) to black */
+               return v4l2_ctrl_query_fill(qctrl, 0, 0xffffff, 1, 0x008080);
 
        /* CX23415/6 specific */
        case V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE:
@@ -696,7 +758,7 @@ int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params,
                                default_params.stream_insert_nav_packets);
 
        default:
-               return v4l2_ctrl_query_fill_std(qctrl);
+               return -EINVAL;
 
        }
 }
index d4059ecaa58e361b15786771978fd6e4679fc009..4a5d5ef9dfc7fe19d57ecfc879d82a698075e151 100644 (file)
@@ -1205,10 +1205,12 @@ static int cx25840_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
 
        switch (qc->id) {
        case V4L2_CID_BRIGHTNESS:
+               return v4l2_ctrl_query_fill(qc, 0, 255, 1, 128);
        case V4L2_CID_CONTRAST:
        case V4L2_CID_SATURATION:
+               return v4l2_ctrl_query_fill(qc, 0, 127, 1, 64);
        case V4L2_CID_HUE:
-               return v4l2_ctrl_query_fill_std(qc);
+               return v4l2_ctrl_query_fill(qc, -128, 127, 1, 0);
        default:
                break;
        }
@@ -1220,10 +1222,11 @@ static int cx25840_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
                return v4l2_ctrl_query_fill(qc, 0, 65535,
                                65535 / 100, state->default_volume);
        case V4L2_CID_AUDIO_MUTE:
+               return v4l2_ctrl_query_fill(qc, 0, 1, 1, 0);
        case V4L2_CID_AUDIO_BALANCE:
        case V4L2_CID_AUDIO_BASS:
        case V4L2_CID_AUDIO_TREBLE:
-               return v4l2_ctrl_query_fill_std(qc);
+               return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 32768);
        default:
                return -EINVAL;
        }
index 4d7a91852117920b6dfe38b5d9ed7f1f9278f5c6..d972828d1cbefd4db919f742baa291c7c9a78b94 100644 (file)
@@ -713,22 +713,24 @@ static int msp_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
        struct msp_state *state = to_state(sd);
 
        switch (qc->id) {
-               case V4L2_CID_AUDIO_VOLUME:
-               case V4L2_CID_AUDIO_MUTE:
-                       return v4l2_ctrl_query_fill_std(qc);
-               default:
-                       break;
+       case V4L2_CID_AUDIO_VOLUME:
+               return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 58880);
+       case V4L2_CID_AUDIO_MUTE:
+               return v4l2_ctrl_query_fill(qc, 0, 1, 1, 0);
+       default:
+               break;
        }
        if (!state->has_sound_processing)
                return -EINVAL;
        switch (qc->id) {
-               case V4L2_CID_AUDIO_LOUDNESS:
-               case V4L2_CID_AUDIO_BALANCE:
-               case V4L2_CID_AUDIO_BASS:
-               case V4L2_CID_AUDIO_TREBLE:
-                       return v4l2_ctrl_query_fill_std(qc);
-               default:
-                       return -EINVAL;
+       case V4L2_CID_AUDIO_LOUDNESS:
+               return v4l2_ctrl_query_fill(qc, 0, 1, 1, 0);
+       case V4L2_CID_AUDIO_BALANCE:
+       case V4L2_CID_AUDIO_BASS:
+       case V4L2_CID_AUDIO_TREBLE:
+               return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 32768);
+       default:
+               return -EINVAL;
        }
        return 0;
 }
index dd1943987ce6c8ce794002441bb823c2ece9b372..a845582ca5d4913989835e518fb086b163a1c8fa 100644 (file)
@@ -1206,10 +1206,12 @@ static int saa711x_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
 {
        switch (qc->id) {
        case V4L2_CID_BRIGHTNESS:
+               return v4l2_ctrl_query_fill(qc, 0, 255, 1, 128);
        case V4L2_CID_CONTRAST:
        case V4L2_CID_SATURATION:
+               return v4l2_ctrl_query_fill(qc, 0, 127, 1, 64);
        case V4L2_CID_HUE:
-               return v4l2_ctrl_query_fill_std(qc);
+               return v4l2_ctrl_query_fill(qc, -128, 127, 1, 0);
        default:
                return -EINVAL;
        }
index 2d292ad776e9fa7252d25931c573842afbaeb431..dc2213e2f86e67095f11a17206ddce66413181c5 100644 (file)
@@ -592,7 +592,7 @@ static int saa6752hs_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc
                                V4L2_MPEG_VIDEO_ASPECT_4x3);
 
        case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK:
-               err = v4l2_ctrl_query_fill_std(qctrl);
+               err = v4l2_ctrl_query_fill(qctrl, 0, 27000000, 1, 8000000);
                if (err == 0 &&
                    params->vi_bitrate_mode ==
                                V4L2_MPEG_VIDEO_BITRATE_MODE_CBR)
@@ -606,12 +606,20 @@ static int saa6752hs_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc
                                V4L2_MPEG_STREAM_TYPE_MPEG2_TS);
 
        case V4L2_CID_MPEG_VIDEO_BITRATE_MODE:
+               return v4l2_ctrl_query_fill(qctrl,
+                               V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,
+                               V4L2_MPEG_VIDEO_BITRATE_MODE_CBR, 1,
+                               V4L2_MPEG_VIDEO_BITRATE_MODE_VBR);
        case V4L2_CID_MPEG_VIDEO_BITRATE:
+               return v4l2_ctrl_query_fill(qctrl, 0, 27000000, 1, 6000000);
        case V4L2_CID_MPEG_STREAM_PID_PMT:
+               return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 16);
        case V4L2_CID_MPEG_STREAM_PID_AUDIO:
+               return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 260);
        case V4L2_CID_MPEG_STREAM_PID_VIDEO:
+               return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 256);
        case V4L2_CID_MPEG_STREAM_PID_PCR:
-               return v4l2_ctrl_query_fill_std(qctrl);
+               return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 259);
 
        default:
                break;
index 2e15bb7c3f0a9058d48907866e1e9f0a2b4dd9ca..c6cfe0fe7e3d55c80c5249f24c184132a70820b4 100644 (file)
@@ -390,7 +390,7 @@ static int empress_queryctrl(struct file *file, void *priv,
        if (c->id == 0)
                return -EINVAL;
        if (c->id == V4L2_CID_USER_CLASS || c->id == V4L2_CID_MPEG_CLASS)
-               return v4l2_ctrl_query_fill_std(c);
+               return v4l2_ctrl_query_fill(c, 0, 0, 0, 0);
        if (V4L2_CTRL_ID2CLASS(c->id) != V4L2_CTRL_CLASS_MPEG)
                return saa7134_queryctrl(file, priv, c);
        return saa_call_empress(dev, core, queryctrl, c);
index 2090e170bd9cc56aec3dfc636ade7c0c99213f00..976ce207cfcba151834505c2684ae3c707864009 100644 (file)
@@ -421,12 +421,14 @@ static int tda7432_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
 static int tda7432_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
 {
        switch (qc->id) {
-       case V4L2_CID_AUDIO_MUTE:
        case V4L2_CID_AUDIO_VOLUME:
+               return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 58880);
+       case V4L2_CID_AUDIO_MUTE:
+               return v4l2_ctrl_query_fill(qc, 0, 1, 1, 0);
        case V4L2_CID_AUDIO_BALANCE:
        case V4L2_CID_AUDIO_BASS:
        case V4L2_CID_AUDIO_TREBLE:
-               return v4l2_ctrl_query_fill_std(qc);
+               return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 32768);
        }
        return -EINVAL;
 }
index 19fbd18f48823b29c3cb6b0f8a7be387b9600527..e71b2bd46612a763347a14d7bf0a654f1cd6e830 100644 (file)
@@ -313,9 +313,10 @@ static int tda9875_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
 {
        switch (qc->id) {
        case V4L2_CID_AUDIO_VOLUME:
+               return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 58880);
        case V4L2_CID_AUDIO_BASS:
        case V4L2_CID_AUDIO_TREBLE:
-               return v4l2_ctrl_query_fill_std(qc);
+               return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 32768);
        }
        return -EINVAL;
 }
index 076ed5bf48b1d88e24a6f4f7d321f4aef164070e..0eb3b1694287613f799ad0ae1ffb02f27650f554 100644 (file)
@@ -1636,21 +1636,24 @@ static int tvaudio_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
 
        switch (qc->id) {
        case V4L2_CID_AUDIO_MUTE:
-               break;
+               return v4l2_ctrl_query_fill(qc, 0, 1, 1, 0);
        case V4L2_CID_AUDIO_VOLUME:
+               if (desc->flags & CHIP_HAS_VOLUME)
+                       return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 58880);
+               break;
        case V4L2_CID_AUDIO_BALANCE:
-               if (!(desc->flags & CHIP_HAS_VOLUME))
-                       return -EINVAL;
+               if (desc->flags & CHIP_HAS_VOLUME)
+                       return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 32768);
                break;
        case V4L2_CID_AUDIO_BASS:
        case V4L2_CID_AUDIO_TREBLE:
-               if (!(desc->flags & CHIP_HAS_BASSTREBLE))
-                       return -EINVAL;
+               if (desc->flags & CHIP_HAS_BASSTREBLE)
+                       return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 32768);
                break;
        default:
-               return -EINVAL;
+               break;
        }
-       return v4l2_ctrl_query_fill_std(qc);
+       return -EINVAL;
 }
 
 static int tvaudio_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *rt)
index f0b2b8ed2fe46b6024749e4216b95e71963c7675..4262e60b8116a3df1fb161ae49fa44bc0c3ae037 100644 (file)
@@ -725,10 +725,9 @@ ioctl_queryctrl(struct v4l2_int_device *s, struct v4l2_queryctrl *qctrl)
 
        switch (qctrl->id) {
        case V4L2_CID_BRIGHTNESS:
-               /* Brightness supported is same as standard one (0-255),
-                * so make use of standard API provided.
+               /* Brightness supported is (0-255),
                 */
-               err = v4l2_ctrl_query_fill_std(qctrl);
+               err = v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 128);
                break;
        case V4L2_CID_CONTRAST:
        case V4L2_CID_SATURATION:
index caa7ba0705a5c0e96f4e180241de766c1d242052..dbced906aa06abc5111fbf5447097ff190e1c16e 100644 (file)
@@ -588,151 +588,6 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
 }
 EXPORT_SYMBOL(v4l2_ctrl_query_fill);
 
-/* Fill in a struct v4l2_queryctrl with standard values based on
-   the control ID. */
-int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl)
-{
-       switch (qctrl->id) {
-       /* USER controls */
-       case V4L2_CID_USER_CLASS:
-       case V4L2_CID_MPEG_CLASS:
-       case V4L2_CID_CAMERA_CLASS:
-               return v4l2_ctrl_query_fill(qctrl, 0, 0, 0, 0);
-       case V4L2_CID_AUDIO_VOLUME:
-               return v4l2_ctrl_query_fill(qctrl, 0, 65535, 65535 / 100, 58880);
-       case V4L2_CID_AUDIO_MUTE:
-       case V4L2_CID_AUDIO_LOUDNESS:
-               return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0);
-       case V4L2_CID_AUDIO_BALANCE:
-       case V4L2_CID_AUDIO_BASS:
-       case V4L2_CID_AUDIO_TREBLE:
-               return v4l2_ctrl_query_fill(qctrl, 0, 65535, 65535 / 100, 32768);
-       case V4L2_CID_BRIGHTNESS:
-               return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 128);
-       case V4L2_CID_CONTRAST:
-       case V4L2_CID_SATURATION:
-               return v4l2_ctrl_query_fill(qctrl, 0, 127, 1, 64);
-       case V4L2_CID_HUE:
-               return v4l2_ctrl_query_fill(qctrl, -128, 127, 1, 0);
-       case V4L2_CID_COLORFX:
-               return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0);
-
-       /* MPEG controls */
-       case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100,
-                               V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000, 1,
-                               V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000);
-       case V4L2_CID_MPEG_AUDIO_ENCODING:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_AUDIO_ENCODING_LAYER_1,
-                               V4L2_MPEG_AUDIO_ENCODING_AC3, 1,
-                               V4L2_MPEG_AUDIO_ENCODING_LAYER_2);
-       case V4L2_CID_MPEG_AUDIO_L1_BITRATE:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_AUDIO_L1_BITRATE_32K,
-                               V4L2_MPEG_AUDIO_L1_BITRATE_448K, 1,
-                               V4L2_MPEG_AUDIO_L1_BITRATE_256K);
-       case V4L2_CID_MPEG_AUDIO_L2_BITRATE:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_AUDIO_L2_BITRATE_32K,
-                               V4L2_MPEG_AUDIO_L2_BITRATE_384K, 1,
-                               V4L2_MPEG_AUDIO_L2_BITRATE_224K);
-       case V4L2_CID_MPEG_AUDIO_L3_BITRATE:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_AUDIO_L3_BITRATE_32K,
-                               V4L2_MPEG_AUDIO_L3_BITRATE_320K, 1,
-                               V4L2_MPEG_AUDIO_L3_BITRATE_192K);
-       case V4L2_CID_MPEG_AUDIO_AAC_BITRATE:
-               return v4l2_ctrl_query_fill(qctrl, 0, 6400, 1, 3200000);
-       case V4L2_CID_MPEG_AUDIO_AC3_BITRATE:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_AUDIO_AC3_BITRATE_32K,
-                               V4L2_MPEG_AUDIO_AC3_BITRATE_640K, 1,
-                               V4L2_MPEG_AUDIO_AC3_BITRATE_384K);
-       case V4L2_CID_MPEG_AUDIO_MODE:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_AUDIO_MODE_STEREO,
-                               V4L2_MPEG_AUDIO_MODE_MONO, 1,
-                               V4L2_MPEG_AUDIO_MODE_STEREO);
-       case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4,
-                               V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16, 1,
-                               V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4);
-       case V4L2_CID_MPEG_AUDIO_EMPHASIS:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_AUDIO_EMPHASIS_NONE,
-                               V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17, 1,
-                               V4L2_MPEG_AUDIO_EMPHASIS_NONE);
-       case V4L2_CID_MPEG_AUDIO_CRC:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_AUDIO_CRC_NONE,
-                               V4L2_MPEG_AUDIO_CRC_CRC16, 1,
-                               V4L2_MPEG_AUDIO_CRC_NONE);
-       case V4L2_CID_MPEG_AUDIO_MUTE:
-               return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0);
-       case V4L2_CID_MPEG_VIDEO_ENCODING:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_VIDEO_ENCODING_MPEG_1,
-                               V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC, 1,
-                               V4L2_MPEG_VIDEO_ENCODING_MPEG_2);
-       case V4L2_CID_MPEG_VIDEO_ASPECT:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_VIDEO_ASPECT_1x1,
-                               V4L2_MPEG_VIDEO_ASPECT_221x100, 1,
-                               V4L2_MPEG_VIDEO_ASPECT_4x3);
-       case V4L2_CID_MPEG_VIDEO_B_FRAMES:
-               return v4l2_ctrl_query_fill(qctrl, 0, 33, 1, 2);
-       case V4L2_CID_MPEG_VIDEO_GOP_SIZE:
-               return v4l2_ctrl_query_fill(qctrl, 1, 34, 1, 12);
-       case V4L2_CID_MPEG_VIDEO_GOP_CLOSURE:
-               return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 1);
-       case V4L2_CID_MPEG_VIDEO_PULLDOWN:
-               return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0);
-       case V4L2_CID_MPEG_VIDEO_BITRATE_MODE:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,
-                               V4L2_MPEG_VIDEO_BITRATE_MODE_CBR, 1,
-                               V4L2_MPEG_VIDEO_BITRATE_MODE_VBR);
-       case V4L2_CID_MPEG_VIDEO_BITRATE:
-               return v4l2_ctrl_query_fill(qctrl, 0, 27000000, 1, 6000000);
-       case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK:
-               return v4l2_ctrl_query_fill(qctrl, 0, 27000000, 1, 8000000);
-       case V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION:
-               return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0);
-       case V4L2_CID_MPEG_VIDEO_MUTE:
-               return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0);
-       case V4L2_CID_MPEG_VIDEO_MUTE_YUV:  /* Init YUV (really YCbCr) to black */
-               return v4l2_ctrl_query_fill(qctrl, 0, 0xffffff, 1, 0x008080);
-       case V4L2_CID_MPEG_STREAM_TYPE:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_STREAM_TYPE_MPEG2_PS,
-                               V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD, 1,
-                               V4L2_MPEG_STREAM_TYPE_MPEG2_PS);
-       case V4L2_CID_MPEG_STREAM_PID_PMT:
-               return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 16);
-       case V4L2_CID_MPEG_STREAM_PID_AUDIO:
-               return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 260);
-       case V4L2_CID_MPEG_STREAM_PID_VIDEO:
-               return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 256);
-       case V4L2_CID_MPEG_STREAM_PID_PCR:
-               return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 259);
-       case V4L2_CID_MPEG_STREAM_PES_ID_AUDIO:
-               return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0);
-       case V4L2_CID_MPEG_STREAM_PES_ID_VIDEO:
-               return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0);
-       case V4L2_CID_MPEG_STREAM_VBI_FMT:
-               return v4l2_ctrl_query_fill(qctrl,
-                               V4L2_MPEG_STREAM_VBI_FMT_NONE,
-                               V4L2_MPEG_STREAM_VBI_FMT_IVTV, 1,
-                               V4L2_MPEG_STREAM_VBI_FMT_NONE);
-       default:
-               return -EINVAL;
-       }
-}
-EXPORT_SYMBOL(v4l2_ctrl_query_fill_std);
-
 /* Fill in a struct v4l2_querymenu based on the struct v4l2_queryctrl and
    the menu. The qctrl pointer may be NULL, in which case it is ignored.
    If menu_items is NULL, then the menu items are retrieved using
index 7779d9c93ec859f5be73d897d4b7493aa479fcf2..3a6905615d689e277f1e12e9858b3b5194ffc0e6 100644 (file)
@@ -102,7 +102,6 @@ int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl,
 const char *v4l2_ctrl_get_name(u32 id);
 const char **v4l2_ctrl_get_menu(u32 id);
 int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def);
-int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl);
 int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu,
                struct v4l2_queryctrl *qctrl, const char **menu_items);
 #define V4L2_CTRL_MENU_IDS_END (0xffffffff)