mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 18:11:20 +00:00
[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>
This commit is contained in:
parent
8c14cc1f0a
commit
6795cc5550
2 changed files with 13 additions and 1 deletions
|
@ -1716,6 +1716,7 @@ static int bttv_s_std(struct file *file, void *priv, v4l2_std_id *id)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
btv->std = *id;
|
||||||
set_tvnorm(btv, i);
|
set_tvnorm(btv, i);
|
||||||
|
|
||||||
err:
|
err:
|
||||||
|
@ -1723,6 +1724,15 @@ err:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int bttv_g_std(struct file *file, void *priv, v4l2_std_id *id)
|
||||||
|
{
|
||||||
|
struct bttv_fh *fh = priv;
|
||||||
|
struct bttv *btv = fh->btv;
|
||||||
|
|
||||||
|
*id = btv->std;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int bttv_querystd(struct file *file, void *f, v4l2_std_id *id)
|
static int bttv_querystd(struct file *file, void *f, v4l2_std_id *id)
|
||||||
{
|
{
|
||||||
struct bttv_fh *fh = f;
|
struct bttv_fh *fh = f;
|
||||||
|
@ -3166,6 +3176,7 @@ static const struct v4l2_ioctl_ops bttv_ioctl_ops = {
|
||||||
.vidioc_qbuf = bttv_qbuf,
|
.vidioc_qbuf = bttv_qbuf,
|
||||||
.vidioc_dqbuf = bttv_dqbuf,
|
.vidioc_dqbuf = bttv_dqbuf,
|
||||||
.vidioc_s_std = bttv_s_std,
|
.vidioc_s_std = bttv_s_std,
|
||||||
|
.vidioc_g_std = bttv_g_std,
|
||||||
.vidioc_enum_input = bttv_enum_input,
|
.vidioc_enum_input = bttv_enum_input,
|
||||||
.vidioc_g_input = bttv_g_input,
|
.vidioc_g_input = bttv_g_input,
|
||||||
.vidioc_s_input = bttv_s_input,
|
.vidioc_s_input = bttv_s_input,
|
||||||
|
@ -3196,7 +3207,6 @@ static struct video_device bttv_video_template = {
|
||||||
.fops = &bttv_fops,
|
.fops = &bttv_fops,
|
||||||
.ioctl_ops = &bttv_ioctl_ops,
|
.ioctl_ops = &bttv_ioctl_ops,
|
||||||
.tvnorms = BTTV_NORMS,
|
.tvnorms = BTTV_NORMS,
|
||||||
.current_norm = V4L2_STD_PAL,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
@ -4192,6 +4202,7 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
|
||||||
bttv_set_frequency(btv, &init_freq);
|
bttv_set_frequency(btv, &init_freq);
|
||||||
btv->radio_freq = 90500 * 16; /* 90.5Mhz default */
|
btv->radio_freq = 90500 * 16; /* 90.5Mhz default */
|
||||||
}
|
}
|
||||||
|
btv->std = V4L2_STD_PAL;
|
||||||
init_irqreg(btv);
|
init_irqreg(btv);
|
||||||
v4l2_ctrl_handler_setup(hdl);
|
v4l2_ctrl_handler_setup(hdl);
|
||||||
|
|
||||||
|
|
|
@ -424,6 +424,7 @@ struct bttv {
|
||||||
unsigned int mute;
|
unsigned int mute;
|
||||||
unsigned long tv_freq;
|
unsigned long tv_freq;
|
||||||
unsigned int tvnorm;
|
unsigned int tvnorm;
|
||||||
|
v4l2_std_id std;
|
||||||
int hue, contrast, bright, saturation;
|
int hue, contrast, bright, saturation;
|
||||||
struct v4l2_framebuffer fbuf;
|
struct v4l2_framebuffer fbuf;
|
||||||
unsigned int field_count;
|
unsigned int field_count;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue