aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/mt20xx.c2
-rw-r--r--drivers/media/video/tda8290.c2
-rw-r--r--drivers/media/video/tda9887.c1
-rw-r--r--drivers/media/video/tea5761.c1
-rw-r--r--drivers/media/video/tea5767.c2
-rw-r--r--drivers/media/video/tuner-core.c1
-rw-r--r--drivers/media/video/tuner-driver.h107
-rw-r--r--drivers/media/video/tuner-simple.c2
-rw-r--r--include/media/tuner.h68
9 files changed, 115 insertions, 71 deletions
diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c
index 8a838bdb01b6..7549114aaaca 100644
--- a/drivers/media/video/mt20xx.c
+++ b/drivers/media/video/mt20xx.c
@@ -7,7 +7,7 @@
7#include <linux/i2c.h> 7#include <linux/i2c.h>
8#include <linux/videodev.h> 8#include <linux/videodev.h>
9#include <linux/moduleparam.h> 9#include <linux/moduleparam.h>
10#include <media/tuner.h> 10#include "tuner-driver.h"
11 11
12/* ---------------------------------------------------------------------- */ 12/* ---------------------------------------------------------------------- */
13 13
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index 9c1b64c51c02..59cff5a3c59e 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -21,7 +21,7 @@
21#include <linux/i2c.h> 21#include <linux/i2c.h>
22#include <linux/videodev.h> 22#include <linux/videodev.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <media/tuner.h> 24#include "tuner-driver.h"
25 25
26/* ---------------------------------------------------------------------- */ 26/* ---------------------------------------------------------------------- */
27 27
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index caca1092790e..a8f773274fe3 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -11,6 +11,7 @@
11 11
12#include <media/v4l2-common.h> 12#include <media/v4l2-common.h>
13#include <media/tuner.h> 13#include <media/tuner.h>
14#include "tuner-driver.h"
14 15
15 16
16/* Chips: 17/* Chips:
diff --git a/drivers/media/video/tea5761.c b/drivers/media/video/tea5761.c
index 2fcb81d4d0dd..ae105c2cd0ac 100644
--- a/drivers/media/video/tea5761.c
+++ b/drivers/media/video/tea5761.c
@@ -11,6 +11,7 @@
11#include <linux/videodev.h> 11#include <linux/videodev.h>
12#include <linux/delay.h> 12#include <linux/delay.h>
13#include <media/tuner.h> 13#include <media/tuner.h>
14#include "tuner-driver.h"
14 15
15#define PREFIX "TEA5761 " 16#define PREFIX "TEA5761 "
16 17
diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c
index 9cce9be718c5..4985d47a508f 100644
--- a/drivers/media/video/tea5767.c
+++ b/drivers/media/video/tea5767.c
@@ -13,7 +13,7 @@
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/videodev.h> 14#include <linux/videodev.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <media/tuner.h> 16#include "tuner-driver.h"
17 17
18#define PREFIX "TEA5767 " 18#define PREFIX "TEA5767 "
19 19
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 603476532f5c..e646465464a1 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -20,6 +20,7 @@
20 20
21#include <media/tuner.h> 21#include <media/tuner.h>
22#include <media/v4l2-common.h> 22#include <media/v4l2-common.h>
23#include "tuner-driver.h"
23 24
24#define UNSET (-1U) 25#define UNSET (-1U)
25 26
diff --git a/drivers/media/video/tuner-driver.h b/drivers/media/video/tuner-driver.h
new file mode 100644
index 000000000000..0334a9125077
--- /dev/null
+++ b/drivers/media/video/tuner-driver.h
@@ -0,0 +1,107 @@
1/*
2 tuner-driver.h - interface for different tuners
3
4 Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de)
5 minor modifications by Ralph Metzler (rjkm@thp.uni-koeln.de)
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#ifndef __TUNER_HW_H__
23#define __TUNER_HW_H__
24
25#include <linux/videodev2.h>
26#include <linux/i2c.h>
27
28extern unsigned const int tuner_count;
29
30struct tuner_operations {
31 void (*set_tv_freq)(struct i2c_client *c, unsigned int freq);
32 void (*set_radio_freq)(struct i2c_client *c, unsigned int freq);
33 int (*has_signal)(struct i2c_client *c);
34 int (*is_stereo)(struct i2c_client *c);
35 int (*get_afc)(struct i2c_client *c);
36 void (*tuner_status)(struct i2c_client *c);
37 void (*standby)(struct i2c_client *c);
38 void (*release)(struct i2c_client *c);
39};
40
41struct tuner {
42 /* device */
43 struct i2c_client i2c;
44
45 unsigned int type; /* chip type */
46
47 unsigned int mode;
48 unsigned int mode_mask; /* Combination of allowable modes */
49
50 unsigned int tv_freq; /* keep track of the current settings */
51 unsigned int radio_freq;
52 u16 last_div;
53 unsigned int audmode;
54 v4l2_std_id std;
55
56 int using_v4l2;
57 void *priv;
58
59 /* used by tda9887 */
60 unsigned int tda9887_config;
61
62 unsigned int config;
63 int (*tuner_callback) (void *dev, int command,int arg);
64
65 struct tuner_operations ops;
66};
67
68/* ------------------------------------------------------------------------ */
69
70extern int default_tuner_init(struct i2c_client *c);
71
72extern int tda9887_tuner_init(struct i2c_client *c);
73
74extern int microtune_init(struct i2c_client *c);
75
76extern int tda8290_init(struct i2c_client *c);
77extern int tda8290_probe(struct i2c_client *c);
78
79extern int tea5761_tuner_init(struct i2c_client *c);
80extern int tea5761_autodetection(struct i2c_client *c);
81
82extern int tea5767_autodetection(struct i2c_client *c);
83extern int tea5767_tuner_init(struct i2c_client *c);
84
85/* ------------------------------------------------------------------------ */
86
87#define tuner_warn(fmt, arg...) do {\
88 printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
89 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
90#define tuner_info(fmt, arg...) do {\
91 printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
92 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
93#define tuner_dbg(fmt, arg...) do {\
94 extern int tuner_debug; \
95 if (tuner_debug) \
96 printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
97 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
98
99#endif /* __TUNER_HW_H__ */
100
101/*
102 * Overrides for Emacs so that we follow Linus's tabbing style.
103 * ---------------------------------------------------------------------------
104 * Local variables:
105 * c-basic-offset: 8
106 * End:
107 */
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index fd23c1d8aa26..2d57e8bc0db3 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -8,6 +8,8 @@
8#include <linux/videodev.h> 8#include <linux/videodev.h>
9#include <media/tuner.h> 9#include <media/tuner.h>
10#include <media/v4l2-common.h> 10#include <media/v4l2-common.h>
11#include <media/tuner-types.h>
12#include "tuner-driver.h"
11 13
12static int offset = 0; 14static int offset = 0;
13module_param(offset, int, 0664); 15module_param(offset, int, 0664);
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 88eaf8930203..160381c72e4b 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -23,8 +23,6 @@
23#define _TUNER_H 23#define _TUNER_H
24 24
25#include <linux/videodev2.h> 25#include <linux/videodev2.h>
26#include <linux/i2c.h>
27#include <media/tuner-types.h>
28 26
29extern int tuner_debug; 27extern int tuner_debug;
30 28
@@ -183,72 +181,6 @@ struct tuner_setup {
183 int (*tuner_callback) (void *dev, int command,int arg); 181 int (*tuner_callback) (void *dev, int command,int arg);
184}; 182};
185 183
186struct tuner_operations {
187 void (*set_tv_freq)(struct i2c_client *c, unsigned int freq);
188 void (*set_radio_freq)(struct i2c_client *c, unsigned int freq);
189 int (*has_signal)(struct i2c_client *c);
190 int (*is_stereo)(struct i2c_client *c);
191 int (*get_afc)(struct i2c_client *c);
192 void (*tuner_status)(struct i2c_client *c);
193 void (*standby)(struct i2c_client *c);
194 void (*release)(struct i2c_client *c);
195};
196
197struct tuner {
198 /* device */
199 struct i2c_client i2c;
200
201 unsigned int type; /* chip type */
202
203 unsigned int mode;
204 unsigned int mode_mask; /* Combination of allowable modes */
205
206 unsigned int tv_freq; /* keep track of the current settings */
207 unsigned int radio_freq;
208 u16 last_div;
209 unsigned int audmode;
210 v4l2_std_id std;
211
212 int using_v4l2;
213 void *priv;
214
215 /* used by tda9887 */
216 unsigned int tda9887_config;
217
218 unsigned int config;
219 int (*tuner_callback) (void *dev, int command,int arg);
220
221 struct tuner_operations ops;
222};
223
224extern unsigned const int tuner_count;
225
226extern int microtune_init(struct i2c_client *c);
227extern int xc3028_init(struct i2c_client *c);
228extern int tda8290_init(struct i2c_client *c);
229extern int tda8290_probe(struct i2c_client *c);
230extern int default_tuner_init(struct i2c_client *c);
231
232extern int tea5767_autodetection(struct i2c_client *c);
233extern int tea5767_tuner_init(struct i2c_client *c);
234
235extern int tda9887_tuner_init(struct i2c_client *c);
236
237extern int tea5761_tuner_init(struct i2c_client *c);
238extern int tea5761_autodetection(struct i2c_client *c);
239
240#define tuner_warn(fmt, arg...) do {\
241 printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
242 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
243#define tuner_info(fmt, arg...) do {\
244 printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
245 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
246#define tuner_dbg(fmt, arg...) do {\
247 extern int tuner_debug; \
248 if (tuner_debug) \
249 printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
250 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
251
252#endif /* __KERNEL__ */ 184#endif /* __KERNEL__ */
253 185
254#endif /* _TUNER_H */ 186#endif /* _TUNER_H */