aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-05-25 11:15:30 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-06 17:13:38 -0400
commit48d68801d7fe2cefd3963428917b74c93a69ff99 (patch)
tree9f5269f8747aecdab42d0039a38d9bfda1da4ba1 /drivers/media
parentf33e9868a46d943624fd34a4fba28b7f076e6d33 (diff)
[media] cx88: don't use current_norm
current_norm can only be used if there is a single device node since it is local to the device node. In this case multiple device nodes share a single tuner. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c12
-rw-r--r--drivers/media/video/cx88/cx88-video.c14
2 files changed, 20 insertions, 6 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index 38efc1fdb75f..e3bc8f7fcff4 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -930,6 +930,14 @@ static int vidioc_s_tuner (struct file *file, void *priv,
930 return 0; 930 return 0;
931} 931}
932 932
933static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *tvnorm)
934{
935 struct cx88_core *core = ((struct cx8802_fh *)priv)->dev->core;
936
937 *tvnorm = core->tvnorm;
938 return 0;
939}
940
933static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id) 941static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id)
934{ 942{
935 struct cx88_core *core = ((struct cx8802_fh *)priv)->dev->core; 943 struct cx88_core *core = ((struct cx8802_fh *)priv)->dev->core;
@@ -1104,6 +1112,7 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
1104 .vidioc_s_input = vidioc_s_input, 1112 .vidioc_s_input = vidioc_s_input,
1105 .vidioc_g_tuner = vidioc_g_tuner, 1113 .vidioc_g_tuner = vidioc_g_tuner,
1106 .vidioc_s_tuner = vidioc_s_tuner, 1114 .vidioc_s_tuner = vidioc_s_tuner,
1115 .vidioc_g_std = vidioc_g_std,
1107 .vidioc_s_std = vidioc_s_std, 1116 .vidioc_s_std = vidioc_s_std,
1108 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 1117 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
1109 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 1118 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
@@ -1114,7 +1123,6 @@ static struct video_device cx8802_mpeg_template = {
1114 .fops = &mpeg_fops, 1123 .fops = &mpeg_fops,
1115 .ioctl_ops = &mpeg_ioctl_ops, 1124 .ioctl_ops = &mpeg_ioctl_ops,
1116 .tvnorms = CX88_NORMS, 1125 .tvnorms = CX88_NORMS,
1117 .current_norm = V4L2_STD_NTSC_M,
1118}; 1126};
1119 1127
1120/* ------------------------------------------------------------------ */ 1128/* ------------------------------------------------------------------ */
@@ -1214,8 +1222,6 @@ static int cx8802_blackbird_probe(struct cx8802_driver *drv)
1214 if (!(core->board.mpeg & CX88_MPEG_BLACKBIRD)) 1222 if (!(core->board.mpeg & CX88_MPEG_BLACKBIRD))
1215 goto fail_core; 1223 goto fail_core;
1216 1224
1217 cx8802_mpeg_template.current_norm = core->tvnorm;
1218
1219 dev->width = 720; 1225 dev->width = 720;
1220 if (core->tvnorm & V4L2_STD_525_60) { 1226 if (core->tvnorm & V4L2_STD_525_60) {
1221 dev->height = 480; 1227 dev->height = 480;
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 3dee42141979..f6fcc7e763ab 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1185,6 +1185,14 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
1185 return 0; 1185 return 0;
1186} 1186}
1187 1187
1188static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *tvnorm)
1189{
1190 struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
1191
1192 *tvnorm = core->tvnorm;
1193 return 0;
1194}
1195
1188static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *tvnorms) 1196static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *tvnorms)
1189{ 1197{
1190 struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core; 1198 struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
@@ -1562,6 +1570,7 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
1562 .vidioc_querybuf = vidioc_querybuf, 1570 .vidioc_querybuf = vidioc_querybuf,
1563 .vidioc_qbuf = vidioc_qbuf, 1571 .vidioc_qbuf = vidioc_qbuf,
1564 .vidioc_dqbuf = vidioc_dqbuf, 1572 .vidioc_dqbuf = vidioc_dqbuf,
1573 .vidioc_g_std = vidioc_g_std,
1565 .vidioc_s_std = vidioc_s_std, 1574 .vidioc_s_std = vidioc_s_std,
1566 .vidioc_enum_input = vidioc_enum_input, 1575 .vidioc_enum_input = vidioc_enum_input,
1567 .vidioc_g_input = vidioc_g_input, 1576 .vidioc_g_input = vidioc_g_input,
@@ -1586,7 +1595,6 @@ static const struct video_device cx8800_video_template = {
1586 .fops = &video_fops, 1595 .fops = &video_fops,
1587 .ioctl_ops = &video_ioctl_ops, 1596 .ioctl_ops = &video_ioctl_ops,
1588 .tvnorms = CX88_NORMS, 1597 .tvnorms = CX88_NORMS,
1589 .current_norm = V4L2_STD_NTSC_M,
1590}; 1598};
1591 1599
1592static const struct v4l2_ioctl_ops vbi_ioctl_ops = { 1600static const struct v4l2_ioctl_ops vbi_ioctl_ops = {
@@ -1598,6 +1606,7 @@ static const struct v4l2_ioctl_ops vbi_ioctl_ops = {
1598 .vidioc_querybuf = vidioc_querybuf, 1606 .vidioc_querybuf = vidioc_querybuf,
1599 .vidioc_qbuf = vidioc_qbuf, 1607 .vidioc_qbuf = vidioc_qbuf,
1600 .vidioc_dqbuf = vidioc_dqbuf, 1608 .vidioc_dqbuf = vidioc_dqbuf,
1609 .vidioc_g_std = vidioc_g_std,
1601 .vidioc_s_std = vidioc_s_std, 1610 .vidioc_s_std = vidioc_s_std,
1602 .vidioc_enum_input = vidioc_enum_input, 1611 .vidioc_enum_input = vidioc_enum_input,
1603 .vidioc_g_input = vidioc_g_input, 1612 .vidioc_g_input = vidioc_g_input,
@@ -1620,7 +1629,6 @@ static const struct video_device cx8800_vbi_template = {
1620 .fops = &video_fops, 1629 .fops = &video_fops,
1621 .ioctl_ops = &vbi_ioctl_ops, 1630 .ioctl_ops = &vbi_ioctl_ops,
1622 .tvnorms = CX88_NORMS, 1631 .tvnorms = CX88_NORMS,
1623 .current_norm = V4L2_STD_NTSC_M,
1624}; 1632};
1625 1633
1626static const struct v4l2_file_operations radio_fops = 1634static const struct v4l2_file_operations radio_fops =
@@ -1730,7 +1738,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1730 1738
1731 /* initialize driver struct */ 1739 /* initialize driver struct */
1732 spin_lock_init(&dev->slock); 1740 spin_lock_init(&dev->slock);
1733 core->tvnorm = cx8800_video_template.current_norm; 1741 core->tvnorm = V4L2_STD_NTSC_M;
1734 1742
1735 /* init video dma queues */ 1743 /* init video dma queues */
1736 INIT_LIST_HEAD(&dev->vidq.active); 1744 INIT_LIST_HEAD(&dev->vidq.active);