xref: /OK3568_Linux_fs/kernel/drivers/media/dvb-frontends/cx24123.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun     Conexant cx24123/cx24109 - DVB QPSK Satellite demod/tuner driver
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun     Copyright (C) 2005 Steven Toth <stoth@linuxtv.org>
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #ifndef CX24123_H
10*4882a593Smuzhiyun #define CX24123_H
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun #include <linux/dvb/frontend.h>
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun struct cx24123_config {
15*4882a593Smuzhiyun 	/* the demodulator's i2c address */
16*4882a593Smuzhiyun 	u8 demod_address;
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun 	/* Need to set device param for start_dma */
19*4882a593Smuzhiyun 	int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured);
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun 	/* 0 = LNB voltage normal, 1 = LNB voltage inverted */
22*4882a593Smuzhiyun 	int lnb_polarity;
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun 	/* this device has another tuner */
25*4882a593Smuzhiyun 	u8 dont_use_pll;
26*4882a593Smuzhiyun 	void (*agc_callback) (struct dvb_frontend *);
27*4882a593Smuzhiyun };
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun #if IS_REACHABLE(CONFIG_DVB_CX24123)
30*4882a593Smuzhiyun extern struct dvb_frontend *cx24123_attach(const struct cx24123_config *config,
31*4882a593Smuzhiyun 					   struct i2c_adapter *i2c);
32*4882a593Smuzhiyun extern struct i2c_adapter *cx24123_get_tuner_i2c_adapter(struct dvb_frontend *);
33*4882a593Smuzhiyun #else
cx24123_attach(const struct cx24123_config * config,struct i2c_adapter * i2c)34*4882a593Smuzhiyun static inline struct dvb_frontend *cx24123_attach(
35*4882a593Smuzhiyun 	const struct cx24123_config *config, struct i2c_adapter *i2c)
36*4882a593Smuzhiyun {
37*4882a593Smuzhiyun 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
38*4882a593Smuzhiyun 	return NULL;
39*4882a593Smuzhiyun }
40*4882a593Smuzhiyun static inline struct i2c_adapter *
cx24123_get_tuner_i2c_adapter(struct dvb_frontend * fe)41*4882a593Smuzhiyun 	cx24123_get_tuner_i2c_adapter(struct dvb_frontend *fe)
42*4882a593Smuzhiyun {
43*4882a593Smuzhiyun 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
44*4882a593Smuzhiyun 	return NULL;
45*4882a593Smuzhiyun }
46*4882a593Smuzhiyun #endif
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun #endif /* CX24123_H */
49