diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2015-01-15 15:10:46 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-01-27 07:13:50 -0500 |
commit | 6994ca3df1b4cd7a2577a1b6e41431d8ace457a4 (patch) | |
tree | 4705c3bf52519179c93ac428fb2816e9e1869af6 /drivers/media/radio/tea575x.c | |
parent | 1b500373157c7c4da2765e3416834e86224373d6 (diff) |
[media] tea575x: split and export functions
Split ioctl interface from enum_freq_bands, g_tuner and s_hw_freq_seek
functions and export them to be used in other drivers like bttv.
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>
Diffstat (limited to 'drivers/media/radio/tea575x.c')
-rw-r--r-- | drivers/media/radio/tea575x.c | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/drivers/media/radio/tea575x.c b/drivers/media/radio/tea575x.c index f1a0867789fe..43d1ea53cb66 100644 --- a/drivers/media/radio/tea575x.c +++ b/drivers/media/radio/tea575x.c | |||
@@ -247,10 +247,9 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
247 | return 0; | 247 | return 0; |
248 | } | 248 | } |
249 | 249 | ||
250 | static int vidioc_enum_freq_bands(struct file *file, void *priv, | 250 | int snd_tea575x_enum_freq_bands(struct snd_tea575x *tea, |
251 | struct v4l2_frequency_band *band) | 251 | struct v4l2_frequency_band *band) |
252 | { | 252 | { |
253 | struct snd_tea575x *tea = video_drvdata(file); | ||
254 | int index; | 253 | int index; |
255 | 254 | ||
256 | if (band->tuner != 0) | 255 | if (band->tuner != 0) |
@@ -279,18 +278,25 @@ static int vidioc_enum_freq_bands(struct file *file, void *priv, | |||
279 | 278 | ||
280 | return 0; | 279 | return 0; |
281 | } | 280 | } |
281 | EXPORT_SYMBOL(snd_tea575x_enum_freq_bands); | ||
282 | 282 | ||
283 | static int vidioc_g_tuner(struct file *file, void *priv, | 283 | static int vidioc_enum_freq_bands(struct file *file, void *priv, |
284 | struct v4l2_tuner *v) | 284 | struct v4l2_frequency_band *band) |
285 | { | 285 | { |
286 | struct snd_tea575x *tea = video_drvdata(file); | 286 | struct snd_tea575x *tea = video_drvdata(file); |
287 | |||
288 | return snd_tea575x_enum_freq_bands(tea, band); | ||
289 | } | ||
290 | |||
291 | int snd_tea575x_g_tuner(struct snd_tea575x *tea, struct v4l2_tuner *v) | ||
292 | { | ||
287 | struct v4l2_frequency_band band_fm = { 0, }; | 293 | struct v4l2_frequency_band band_fm = { 0, }; |
288 | 294 | ||
289 | if (v->index > 0) | 295 | if (v->index > 0) |
290 | return -EINVAL; | 296 | return -EINVAL; |
291 | 297 | ||
292 | snd_tea575x_read(tea); | 298 | snd_tea575x_read(tea); |
293 | vidioc_enum_freq_bands(file, priv, &band_fm); | 299 | snd_tea575x_enum_freq_bands(tea, &band_fm); |
294 | 300 | ||
295 | memset(v, 0, sizeof(*v)); | 301 | memset(v, 0, sizeof(*v)); |
296 | strlcpy(v->name, tea->has_am ? "FM/AM" : "FM", sizeof(v->name)); | 302 | strlcpy(v->name, tea->has_am ? "FM/AM" : "FM", sizeof(v->name)); |
@@ -304,6 +310,15 @@ static int vidioc_g_tuner(struct file *file, void *priv, | |||
304 | v->signal = tea->tuned ? 0xffff : 0; | 310 | v->signal = tea->tuned ? 0xffff : 0; |
305 | return 0; | 311 | return 0; |
306 | } | 312 | } |
313 | EXPORT_SYMBOL(snd_tea575x_g_tuner); | ||
314 | |||
315 | static int vidioc_g_tuner(struct file *file, void *priv, | ||
316 | struct v4l2_tuner *v) | ||
317 | { | ||
318 | struct snd_tea575x *tea = video_drvdata(file); | ||
319 | |||
320 | return snd_tea575x_g_tuner(tea, v); | ||
321 | } | ||
307 | 322 | ||
308 | static int vidioc_s_tuner(struct file *file, void *priv, | 323 | static int vidioc_s_tuner(struct file *file, void *priv, |
309 | const struct v4l2_tuner *v) | 324 | const struct v4l2_tuner *v) |
@@ -356,10 +371,9 @@ static int vidioc_s_frequency(struct file *file, void *priv, | |||
356 | return 0; | 371 | return 0; |
357 | } | 372 | } |
358 | 373 | ||
359 | static int vidioc_s_hw_freq_seek(struct file *file, void *fh, | 374 | int snd_tea575x_s_hw_freq_seek(struct file *file, struct snd_tea575x *tea, |
360 | const struct v4l2_hw_freq_seek *a) | 375 | const struct v4l2_hw_freq_seek *a) |
361 | { | 376 | { |
362 | struct snd_tea575x *tea = video_drvdata(file); | ||
363 | unsigned long timeout; | 377 | unsigned long timeout; |
364 | int i, spacing; | 378 | int i, spacing; |
365 | 379 | ||
@@ -442,6 +456,15 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *fh, | |||
442 | snd_tea575x_set_freq(tea); | 456 | snd_tea575x_set_freq(tea); |
443 | return -ENODATA; | 457 | return -ENODATA; |
444 | } | 458 | } |
459 | EXPORT_SYMBOL(snd_tea575x_s_hw_freq_seek); | ||
460 | |||
461 | static int vidioc_s_hw_freq_seek(struct file *file, void *fh, | ||
462 | const struct v4l2_hw_freq_seek *a) | ||
463 | { | ||
464 | struct snd_tea575x *tea = video_drvdata(file); | ||
465 | |||
466 | return snd_tea575x_s_hw_freq_seek(file, tea, a); | ||
467 | } | ||
445 | 468 | ||
446 | static int tea575x_s_ctrl(struct v4l2_ctrl *ctrl) | 469 | static int tea575x_s_ctrl(struct v4l2_ctrl *ctrl) |
447 | { | 470 | { |