xref: /linux/drivers/media/dvb-frontends/lgdt330x.h (revision 9b174527e7b756cda9f5d9e541f87b7fec9cfdf0)
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  *    You should have received a copy of the GNU General Public License
179a0bf528SMauro Carvalho Chehab  *    along with this program; if not, write to the Free Software
189a0bf528SMauro Carvalho Chehab  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
199a0bf528SMauro Carvalho Chehab  *
209a0bf528SMauro Carvalho Chehab  */
219a0bf528SMauro Carvalho Chehab 
229a0bf528SMauro Carvalho Chehab #ifndef LGDT330X_H
239a0bf528SMauro Carvalho Chehab #define LGDT330X_H
249a0bf528SMauro Carvalho Chehab 
259a0bf528SMauro Carvalho Chehab #include <linux/dvb/frontend.h>
269a0bf528SMauro Carvalho Chehab 
279a0bf528SMauro Carvalho Chehab typedef enum lg_chip_t {
289a0bf528SMauro Carvalho Chehab 		UNDEFINED,
299a0bf528SMauro Carvalho Chehab 		LGDT3302,
309a0bf528SMauro Carvalho Chehab 		LGDT3303
319a0bf528SMauro Carvalho Chehab }lg_chip_type;
329a0bf528SMauro Carvalho Chehab 
339a0bf528SMauro Carvalho Chehab struct lgdt330x_config
349a0bf528SMauro Carvalho Chehab {
359a0bf528SMauro Carvalho Chehab 	/* The demodulator's i2c address */
369a0bf528SMauro Carvalho Chehab 	u8 demod_address;
379a0bf528SMauro Carvalho Chehab 
389a0bf528SMauro Carvalho Chehab 	/* LG demodulator chip LGDT3302 or LGDT3303 */
399a0bf528SMauro Carvalho Chehab 	lg_chip_type demod_chip;
409a0bf528SMauro Carvalho Chehab 
419a0bf528SMauro Carvalho Chehab 	/* MPEG hardware interface - 0:parallel 1:serial */
429a0bf528SMauro Carvalho Chehab 	int serial_mpeg;
439a0bf528SMauro Carvalho Chehab 
449a0bf528SMauro Carvalho Chehab 	/* PLL interface */
459a0bf528SMauro Carvalho Chehab 	int (*pll_rf_set) (struct dvb_frontend* fe, int index);
469a0bf528SMauro Carvalho Chehab 
479a0bf528SMauro Carvalho Chehab 	/* Need to set device param for start_dma */
489a0bf528SMauro Carvalho Chehab 	int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
499a0bf528SMauro Carvalho Chehab 
509a0bf528SMauro Carvalho Chehab 	/* Flip the polarity of the mpeg data transfer clock using alternate init data
519a0bf528SMauro Carvalho Chehab 	 * This option applies ONLY to LGDT3303 - 0:disabled (default) 1:enabled */
529a0bf528SMauro Carvalho Chehab 	int clock_polarity_flip;
539a0bf528SMauro Carvalho Chehab };
549a0bf528SMauro Carvalho Chehab 
55*9b174527SArnd Bergmann #if IS_REACHABLE(CONFIG_DVB_LGDT330X)
569a0bf528SMauro Carvalho Chehab extern struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config,
579a0bf528SMauro Carvalho Chehab 					    struct i2c_adapter* i2c);
589a0bf528SMauro Carvalho Chehab #else
599a0bf528SMauro Carvalho Chehab static inline struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config,
609a0bf528SMauro Carvalho Chehab 					    struct i2c_adapter* i2c)
619a0bf528SMauro Carvalho Chehab {
629a0bf528SMauro Carvalho Chehab 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
639a0bf528SMauro Carvalho Chehab 	return NULL;
649a0bf528SMauro Carvalho Chehab }
659a0bf528SMauro Carvalho Chehab #endif // CONFIG_DVB_LGDT330X
669a0bf528SMauro Carvalho Chehab 
679a0bf528SMauro Carvalho Chehab #endif /* LGDT330X_H */
68