V4L/DVB (6715): ivtv: Remove unnecessary register update
[linux-2.6/verdex.git] / drivers / media / video / tuner-driver.h
bloba4db32d97a126422eca4006c6df8d80d74c7aad1
1 /*
2 tuner-driver.h - interface for different tuners
4 Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de)
5 minor modifications by Ralph Metzler (rjkm@thp.uni-koeln.de)
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.
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.
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.
22 #ifndef __TUNER_DRIVER_H__
23 #define __TUNER_DRIVER_H__
25 #include <linux/videodev2.h>
26 #include <linux/i2c.h>
27 #include "tuner-i2c.h"
28 #include "dvb_frontend.h"
30 extern unsigned const int tuner_count;
32 struct tuner;
34 struct analog_tuner_ops {
35 void (*set_tv_freq)(struct dvb_frontend *fe, unsigned int freq);
36 void (*set_radio_freq)(struct dvb_frontend *fe, unsigned int freq);
37 int (*has_signal)(struct dvb_frontend *fe);
38 int (*is_stereo)(struct dvb_frontend *fe);
39 int (*get_afc)(struct dvb_frontend *fe);
40 void (*tuner_status)(struct dvb_frontend *fe);
41 void (*standby)(struct dvb_frontend *fe);
42 void (*release)(struct dvb_frontend *fe);
43 int (*i2c_gate_ctrl)(struct dvb_frontend *fe, int enable);
46 struct tuner {
47 /* device */
48 struct i2c_client *i2c;
49 struct list_head list; /* list of tuners */
51 unsigned int type; /* chip type */
53 unsigned int mode;
54 unsigned int mode_mask; /* Combination of allowable modes */
56 unsigned int tv_freq; /* keep track of the current settings */
57 unsigned int radio_freq;
58 unsigned int audmode;
59 v4l2_std_id std;
61 int using_v4l2;
63 struct dvb_frontend fe;
65 /* used by tda9887 */
66 unsigned int tda9887_config;
68 unsigned int config;
69 int (*tuner_callback) (void *dev, int command,int arg);
72 /* ------------------------------------------------------------------------ */
74 #define tuner_warn(fmt, arg...) do { \
75 printk(KERN_WARNING "%s %d-%04x: " fmt, PREFIX, \
76 i2c_adapter_id(t->i2c->adapter), t->i2c->addr, ##arg); \
77 } while (0)
79 #define tuner_info(fmt, arg...) do { \
80 printk(KERN_INFO "%s %d-%04x: " fmt, PREFIX, \
81 i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); \
82 } while (0)
84 #define tuner_err(fmt, arg...) do { \
85 printk(KERN_ERR "%s %d-%04x: " fmt, PREFIX, \
86 i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); \
87 } while (0)
89 #define tuner_dbg(fmt, arg...) do { \
90 extern int tuner_debug; \
91 if (tuner_debug) \
92 printk(KERN_DEBUG "%s %d-%04x: " fmt, PREFIX, \
93 i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); \
94 } while (0)
96 #endif /* __TUNER_DRIVER_H__ */