xref: /OK3568_Linux_fs/kernel/drivers/media/dvb-frontends/zl10036.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun /**
3*4882a593Smuzhiyun  * Driver for Zarlink ZL10036 DVB-S silicon tuner
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (C) 2006 Tino Reichardt
6*4882a593Smuzhiyun  * Copyright (C) 2007-2009 Matthias Schwarzott <zzam@gentoo.de>
7*4882a593Smuzhiyun  */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #ifndef DVB_ZL10036_H
10*4882a593Smuzhiyun #define DVB_ZL10036_H
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun #include <linux/i2c.h>
13*4882a593Smuzhiyun #include <media/dvb_frontend.h>
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun struct zl10036_config {
16*4882a593Smuzhiyun 	u8 tuner_address;
17*4882a593Smuzhiyun 	int rf_loop_enable;
18*4882a593Smuzhiyun };
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun #if IS_REACHABLE(CONFIG_DVB_ZL10036)
21*4882a593Smuzhiyun /**
22*4882a593Smuzhiyun  * Attach a zl10036 tuner to the supplied frontend structure.
23*4882a593Smuzhiyun  *
24*4882a593Smuzhiyun  * @fe: Frontend to attach to.
25*4882a593Smuzhiyun  * @config: zl10036_config structure.
26*4882a593Smuzhiyun  * @i2c: pointer to struct i2c_adapter.
27*4882a593Smuzhiyun  * return: FE pointer on success, NULL on failure.
28*4882a593Smuzhiyun  */
29*4882a593Smuzhiyun extern struct dvb_frontend *zl10036_attach(struct dvb_frontend *fe,
30*4882a593Smuzhiyun 	const struct zl10036_config *config, struct i2c_adapter *i2c);
31*4882a593Smuzhiyun #else
zl10036_attach(struct dvb_frontend * fe,const struct zl10036_config * config,struct i2c_adapter * i2c)32*4882a593Smuzhiyun static inline struct dvb_frontend *zl10036_attach(struct dvb_frontend *fe,
33*4882a593Smuzhiyun 	const struct zl10036_config *config, struct i2c_adapter *i2c)
34*4882a593Smuzhiyun {
35*4882a593Smuzhiyun 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
36*4882a593Smuzhiyun 	return NULL;
37*4882a593Smuzhiyun }
38*4882a593Smuzhiyun #endif
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun #endif /* DVB_ZL10036_H */
41