xref: /openbmc/linux/drivers/media/tuners/tda8290.h (revision ccae7af2bf07dfef69cc2eb6ebc9e1ff15addfbd)
1*ccae7af2SMauro Carvalho Chehab /*
2*ccae7af2SMauro Carvalho Chehab     This program is free software; you can redistribute it and/or modify
3*ccae7af2SMauro Carvalho Chehab     it under the terms of the GNU General Public License as published by
4*ccae7af2SMauro Carvalho Chehab     the Free Software Foundation; either version 2 of the License, or
5*ccae7af2SMauro Carvalho Chehab     (at your option) any later version.
6*ccae7af2SMauro Carvalho Chehab 
7*ccae7af2SMauro Carvalho Chehab     This program is distributed in the hope that it will be useful,
8*ccae7af2SMauro Carvalho Chehab     but WITHOUT ANY WARRANTY; without even the implied warranty of
9*ccae7af2SMauro Carvalho Chehab     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10*ccae7af2SMauro Carvalho Chehab     GNU General Public License for more details.
11*ccae7af2SMauro Carvalho Chehab 
12*ccae7af2SMauro Carvalho Chehab     You should have received a copy of the GNU General Public License
13*ccae7af2SMauro Carvalho Chehab     along with this program; if not, write to the Free Software
14*ccae7af2SMauro Carvalho Chehab     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15*ccae7af2SMauro Carvalho Chehab */
16*ccae7af2SMauro Carvalho Chehab 
17*ccae7af2SMauro Carvalho Chehab #ifndef __TDA8290_H__
18*ccae7af2SMauro Carvalho Chehab #define __TDA8290_H__
19*ccae7af2SMauro Carvalho Chehab 
20*ccae7af2SMauro Carvalho Chehab #include <linux/i2c.h>
21*ccae7af2SMauro Carvalho Chehab #include "dvb_frontend.h"
22*ccae7af2SMauro Carvalho Chehab 
23*ccae7af2SMauro Carvalho Chehab struct tda829x_config {
24*ccae7af2SMauro Carvalho Chehab 	unsigned int lna_cfg;
25*ccae7af2SMauro Carvalho Chehab 
26*ccae7af2SMauro Carvalho Chehab 	unsigned int probe_tuner:1;
27*ccae7af2SMauro Carvalho Chehab #define TDA829X_PROBE_TUNER 0
28*ccae7af2SMauro Carvalho Chehab #define TDA829X_DONT_PROBE  1
29*ccae7af2SMauro Carvalho Chehab };
30*ccae7af2SMauro Carvalho Chehab 
31*ccae7af2SMauro Carvalho Chehab #if defined(CONFIG_MEDIA_TUNER_TDA8290) || (defined(CONFIG_MEDIA_TUNER_TDA8290_MODULE) && defined(MODULE))
32*ccae7af2SMauro Carvalho Chehab extern int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr);
33*ccae7af2SMauro Carvalho Chehab 
34*ccae7af2SMauro Carvalho Chehab extern struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
35*ccae7af2SMauro Carvalho Chehab 					   struct i2c_adapter *i2c_adap,
36*ccae7af2SMauro Carvalho Chehab 					   u8 i2c_addr,
37*ccae7af2SMauro Carvalho Chehab 					   struct tda829x_config *cfg);
38*ccae7af2SMauro Carvalho Chehab #else
39*ccae7af2SMauro Carvalho Chehab static inline int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr)
40*ccae7af2SMauro Carvalho Chehab {
41*ccae7af2SMauro Carvalho Chehab 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
42*ccae7af2SMauro Carvalho Chehab 	return -EINVAL;
43*ccae7af2SMauro Carvalho Chehab }
44*ccae7af2SMauro Carvalho Chehab 
45*ccae7af2SMauro Carvalho Chehab static inline struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
46*ccae7af2SMauro Carvalho Chehab 						  struct i2c_adapter *i2c_adap,
47*ccae7af2SMauro Carvalho Chehab 						  u8 i2c_addr,
48*ccae7af2SMauro Carvalho Chehab 						  struct tda829x_config *cfg)
49*ccae7af2SMauro Carvalho Chehab {
50*ccae7af2SMauro Carvalho Chehab 	printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
51*ccae7af2SMauro Carvalho Chehab 	       __func__);
52*ccae7af2SMauro Carvalho Chehab 	return NULL;
53*ccae7af2SMauro Carvalho Chehab }
54*ccae7af2SMauro Carvalho Chehab #endif
55*ccae7af2SMauro Carvalho Chehab 
56*ccae7af2SMauro Carvalho Chehab #endif /* __TDA8290_H__ */
57