xref: /OK3568_Linux_fs/kernel/drivers/media/dvb-frontends/zl10353.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  *  Driver for Zarlink DVB-T ZL10353 demodulator
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  *  Copyright (C) 2006, 2007 Christopher Pascoe <c.pascoe@itee.uq.edu.au>
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #ifndef ZL10353_H
9*4882a593Smuzhiyun #define ZL10353_H
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #include <linux/dvb/frontend.h>
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun struct zl10353_config
14*4882a593Smuzhiyun {
15*4882a593Smuzhiyun 	/* demodulator's I2C address */
16*4882a593Smuzhiyun 	u8 demod_address;
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun 	/* frequencies in units of 0.1kHz */
19*4882a593Smuzhiyun 	int adc_clock;	/* default: 450560 (45.056  MHz) */
20*4882a593Smuzhiyun 	int if2;	/* default: 361667 (36.1667 MHz) */
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun 	/* set if no pll is connected to the secondary i2c bus */
23*4882a593Smuzhiyun 	int no_tuner;
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun 	/* set if parallel ts output is required */
26*4882a593Smuzhiyun 	int parallel_ts;
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun 	/* set if i2c_gate_ctrl disable is required */
29*4882a593Smuzhiyun 	u8 disable_i2c_gate_ctrl:1;
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun 	/* clock control registers (0x51-0x54) */
32*4882a593Smuzhiyun 	u8 clock_ctl_1;  /* default: 0x46 */
33*4882a593Smuzhiyun 	u8 pll_0;        /* default: 0x15 */
34*4882a593Smuzhiyun };
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun #if IS_REACHABLE(CONFIG_DVB_ZL10353)
37*4882a593Smuzhiyun extern struct dvb_frontend* zl10353_attach(const struct zl10353_config *config,
38*4882a593Smuzhiyun 					   struct i2c_adapter *i2c);
39*4882a593Smuzhiyun #else
zl10353_attach(const struct zl10353_config * config,struct i2c_adapter * i2c)40*4882a593Smuzhiyun static inline struct dvb_frontend* zl10353_attach(const struct zl10353_config *config,
41*4882a593Smuzhiyun 					   struct i2c_adapter *i2c)
42*4882a593Smuzhiyun {
43*4882a593Smuzhiyun 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
44*4882a593Smuzhiyun 	return NULL;
45*4882a593Smuzhiyun }
46*4882a593Smuzhiyun #endif /* CONFIG_DVB_ZL10353 */
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun #endif /* ZL10353_H */
49