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

V4L/DVB: ivtv: move the _IO() decoder ioctls into vidioc_default

Now that video_ioctl2 no longer clobbers the argument for _IO() ioctls we
can move these into vidioc_default where they really belong.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6a717883
...@@ -1564,6 +1564,7 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg) ...@@ -1564,6 +1564,7 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg)
struct ivtv *itv = id->itv; struct ivtv *itv = id->itv;
int nonblocking = filp->f_flags & O_NONBLOCK; int nonblocking = filp->f_flags & O_NONBLOCK;
struct ivtv_stream *s = &itv->streams[id->type]; struct ivtv_stream *s = &itv->streams[id->type];
unsigned long iarg = (unsigned long)arg;
switch (cmd) { switch (cmd) {
case IVTV_IOC_DMA_FRAME: { case IVTV_IOC_DMA_FRAME: {
...@@ -1745,6 +1746,33 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg) ...@@ -1745,6 +1746,33 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg)
break; break;
} }
case VIDEO_SELECT_SOURCE:
IVTV_DEBUG_IOCTL("VIDEO_SELECT_SOURCE\n");
if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT))
return -EINVAL;
return ivtv_passthrough_mode(itv, iarg == VIDEO_SOURCE_DEMUX);
case AUDIO_SET_MUTE:
IVTV_DEBUG_IOCTL("AUDIO_SET_MUTE\n");
itv->speed_mute_audio = iarg;
return 0;
case AUDIO_CHANNEL_SELECT:
IVTV_DEBUG_IOCTL("AUDIO_CHANNEL_SELECT\n");
if (iarg > AUDIO_STEREO_SWAPPED)
return -EINVAL;
itv->audio_stereo_mode = iarg;
ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode);
return 0;
case AUDIO_BILINGUAL_CHANNEL_SELECT:
IVTV_DEBUG_IOCTL("AUDIO_BILINGUAL_CHANNEL_SELECT\n");
if (iarg > AUDIO_STEREO_SWAPPED)
return -EINVAL;
itv->audio_bilingual_mode = iarg;
ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode);
return 0;
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -1776,6 +1804,10 @@ static long ivtv_default(struct file *file, void *fh, int cmd, void *arg) ...@@ -1776,6 +1804,10 @@ static long ivtv_default(struct file *file, void *fh, int cmd, void *arg)
case VIDEO_CONTINUE: case VIDEO_CONTINUE:
case VIDEO_COMMAND: case VIDEO_COMMAND:
case VIDEO_TRY_COMMAND: case VIDEO_TRY_COMMAND:
case VIDEO_SELECT_SOURCE:
case AUDIO_SET_MUTE:
case AUDIO_CHANNEL_SELECT:
case AUDIO_BILINGUAL_CHANNEL_SELECT:
return ivtv_decoder_ioctls(file, cmd, (void *)arg); return ivtv_decoder_ioctls(file, cmd, (void *)arg);
default: default:
...@@ -1791,39 +1823,6 @@ static long ivtv_serialized_ioctl(struct ivtv *itv, struct file *filp, ...@@ -1791,39 +1823,6 @@ static long ivtv_serialized_ioctl(struct ivtv *itv, struct file *filp,
struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data; struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
long ret; long ret;
/* Filter dvb ioctls that cannot be handled by the v4l ioctl framework */
switch (cmd) {
case VIDEO_SELECT_SOURCE:
IVTV_DEBUG_IOCTL("VIDEO_SELECT_SOURCE\n");
if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT))
return -EINVAL;
return ivtv_passthrough_mode(itv, arg == VIDEO_SOURCE_DEMUX);
case AUDIO_SET_MUTE:
IVTV_DEBUG_IOCTL("AUDIO_SET_MUTE\n");
itv->speed_mute_audio = arg;
return 0;
case AUDIO_CHANNEL_SELECT:
IVTV_DEBUG_IOCTL("AUDIO_CHANNEL_SELECT\n");
if (arg > AUDIO_STEREO_SWAPPED)
return -EINVAL;
itv->audio_stereo_mode = arg;
ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode);
return 0;
case AUDIO_BILINGUAL_CHANNEL_SELECT:
IVTV_DEBUG_IOCTL("AUDIO_BILINGUAL_CHANNEL_SELECT\n");
if (arg > AUDIO_STEREO_SWAPPED)
return -EINVAL;
itv->audio_bilingual_mode = arg;
ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode);
return 0;
default:
break;
}
/* check priority */ /* check priority */
switch (cmd) { switch (cmd) {
case VIDIOC_S_CTRL: case VIDIOC_S_CTRL:
......
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