1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * stv0367.h
4  *
5  * Driver for ST STV0367 DVB-T & DVB-C demodulator IC.
6  *
7  * Copyright (C) ST Microelectronics.
8  * Copyright (C) 2010,2011 NetUP Inc.
9  * Copyright (C) 2010,2011 Igor M. Liplianin <liplianin@netup.ru>
10  */
11 
12 #ifndef STV0367_H
13 #define STV0367_H
14 
15 #include <linux/dvb/frontend.h>
16 #include <media/dvb_frontend.h>
17 
18 #define STV0367_ICSPEED_53125	53125000
19 #define STV0367_ICSPEED_58000	58000000
20 
21 struct stv0367_config {
22 	u8 demod_address;
23 	u32 xtal;
24 	u32 if_khz;/*4500*/
25 	int if_iq_mode;
26 	int ts_mode;
27 	int clk_pol;
28 };
29 
30 #if IS_REACHABLE(CONFIG_DVB_STV0367)
31 extern struct
32 dvb_frontend *stv0367ter_attach(const struct stv0367_config *config,
33 					struct i2c_adapter *i2c);
34 extern struct
35 dvb_frontend *stv0367cab_attach(const struct stv0367_config *config,
36 					struct i2c_adapter *i2c);
37 extern struct
38 dvb_frontend *stv0367ddb_attach(const struct stv0367_config *config,
39 					struct i2c_adapter *i2c);
40 #else
41 static inline struct
stv0367ter_attach(const struct stv0367_config * config,struct i2c_adapter * i2c)42 dvb_frontend *stv0367ter_attach(const struct stv0367_config *config,
43 					struct i2c_adapter *i2c)
44 {
45 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
46 	return NULL;
47 }
48 static inline struct
stv0367cab_attach(const struct stv0367_config * config,struct i2c_adapter * i2c)49 dvb_frontend *stv0367cab_attach(const struct stv0367_config *config,
50 					struct i2c_adapter *i2c)
51 {
52 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
53 	return NULL;
54 }
55 static inline struct
stv0367ddb_attach(const struct stv0367_config * config,struct i2c_adapter * i2c)56 dvb_frontend *stv0367ddb_attach(const struct stv0367_config *config,
57 					struct i2c_adapter *i2c)
58 {
59 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
60 	return NULL;
61 }
62 #endif
63 
64 #endif
65