aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/bt8xx/bttv-driver.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-02-06 10:43:07 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-05 12:23:02 -0500
commit6795cc55506606988175c16aa0e17d9f349706ca (patch)
tree3e91f8a56c2ea5ce6e5bbcbcd841d64ce06147e0 /drivers/media/pci/bt8xx/bttv-driver.c
parent8c14cc1f0ade4e16d4d3384791807abb4f367731 (diff)
[media] bttv: use centralized std and implement g_std
The 'current_norm' field cannot be used if multiple device nodes (video and vbi in this case) set the same std. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/pci/bt8xx/bttv-driver.c')
-rw-r--r--drivers/media/pci/bt8xx/bttv-driver.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 41de79ba5930..46ead7d65af1 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -1716,6 +1716,7 @@ static int bttv_s_std(struct file *file, void *priv, v4l2_std_id *id)
1716 goto err; 1716 goto err;
1717 } 1717 }
1718 1718
1719 btv->std = *id;
1719 set_tvnorm(btv, i); 1720 set_tvnorm(btv, i);
1720 1721
1721err: 1722err:
@@ -1723,6 +1724,15 @@ err:
1723 return err; 1724 return err;
1724} 1725}
1725 1726
1727static int bttv_g_std(struct file *file, void *priv, v4l2_std_id *id)
1728{
1729 struct bttv_fh *fh = priv;
1730 struct bttv *btv = fh->btv;
1731
1732 *id = btv->std;
1733 return 0;
1734}
1735
1726static int bttv_querystd(struct file *file, void *f, v4l2_std_id *id) 1736static int bttv_querystd(struct file *file, void *f, v4l2_std_id *id)
1727{ 1737{
1728 struct bttv_fh *fh = f; 1738 struct bttv_fh *fh = f;
@@ -3166,6 +3176,7 @@ static const struct v4l2_ioctl_ops bttv_ioctl_ops = {
3166 .vidioc_qbuf = bttv_qbuf, 3176 .vidioc_qbuf = bttv_qbuf,
3167 .vidioc_dqbuf = bttv_dqbuf, 3177 .vidioc_dqbuf = bttv_dqbuf,
3168 .vidioc_s_std = bttv_s_std, 3178 .vidioc_s_std = bttv_s_std,
3179 .vidioc_g_std = bttv_g_std,
3169 .vidioc_enum_input = bttv_enum_input, 3180 .vidioc_enum_input = bttv_enum_input,
3170 .vidioc_g_input = bttv_g_input, 3181 .vidioc_g_input = bttv_g_input,
3171 .vidioc_s_input = bttv_s_input, 3182 .vidioc_s_input = bttv_s_input,
@@ -3196,7 +3207,6 @@ static struct video_device bttv_video_template = {
3196 .fops = &bttv_fops, 3207 .fops = &bttv_fops,
3197 .ioctl_ops = &bttv_ioctl_ops, 3208 .ioctl_ops = &bttv_ioctl_ops,
3198 .tvnorms = BTTV_NORMS, 3209 .tvnorms = BTTV_NORMS,
3199 .current_norm = V4L2_STD_PAL,
3200}; 3210};
3201 3211
3202/* ----------------------------------------------------------------------- */ 3212/* ----------------------------------------------------------------------- */
@@ -4192,6 +4202,7 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
4192 bttv_set_frequency(btv, &init_freq); 4202 bttv_set_frequency(btv, &init_freq);
4193 btv->radio_freq = 90500 * 16; /* 90.5Mhz default */ 4203 btv->radio_freq = 90500 * 16; /* 90.5Mhz default */
4194 } 4204 }
4205 btv->std = V4L2_STD_PAL;
4195 init_irqreg(btv); 4206 init_irqreg(btv);
4196 v4l2_ctrl_handler_setup(hdl); 4207 v4l2_ctrl_handler_setup(hdl);
4197 4208