]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[media] tea575x: split and export functions
authorOndrej Zary <linux@rainbow-software.org>
Thu, 15 Jan 2015 20:10:46 +0000 (17:10 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 27 Jan 2015 12:13:50 +0000 (10:13 -0200)
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>
drivers/media/radio/tea575x.c
include/media/tea575x.h

index f1a0867789fe67bd136b669b376776333f5cf3e7..43d1ea53cb666ea8d21e7defe739140359d93e7f 100644 (file)
@@ -247,10 +247,9 @@ static int vidioc_querycap(struct file *file, void  *priv,
        return 0;
 }
 
-static int vidioc_enum_freq_bands(struct file *file, void *priv,
-                                        struct v4l2_frequency_band *band)
+int snd_tea575x_enum_freq_bands(struct snd_tea575x *tea,
+                                       struct v4l2_frequency_band *band)
 {
-       struct snd_tea575x *tea = video_drvdata(file);
        int index;
 
        if (band->tuner != 0)
@@ -279,18 +278,25 @@ static int vidioc_enum_freq_bands(struct file *file, void *priv,
 
        return 0;
 }
+EXPORT_SYMBOL(snd_tea575x_enum_freq_bands);
 
-static int vidioc_g_tuner(struct file *file, void *priv,
-                                       struct v4l2_tuner *v)
+static int vidioc_enum_freq_bands(struct file *file, void *priv,
+                                        struct v4l2_frequency_band *band)
 {
        struct snd_tea575x *tea = video_drvdata(file);
+
+       return snd_tea575x_enum_freq_bands(tea, band);
+}
+
+int snd_tea575x_g_tuner(struct snd_tea575x *tea, struct v4l2_tuner *v)
+{
        struct v4l2_frequency_band band_fm = { 0, };
 
        if (v->index > 0)
                return -EINVAL;
 
        snd_tea575x_read(tea);
-       vidioc_enum_freq_bands(file, priv, &band_fm);
+       snd_tea575x_enum_freq_bands(tea, &band_fm);
 
        memset(v, 0, sizeof(*v));
        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,
        v->signal = tea->tuned ? 0xffff : 0;
        return 0;
 }
+EXPORT_SYMBOL(snd_tea575x_g_tuner);
+
+static int vidioc_g_tuner(struct file *file, void *priv,
+                                       struct v4l2_tuner *v)
+{
+       struct snd_tea575x *tea = video_drvdata(file);
+
+       return snd_tea575x_g_tuner(tea, v);
+}
 
 static int vidioc_s_tuner(struct file *file, void *priv,
                                        const struct v4l2_tuner *v)
@@ -356,10 +371,9 @@ static int vidioc_s_frequency(struct file *file, void *priv,
        return 0;
 }
 
-static int vidioc_s_hw_freq_seek(struct file *file, void *fh,
-                                       const struct v4l2_hw_freq_seek *a)
+int snd_tea575x_s_hw_freq_seek(struct file *file, struct snd_tea575x *tea,
+                               const struct v4l2_hw_freq_seek *a)
 {
-       struct snd_tea575x *tea = video_drvdata(file);
        unsigned long timeout;
        int i, spacing;
 
@@ -442,6 +456,15 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *fh,
        snd_tea575x_set_freq(tea);
        return -ENODATA;
 }
+EXPORT_SYMBOL(snd_tea575x_s_hw_freq_seek);
+
+static int vidioc_s_hw_freq_seek(struct file *file, void *fh,
+                                       const struct v4l2_hw_freq_seek *a)
+{
+       struct snd_tea575x *tea = video_drvdata(file);
+
+       return snd_tea575x_s_hw_freq_seek(file, tea, a);
+}
 
 static int tea575x_s_ctrl(struct v4l2_ctrl *ctrl)
 {
index 2d4fa59db9021059b387b7df5145b7a615c81007..5d096578b73688f7bf9fd95899d8f6f9db7c49a1 100644 (file)
@@ -71,6 +71,11 @@ struct snd_tea575x {
        int (*ext_init)(struct snd_tea575x *tea);
 };
 
+int snd_tea575x_enum_freq_bands(struct snd_tea575x *tea,
+                                       struct v4l2_frequency_band *band);
+int snd_tea575x_g_tuner(struct snd_tea575x *tea, struct v4l2_tuner *v);
+int snd_tea575x_s_hw_freq_seek(struct file *file, struct snd_tea575x *tea,
+                               const struct v4l2_hw_freq_seek *a);
 int snd_tea575x_hw_init(struct snd_tea575x *tea);
 int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner);
 void snd_tea575x_exit(struct snd_tea575x *tea);