xref: /openbmc/linux/drivers/media/tuners/mt2060.h (revision 8bd1369b)
1 /*
2  *  Driver for Microtune MT2060 "Single chip dual conversion broadband tuner"
3  *
4  *  Copyright (c) 2006 Olivier DANET <odanet@caramail.com>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *
15  *  GNU General Public License for more details.
16  */
17 
18 #ifndef MT2060_H
19 #define MT2060_H
20 
21 struct dvb_frontend;
22 struct i2c_adapter;
23 
24 /*
25  * I2C address
26  * 0x60, ...
27  */
28 
29 /**
30  * struct mt2060_platform_data - Platform data for the mt2060 driver
31  * @clock_out: Clock output setting. 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1.
32  * @if1: First IF used [MHz]. 0 defaults to 1220.
33  * @i2c_write_max: Maximum number of bytes I2C adapter can write at once.
34  *  0 defaults to maximum.
35  * @dvb_frontend: DVB frontend.
36  */
37 
38 struct mt2060_platform_data {
39 	u8 clock_out;
40 	u16 if1;
41 	unsigned int i2c_write_max:5;
42 	struct dvb_frontend *dvb_frontend;
43 };
44 
45 
46 /* configuration struct for mt2060_attach() */
47 struct mt2060_config {
48 	u8 i2c_address;
49 	u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */
50 };
51 
52 #if IS_REACHABLE(CONFIG_MEDIA_TUNER_MT2060)
53 extern struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1);
54 #else
55 static inline struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1)
56 {
57 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
58 	return NULL;
59 }
60 #endif // CONFIG_MEDIA_TUNER_MT2060
61 
62 #endif
63