xref: /OK3568_Linux_fs/kernel/drivers/media/dvb-frontends/nxt200x.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  *    Support for NXT2002 and NXT2004 - VSB/QAM
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  *    Copyright (C) 2005 Kirk Lapray (kirk.lapray@gmail.com)
6*4882a593Smuzhiyun  *    based on nxt2002 by Taylor Jacob <rtjacob@earthlink.net>
7*4882a593Smuzhiyun  *    and nxt2004 by Jean-Francois Thibert (jeanfrancois@sagetv.com)
8*4882a593Smuzhiyun */
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #ifndef NXT200X_H
11*4882a593Smuzhiyun #define NXT200X_H
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #include <linux/dvb/frontend.h>
14*4882a593Smuzhiyun #include <linux/firmware.h>
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun typedef enum nxt_chip_t {
17*4882a593Smuzhiyun 		NXTUNDEFINED,
18*4882a593Smuzhiyun 		NXT2002,
19*4882a593Smuzhiyun 		NXT2004
20*4882a593Smuzhiyun }nxt_chip_type;
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun struct nxt200x_config
23*4882a593Smuzhiyun {
24*4882a593Smuzhiyun 	/* the demodulator's i2c address */
25*4882a593Smuzhiyun 	u8 demod_address;
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun 	/* need to set device param for start_dma */
28*4882a593Smuzhiyun 	int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
29*4882a593Smuzhiyun };
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun #if IS_REACHABLE(CONFIG_DVB_NXT200X)
32*4882a593Smuzhiyun extern struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config,
33*4882a593Smuzhiyun 					   struct i2c_adapter* i2c);
34*4882a593Smuzhiyun #else
nxt200x_attach(const struct nxt200x_config * config,struct i2c_adapter * i2c)35*4882a593Smuzhiyun static inline struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config,
36*4882a593Smuzhiyun 					   struct i2c_adapter* i2c)
37*4882a593Smuzhiyun {
38*4882a593Smuzhiyun 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
39*4882a593Smuzhiyun 	return NULL;
40*4882a593Smuzhiyun }
41*4882a593Smuzhiyun #endif // CONFIG_DVB_NXT200X
42*4882a593Smuzhiyun 
43*4882a593Smuzhiyun #endif /* NXT200X_H */
44