Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Ondrej Zary and committed by
Mauro Carvalho Chehab
35655bf8 6994ca3d

+31
+31
drivers/media/pci/bt8xx/bttv-driver.c
··· 2515 2515 if (btv->has_saa6588) 2516 2516 cap->device_caps |= V4L2_CAP_READWRITE | 2517 2517 V4L2_CAP_RDS_CAPTURE; 2518 + if (btv->has_tea575x) 2519 + cap->device_caps |= V4L2_CAP_HW_FREQ_SEEK; 2518 2520 } 2519 2521 return 0; 2520 2522 } ··· 3246 3244 if (btv->audio_mode_gpio) 3247 3245 btv->audio_mode_gpio(btv, t, 0); 3248 3246 3247 + if (btv->has_tea575x) 3248 + return snd_tea575x_g_tuner(&btv->tea, t); 3249 + 3249 3250 return 0; 3250 3251 } 3251 3252 ··· 3264 3259 radio_enable(btv); 3265 3260 bttv_call_all(btv, tuner, s_tuner, t); 3266 3261 return 0; 3262 + } 3263 + 3264 + static int radio_s_hw_freq_seek(struct file *file, void *priv, 3265 + const struct v4l2_hw_freq_seek *a) 3266 + { 3267 + struct bttv_fh *fh = priv; 3268 + struct bttv *btv = fh->btv; 3269 + 3270 + if (btv->has_tea575x) 3271 + return snd_tea575x_s_hw_freq_seek(file, &btv->tea, a); 3272 + 3273 + return -ENOTTY; 3274 + } 3275 + 3276 + static int radio_enum_freq_bands(struct file *file, void *priv, 3277 + struct v4l2_frequency_band *band) 3278 + { 3279 + struct bttv_fh *fh = priv; 3280 + struct bttv *btv = fh->btv; 3281 + 3282 + if (btv->has_tea575x) 3283 + return snd_tea575x_enum_freq_bands(&btv->tea, band); 3284 + 3285 + return -ENOTTY; 3267 3286 } 3268 3287 3269 3288 static ssize_t radio_read(struct file *file, char __user *data, ··· 3347 3318 .vidioc_s_tuner = radio_s_tuner, 3348 3319 .vidioc_g_frequency = bttv_g_frequency, 3349 3320 .vidioc_s_frequency = bttv_s_frequency, 3321 + .vidioc_s_hw_freq_seek = radio_s_hw_freq_seek, 3322 + .vidioc_enum_freq_bands = radio_enum_freq_bands, 3350 3323 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 3351 3324 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 3352 3325 };