diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-03-09 12:25:47 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-24 15:33:44 (GMT) |
commit | 3acd16ab5c1c4e2a679c5c3e082db648f0e85100 (patch) | |
tree | 217747b59b5663066e1d9d2628cc2aedd843c1e9 /drivers/staging/media/go7007/go7007-v4l2.c | |
parent | dcafb6dea60fd6d4eaf20f8d5ce1503b0c03155d (diff) | |
download | linux-fsl-qoriq-3acd16ab5c1c4e2a679c5c3e082db648f0e85100.tar.xz |
[media] go7007: switch to standard tuner/i2c subdevs
Instead of using the wis-* drivers we now use the standard 'proper' subdev
drivers.
The board configuration tables now also list the possible audio inputs,
this will be used later to implement audio inputs.
Special mention deserves a little change in set_capture_size() where the
height passed to s_mbus_fmt is doubled: that is because the saa7115 driver
expects to see the frame height, not the field height as the wis_saa7115
driver did.
Another change is that the tuner input is moved from last to the first
input, which is consistent with the common practice in other video drivers.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging/media/go7007/go7007-v4l2.c')
-rw-r--r-- | drivers/staging/media/go7007/go7007-v4l2.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c index 4ad383a..fcd3e2d 100644 --- a/drivers/staging/media/go7007/go7007-v4l2.c +++ b/drivers/staging/media/go7007/go7007-v4l2.c @@ -37,7 +37,6 @@ #include "go7007.h" #include "go7007-priv.h" -#include "wis-i2c.h" /* Temporary defines until accepted in v4l-dvb */ #ifndef V4L2_MPEG_STREAM_TYPE_MPEG_ELEM @@ -264,6 +263,7 @@ static int set_capture_size(struct go7007 *go, struct v4l2_format *fmt, int try) mbus_fmt.height = height; go->encoder_v_halve = 1; } + mbus_fmt.height *= 2; call_all(&go->v4l2_dev, video, s_mbus_fmt, &mbus_fmt); } else { if (width <= sensor_width / 4) { @@ -1184,9 +1184,9 @@ static int vidioc_enum_input(struct file *file, void *priv, strncpy(inp->name, go->board_info->inputs[inp->index].name, sizeof(inp->name)); - /* If this board has a tuner, it will be the last input */ + /* If this board has a tuner, it will be the first input */ if ((go->board_info->flags & GO7007_BOARD_HAS_TUNER) && - inp->index == go->board_info->num_inputs - 1) + inp->index == 0) inp->type = V4L2_INPUT_TYPE_TUNER; else inp->type = V4L2_INPUT_TYPE_CAMERA; @@ -1223,7 +1223,17 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int input) go->input = input; - return call_all(&go->v4l2_dev, video, s_routing, input, 0, 0); + v4l2_subdev_call(go->sd_video, video, s_routing, + go->board_info->inputs[input].video_input, 0, + go->board_info->video_config); + if (go->board_info->num_aud_inputs) { + int aud_input = go->board_info->inputs[input].audio_index; + + v4l2_subdev_call(go->sd_audio, audio, s_routing, + go->board_info->aud_inputs[aud_input].audio_input, 0, 0); + go->aud_input = aud_input; + } + return 0; } static int vidioc_g_tuner(struct file *file, void *priv, |