xref: /OK3568_Linux_fs/kernel/drivers/media/dvb-frontends/sp887x.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun    Driver for the Spase sp887x demodulator
4*4882a593Smuzhiyun */
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun #ifndef SP887X_H
7*4882a593Smuzhiyun #define SP887X_H
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #include <linux/dvb/frontend.h>
10*4882a593Smuzhiyun #include <linux/firmware.h>
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun struct sp887x_config
13*4882a593Smuzhiyun {
14*4882a593Smuzhiyun 	/* the demodulator's i2c address */
15*4882a593Smuzhiyun 	u8 demod_address;
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun 	/* request firmware for device */
18*4882a593Smuzhiyun 	int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name);
19*4882a593Smuzhiyun };
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun #if IS_REACHABLE(CONFIG_DVB_SP887X)
22*4882a593Smuzhiyun extern struct dvb_frontend* sp887x_attach(const struct sp887x_config* config,
23*4882a593Smuzhiyun 					  struct i2c_adapter* i2c);
24*4882a593Smuzhiyun #else
sp887x_attach(const struct sp887x_config * config,struct i2c_adapter * i2c)25*4882a593Smuzhiyun static inline struct dvb_frontend* sp887x_attach(const struct sp887x_config* config,
26*4882a593Smuzhiyun 					  struct i2c_adapter* i2c)
27*4882a593Smuzhiyun {
28*4882a593Smuzhiyun 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
29*4882a593Smuzhiyun 	return NULL;
30*4882a593Smuzhiyun }
31*4882a593Smuzhiyun #endif // CONFIG_DVB_SP887X
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun #endif // SP887X_H
34