diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-03-11 15:18:31 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-25 14:10:35 -0400 |
commit | 56230d1e292acad1367ae15f7a7dce70ee30f483 (patch) | |
tree | b5ab18e00ce0a38b6ae11baad4c95f7364a6a79e /drivers/media/usb | |
parent | de8d2bbf0a6bebce51a2ab08adbb0dd897825777 (diff) |
[media] au0828: fix initial video routing
After loading the module the initial video routing is not setup.
Explicitly call s_input to get this right.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r-- | drivers/media/usb/au0828/au0828-video.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 6f2a6264d173..a90a0b9771b3 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c | |||
@@ -1391,20 +1391,10 @@ static int vidioc_g_input(struct file *file, void *priv, unsigned int *i) | |||
1391 | return 0; | 1391 | return 0; |
1392 | } | 1392 | } |
1393 | 1393 | ||
1394 | static int vidioc_s_input(struct file *file, void *priv, unsigned int index) | 1394 | static void au0828_s_input(struct au0828_dev *dev, int index) |
1395 | { | 1395 | { |
1396 | struct au0828_fh *fh = priv; | ||
1397 | struct au0828_dev *dev = fh->dev; | ||
1398 | int i; | 1396 | int i; |
1399 | 1397 | ||
1400 | dprintk(1, "VIDIOC_S_INPUT in function %s, input=%d\n", __func__, | ||
1401 | index); | ||
1402 | if (index >= AU0828_MAX_INPUT) | ||
1403 | return -EINVAL; | ||
1404 | if (AUVI_INPUT(index).type == 0) | ||
1405 | return -EINVAL; | ||
1406 | dev->ctrl_input = index; | ||
1407 | |||
1408 | switch (AUVI_INPUT(index).type) { | 1398 | switch (AUVI_INPUT(index).type) { |
1409 | case AU0828_VMUX_SVIDEO: | 1399 | case AU0828_VMUX_SVIDEO: |
1410 | dev->input_type = AU0828_VMUX_SVIDEO; | 1400 | dev->input_type = AU0828_VMUX_SVIDEO; |
@@ -1419,7 +1409,7 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int index) | |||
1419 | dev->ctrl_ainput = 0; | 1409 | dev->ctrl_ainput = 0; |
1420 | break; | 1410 | break; |
1421 | default: | 1411 | default: |
1422 | dprintk(1, "VIDIOC_S_INPUT unknown input type set [%d]\n", | 1412 | dprintk(1, "unknown input type set [%d]\n", |
1423 | AUVI_INPUT(index).type); | 1413 | AUVI_INPUT(index).type); |
1424 | break; | 1414 | break; |
1425 | } | 1415 | } |
@@ -1450,6 +1440,21 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int index) | |||
1450 | 1440 | ||
1451 | v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing, | 1441 | v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing, |
1452 | AUVI_INPUT(index).amux, 0, 0); | 1442 | AUVI_INPUT(index).amux, 0, 0); |
1443 | } | ||
1444 | |||
1445 | static int vidioc_s_input(struct file *file, void *priv, unsigned int index) | ||
1446 | { | ||
1447 | struct au0828_fh *fh = priv; | ||
1448 | struct au0828_dev *dev = fh->dev; | ||
1449 | |||
1450 | dprintk(1, "VIDIOC_S_INPUT in function %s, input=%d\n", __func__, | ||
1451 | index); | ||
1452 | if (index >= AU0828_MAX_INPUT) | ||
1453 | return -EINVAL; | ||
1454 | if (AUVI_INPUT(index).type == 0) | ||
1455 | return -EINVAL; | ||
1456 | dev->ctrl_input = index; | ||
1457 | au0828_s_input(dev, index); | ||
1453 | return 0; | 1458 | return 0; |
1454 | } | 1459 | } |
1455 | 1460 | ||
@@ -1982,6 +1987,7 @@ int au0828_analog_register(struct au0828_dev *dev, | |||
1982 | dev->ctrl_ainput = 0; | 1987 | dev->ctrl_ainput = 0; |
1983 | dev->ctrl_freq = 960; | 1988 | dev->ctrl_freq = 960; |
1984 | dev->std = V4L2_STD_NTSC_M; | 1989 | dev->std = V4L2_STD_NTSC_M; |
1990 | au0828_s_input(dev, 0); | ||
1985 | 1991 | ||
1986 | /* allocate and fill v4l2 video struct */ | 1992 | /* allocate and fill v4l2 video struct */ |
1987 | dev->vdev = video_device_alloc(); | 1993 | dev->vdev = video_device_alloc(); |