xref: /linux/drivers/media/dvb-frontends/lgdt330x.h (revision 7129d314843739ed1b1778a3a21317992134e0f0)
19a0bf528SMauro Carvalho Chehab /*
29a0bf528SMauro Carvalho Chehab  *    Support for LGDT3302 and LGDT3303 - VSB/QAM
39a0bf528SMauro Carvalho Chehab  *
49a0bf528SMauro Carvalho Chehab  *    Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net>
59a0bf528SMauro Carvalho Chehab  *
69a0bf528SMauro Carvalho Chehab  *    This program is free software; you can redistribute it and/or modify
79a0bf528SMauro Carvalho Chehab  *    it under the terms of the GNU General Public License as published by
89a0bf528SMauro Carvalho Chehab  *    the Free Software Foundation; either version 2 of the License, or
99a0bf528SMauro Carvalho Chehab  *    (at your option) any later version.
109a0bf528SMauro Carvalho Chehab  *
119a0bf528SMauro Carvalho Chehab  *    This program is distributed in the hope that it will be useful,
129a0bf528SMauro Carvalho Chehab  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
139a0bf528SMauro Carvalho Chehab  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
149a0bf528SMauro Carvalho Chehab  *    GNU General Public License for more details.
159a0bf528SMauro Carvalho Chehab  *
169a0bf528SMauro Carvalho Chehab  */
179a0bf528SMauro Carvalho Chehab 
189a0bf528SMauro Carvalho Chehab #ifndef LGDT330X_H
199a0bf528SMauro Carvalho Chehab #define LGDT330X_H
209a0bf528SMauro Carvalho Chehab 
219a0bf528SMauro Carvalho Chehab #include <linux/dvb/frontend.h>
229a0bf528SMauro Carvalho Chehab 
239a0bf528SMauro Carvalho Chehab typedef enum lg_chip_t {
249a0bf528SMauro Carvalho Chehab 		UNDEFINED,
259a0bf528SMauro Carvalho Chehab 		LGDT3302,
269a0bf528SMauro Carvalho Chehab 		LGDT3303
279a0bf528SMauro Carvalho Chehab }lg_chip_type;
289a0bf528SMauro Carvalho Chehab 
29*7129d314SMauro Carvalho Chehab /**
30*7129d314SMauro Carvalho Chehab  * struct lgdt330x_config - contains lgdt330x configuration
31*7129d314SMauro Carvalho Chehab  *
32*7129d314SMauro Carvalho Chehab  * @demod_address:	The demodulator's i2c address
33*7129d314SMauro Carvalho Chehab  * @demod_chip:		LG demodulator chip LGDT3302 or LGDT3303
34*7129d314SMauro Carvalho Chehab  * @serial_mpeg:	MPEG hardware interface - 0:parallel 1:serial
35*7129d314SMauro Carvalho Chehab  * @pll_rf_set:		Callback function to set PLL interface
36*7129d314SMauro Carvalho Chehab  * @set_ts_params:	Callback function to set device param for start_dma
37*7129d314SMauro Carvalho Chehab  * @clock_polarity_flip:
38*7129d314SMauro Carvalho Chehab  *	Flip the polarity of the mpeg data transfer clock using alternate
39*7129d314SMauro Carvalho Chehab  *	init data.
40*7129d314SMauro Carvalho Chehab  *	This option applies ONLY to LGDT3303 - 0:disabled (default) 1:enabled
41*7129d314SMauro Carvalho Chehab  */
429a0bf528SMauro Carvalho Chehab struct lgdt330x_config
439a0bf528SMauro Carvalho Chehab {
449a0bf528SMauro Carvalho Chehab 	u8 demod_address;
459a0bf528SMauro Carvalho Chehab 	lg_chip_type demod_chip;
469a0bf528SMauro Carvalho Chehab 	int serial_mpeg;
479a0bf528SMauro Carvalho Chehab 	int (*pll_rf_set) (struct dvb_frontend* fe, int index);
489a0bf528SMauro Carvalho Chehab 	int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
499a0bf528SMauro Carvalho Chehab 	int clock_polarity_flip;
509a0bf528SMauro Carvalho Chehab };
519a0bf528SMauro Carvalho Chehab 
529b174527SArnd Bergmann #if IS_REACHABLE(CONFIG_DVB_LGDT330X)
539a0bf528SMauro Carvalho Chehab extern struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config,
549a0bf528SMauro Carvalho Chehab 					    struct i2c_adapter* i2c);
559a0bf528SMauro Carvalho Chehab #else
569a0bf528SMauro Carvalho Chehab static inline struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config,
579a0bf528SMauro Carvalho Chehab 					    struct i2c_adapter* i2c)
589a0bf528SMauro Carvalho Chehab {
599a0bf528SMauro Carvalho Chehab 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
609a0bf528SMauro Carvalho Chehab 	return NULL;
619a0bf528SMauro Carvalho Chehab }
629a0bf528SMauro Carvalho Chehab #endif // CONFIG_DVB_LGDT330X
639a0bf528SMauro Carvalho Chehab 
649a0bf528SMauro Carvalho Chehab #endif /* LGDT330X_H */
65