diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2015-01-16 04:58:32 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-01-27 07:14:20 -0500 |
commit | 35655bf85473abae9ff76f25ec6b321f9935c7bc (patch) | |
tree | bd134db63cf798b838702305fb7c94f6343e07e8 | |
parent | 6994ca3df1b4cd7a2577a1b6e41431d8ace457a4 (diff) |
[media] bttv: Improve TEA575x support
Improve g_tuner and add s_hw_freq_seek and enum_freq_bands support for cards
with TEA575x radio.
This allows signal/stereo detection and HW seek to work on these cards.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/pci/bt8xx/bttv-driver.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index e7f8aded35f8..4ec2a3c3f23c 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c | |||
@@ -2515,6 +2515,8 @@ static int bttv_querycap(struct file *file, void *priv, | |||
2515 | if (btv->has_saa6588) | 2515 | if (btv->has_saa6588) |
2516 | cap->device_caps |= V4L2_CAP_READWRITE | | 2516 | cap->device_caps |= V4L2_CAP_READWRITE | |
2517 | V4L2_CAP_RDS_CAPTURE; | 2517 | V4L2_CAP_RDS_CAPTURE; |
2518 | if (btv->has_tea575x) | ||
2519 | cap->device_caps |= V4L2_CAP_HW_FREQ_SEEK; | ||
2518 | } | 2520 | } |
2519 | return 0; | 2521 | return 0; |
2520 | } | 2522 | } |
@@ -3244,6 +3246,9 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t) | |||
3244 | if (btv->audio_mode_gpio) | 3246 | if (btv->audio_mode_gpio) |
3245 | btv->audio_mode_gpio(btv, t, 0); | 3247 | btv->audio_mode_gpio(btv, t, 0); |
3246 | 3248 | ||
3249 | if (btv->has_tea575x) | ||
3250 | return snd_tea575x_g_tuner(&btv->tea, t); | ||
3251 | |||
3247 | return 0; | 3252 | return 0; |
3248 | } | 3253 | } |
3249 | 3254 | ||
@@ -3261,6 +3266,30 @@ static int radio_s_tuner(struct file *file, void *priv, | |||
3261 | return 0; | 3266 | return 0; |
3262 | } | 3267 | } |
3263 | 3268 | ||
3269 | static int radio_s_hw_freq_seek(struct file *file, void *priv, | ||
3270 | const struct v4l2_hw_freq_seek *a) | ||
3271 | { | ||
3272 | struct bttv_fh *fh = priv; | ||
3273 | struct bttv *btv = fh->btv; | ||
3274 | |||
3275 | if (btv->has_tea575x) | ||
3276 | return snd_tea575x_s_hw_freq_seek(file, &btv->tea, a); | ||
3277 | |||
3278 | return -ENOTTY; | ||
3279 | } | ||
3280 | |||
3281 | static int radio_enum_freq_bands(struct file *file, void *priv, | ||
3282 | struct v4l2_frequency_band *band) | ||
3283 | { | ||
3284 | struct bttv_fh *fh = priv; | ||
3285 | struct bttv *btv = fh->btv; | ||
3286 | |||
3287 | if (btv->has_tea575x) | ||
3288 | return snd_tea575x_enum_freq_bands(&btv->tea, band); | ||
3289 | |||
3290 | return -ENOTTY; | ||
3291 | } | ||
3292 | |||
3264 | static ssize_t radio_read(struct file *file, char __user *data, | 3293 | static ssize_t radio_read(struct file *file, char __user *data, |
3265 | size_t count, loff_t *ppos) | 3294 | size_t count, loff_t *ppos) |
3266 | { | 3295 | { |
@@ -3318,6 +3347,8 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = { | |||
3318 | .vidioc_s_tuner = radio_s_tuner, | 3347 | .vidioc_s_tuner = radio_s_tuner, |
3319 | .vidioc_g_frequency = bttv_g_frequency, | 3348 | .vidioc_g_frequency = bttv_g_frequency, |
3320 | .vidioc_s_frequency = bttv_s_frequency, | 3349 | .vidioc_s_frequency = bttv_s_frequency, |
3350 | .vidioc_s_hw_freq_seek = radio_s_hw_freq_seek, | ||
3351 | .vidioc_enum_freq_bands = radio_enum_freq_bands, | ||
3321 | .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, | 3352 | .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, |
3322 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, | 3353 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, |
3323 | }; | 3354 | }; |