]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/media/video/tuner-driver.h
V4L/DVB (6440): tuner: convert analog tuner demod sub-modules to dvb_frontend interface
[mirror_ubuntu-artful-kernel.git] / drivers / media / video / tuner-driver.h
CommitLineData
8218b0b2
MK
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
c996899d
MK
22#ifndef __TUNER_DRIVER_H__
23#define __TUNER_DRIVER_H__
8218b0b2
MK
24
25#include <linux/videodev2.h>
26#include <linux/i2c.h>
db8a6956 27#include "tuner-i2c.h"
e18f9444 28#include "dvb_frontend.h"
8218b0b2
MK
29
30extern unsigned const int tuner_count;
31
db8a6956
MK
32struct tuner;
33
1dde7a4f 34struct analog_tuner_ops {
4e9154b8
MK
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);
8218b0b2
MK
43};
44
45struct tuner {
46 /* device */
47 struct i2c_client i2c;
48
49 unsigned int type; /* chip type */
50
51 unsigned int mode;
52 unsigned int mode_mask; /* Combination of allowable modes */
53
54 unsigned int tv_freq; /* keep track of the current settings */
55 unsigned int radio_freq;
8218b0b2
MK
56 unsigned int audmode;
57 v4l2_std_id std;
58
59 int using_v4l2;
8218b0b2 60
e18f9444
MK
61 struct dvb_frontend fe;
62
8218b0b2
MK
63 /* used by tda9887 */
64 unsigned int tda9887_config;
65
66 unsigned int config;
67 int (*tuner_callback) (void *dev, int command,int arg);
8218b0b2
MK
68};
69
70/* ------------------------------------------------------------------------ */
71
db8a6956 72extern int tda9887_tuner_init(struct tuner *t);
8218b0b2 73
8218b0b2
MK
74/* ------------------------------------------------------------------------ */
75
76#define tuner_warn(fmt, arg...) do {\
77 printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
78 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
79#define tuner_info(fmt, arg...) do {\
80 printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
81 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
82#define tuner_dbg(fmt, arg...) do {\
83 extern int tuner_debug; \
84 if (tuner_debug) \
85 printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
86 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
87
c996899d 88#endif /* __TUNER_DRIVER_H__ */
8218b0b2
MK
89
90/*
91 * Overrides for Emacs so that we follow Linus's tabbing style.
92 * ---------------------------------------------------------------------------
93 * Local variables:
94 * c-basic-offset: 8
95 * End:
96 */