diff options
author | Antti Palosaari <crope@iki.fi> | 2015-10-10 12:51:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-10-20 13:42:47 -0400 |
commit | 4124a3c4abcf3c37d2445ff9a936a2d08988e01a (patch) | |
tree | 4708d38a2f151294c74a34a42dac039d49297070 | |
parent | be8ee526fb0b91681fb02d69d2a642a6ec2f2377 (diff) |
[media] v4l: add type field to v4l2_modulator struct
Add type field to that struct like it counterpart v4l2_tuner
already has. We need type field to distinguish different tuner
types from each others for transmitter too.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/v4l2-core/v4l2-ioctl.c | 18 | ||||
-rw-r--r-- | include/uapi/linux/videodev2.h | 3 |
2 files changed, 19 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 073ab36b880a..7486af2c8ae4 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c | |||
@@ -1646,15 +1646,31 @@ static int v4l_s_tuner(const struct v4l2_ioctl_ops *ops, | |||
1646 | static int v4l_g_modulator(const struct v4l2_ioctl_ops *ops, | 1646 | static int v4l_g_modulator(const struct v4l2_ioctl_ops *ops, |
1647 | struct file *file, void *fh, void *arg) | 1647 | struct file *file, void *fh, void *arg) |
1648 | { | 1648 | { |
1649 | struct video_device *vfd = video_devdata(file); | ||
1649 | struct v4l2_modulator *p = arg; | 1650 | struct v4l2_modulator *p = arg; |
1650 | int err; | 1651 | int err; |
1651 | 1652 | ||
1653 | if (vfd->vfl_type == VFL_TYPE_RADIO) | ||
1654 | p->type = V4L2_TUNER_RADIO; | ||
1655 | |||
1652 | err = ops->vidioc_g_modulator(file, fh, p); | 1656 | err = ops->vidioc_g_modulator(file, fh, p); |
1653 | if (!err) | 1657 | if (!err) |
1654 | p->capability |= V4L2_TUNER_CAP_FREQ_BANDS; | 1658 | p->capability |= V4L2_TUNER_CAP_FREQ_BANDS; |
1655 | return err; | 1659 | return err; |
1656 | } | 1660 | } |
1657 | 1661 | ||
1662 | static int v4l_s_modulator(const struct v4l2_ioctl_ops *ops, | ||
1663 | struct file *file, void *fh, void *arg) | ||
1664 | { | ||
1665 | struct video_device *vfd = video_devdata(file); | ||
1666 | struct v4l2_modulator *p = arg; | ||
1667 | |||
1668 | if (vfd->vfl_type == VFL_TYPE_RADIO) | ||
1669 | p->type = V4L2_TUNER_RADIO; | ||
1670 | |||
1671 | return ops->vidioc_s_modulator(file, fh, p); | ||
1672 | } | ||
1673 | |||
1658 | static int v4l_g_frequency(const struct v4l2_ioctl_ops *ops, | 1674 | static int v4l_g_frequency(const struct v4l2_ioctl_ops *ops, |
1659 | struct file *file, void *fh, void *arg) | 1675 | struct file *file, void *fh, void *arg) |
1660 | { | 1676 | { |
@@ -2441,7 +2457,7 @@ static struct v4l2_ioctl_info v4l2_ioctls[] = { | |||
2441 | IOCTL_INFO_STD(VIDIOC_G_AUDOUT, vidioc_g_audout, v4l_print_audioout, 0), | 2457 | IOCTL_INFO_STD(VIDIOC_G_AUDOUT, vidioc_g_audout, v4l_print_audioout, 0), |
2442 | IOCTL_INFO_STD(VIDIOC_S_AUDOUT, vidioc_s_audout, v4l_print_audioout, INFO_FL_PRIO), | 2458 | IOCTL_INFO_STD(VIDIOC_S_AUDOUT, vidioc_s_audout, v4l_print_audioout, INFO_FL_PRIO), |
2443 | IOCTL_INFO_FNC(VIDIOC_G_MODULATOR, v4l_g_modulator, v4l_print_modulator, INFO_FL_CLEAR(v4l2_modulator, index)), | 2459 | IOCTL_INFO_FNC(VIDIOC_G_MODULATOR, v4l_g_modulator, v4l_print_modulator, INFO_FL_CLEAR(v4l2_modulator, index)), |
2444 | IOCTL_INFO_STD(VIDIOC_S_MODULATOR, vidioc_s_modulator, v4l_print_modulator, INFO_FL_PRIO), | 2460 | IOCTL_INFO_FNC(VIDIOC_S_MODULATOR, v4l_s_modulator, v4l_print_modulator, INFO_FL_PRIO), |
2445 | IOCTL_INFO_FNC(VIDIOC_G_FREQUENCY, v4l_g_frequency, v4l_print_frequency, INFO_FL_CLEAR(v4l2_frequency, tuner)), | 2461 | IOCTL_INFO_FNC(VIDIOC_G_FREQUENCY, v4l_g_frequency, v4l_print_frequency, INFO_FL_CLEAR(v4l2_frequency, tuner)), |
2446 | IOCTL_INFO_FNC(VIDIOC_S_FREQUENCY, v4l_s_frequency, v4l_print_frequency, INFO_FL_PRIO), | 2462 | IOCTL_INFO_FNC(VIDIOC_S_FREQUENCY, v4l_s_frequency, v4l_print_frequency, INFO_FL_PRIO), |
2447 | IOCTL_INFO_FNC(VIDIOC_CROPCAP, v4l_cropcap, v4l_print_cropcap, INFO_FL_CLEAR(v4l2_cropcap, type)), | 2463 | IOCTL_INFO_FNC(VIDIOC_CROPCAP, v4l_cropcap, v4l_print_cropcap, INFO_FL_CLEAR(v4l2_cropcap, type)), |
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index f95e1ef0e7e6..a0e87d16b726 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h | |||
@@ -1593,7 +1593,8 @@ struct v4l2_modulator { | |||
1593 | __u32 rangelow; | 1593 | __u32 rangelow; |
1594 | __u32 rangehigh; | 1594 | __u32 rangehigh; |
1595 | __u32 txsubchans; | 1595 | __u32 txsubchans; |
1596 | __u32 reserved[4]; | 1596 | __u32 type; /* enum v4l2_tuner_type */ |
1597 | __u32 reserved[3]; | ||
1597 | }; | 1598 | }; |
1598 | 1599 | ||
1599 | /* Flags for the 'capability' field */ | 1600 | /* Flags for the 'capability' field */ |