aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/tuner-driver.h')
-rw-r--r--drivers/media/video/tuner-driver.h107
1 files changed, 107 insertions, 0 deletions
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 */