xref: /openbmc/linux/drivers/media/tuners/mt2060.h (revision 2cf1c348)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  *  Driver for Microtune MT2060 "Single chip dual conversion broadband tuner"
4  *
5  *  Copyright (c) 2006 Olivier DANET <odanet@caramail.com>
6  */
7 
8 #ifndef MT2060_H
9 #define MT2060_H
10 
11 struct dvb_frontend;
12 struct i2c_adapter;
13 
14 /*
15  * I2C address
16  * 0x60, ...
17  */
18 
19 /**
20  * struct mt2060_platform_data - Platform data for the mt2060 driver
21  * @clock_out: Clock output setting. 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1.
22  * @if1: First IF used [MHz]. 0 defaults to 1220.
23  * @i2c_write_max: Maximum number of bytes I2C adapter can write at once.
24  *  0 defaults to maximum.
25  * @dvb_frontend: DVB frontend.
26  */
27 
28 struct mt2060_platform_data {
29 	u8 clock_out;
30 	u16 if1;
31 	unsigned int i2c_write_max:5;
32 	struct dvb_frontend *dvb_frontend;
33 };
34 
35 
36 /* configuration struct for mt2060_attach() */
37 struct mt2060_config {
38 	u8 i2c_address;
39 	u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */
40 };
41 
42 #if IS_REACHABLE(CONFIG_MEDIA_TUNER_MT2060)
43 extern struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1);
44 #else
45 static inline struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1)
46 {
47 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
48 	return NULL;
49 }
50 #endif // CONFIG_MEDIA_TUNER_MT2060
51 
52 #endif
53