xref: /openbmc/linux/drivers/media/tuners/mt2131.h (revision 9b174527e7b756cda9f5d9e541f87b7fec9cfdf0)
1ccae7af2SMauro Carvalho Chehab /*
2ccae7af2SMauro Carvalho Chehab  *  Driver for Microtune MT2131 "QAM/8VSB single chip tuner"
3ccae7af2SMauro Carvalho Chehab  *
4ccae7af2SMauro Carvalho Chehab  *  Copyright (c) 2006 Steven Toth <stoth@linuxtv.org>
5ccae7af2SMauro Carvalho Chehab  *
6ccae7af2SMauro Carvalho Chehab  *  This program is free software; you can redistribute it and/or modify
7ccae7af2SMauro Carvalho Chehab  *  it under the terms of the GNU General Public License as published by
8ccae7af2SMauro Carvalho Chehab  *  the Free Software Foundation; either version 2 of the License, or
9ccae7af2SMauro Carvalho Chehab  *  (at your option) any later version.
10ccae7af2SMauro Carvalho Chehab  *
11ccae7af2SMauro Carvalho Chehab  *  This program is distributed in the hope that it will be useful,
12ccae7af2SMauro Carvalho Chehab  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13ccae7af2SMauro Carvalho Chehab  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14ccae7af2SMauro Carvalho Chehab  *
15ccae7af2SMauro Carvalho Chehab  *  GNU General Public License for more details.
16ccae7af2SMauro Carvalho Chehab  *
17ccae7af2SMauro Carvalho Chehab  *  You should have received a copy of the GNU General Public License
18ccae7af2SMauro Carvalho Chehab  *  along with this program; if not, write to the Free Software
19ccae7af2SMauro Carvalho Chehab  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20ccae7af2SMauro Carvalho Chehab  */
21ccae7af2SMauro Carvalho Chehab 
22ccae7af2SMauro Carvalho Chehab #ifndef __MT2131_H__
23ccae7af2SMauro Carvalho Chehab #define __MT2131_H__
24ccae7af2SMauro Carvalho Chehab 
25ccae7af2SMauro Carvalho Chehab struct dvb_frontend;
26ccae7af2SMauro Carvalho Chehab struct i2c_adapter;
27ccae7af2SMauro Carvalho Chehab 
28ccae7af2SMauro Carvalho Chehab struct mt2131_config {
29ccae7af2SMauro Carvalho Chehab 	u8 i2c_address;
30ccae7af2SMauro Carvalho Chehab 	u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */
31ccae7af2SMauro Carvalho Chehab };
32ccae7af2SMauro Carvalho Chehab 
33*9b174527SArnd Bergmann #if IS_REACHABLE(CONFIG_MEDIA_TUNER_MT2131)
34ccae7af2SMauro Carvalho Chehab extern struct dvb_frontend* mt2131_attach(struct dvb_frontend *fe,
35ccae7af2SMauro Carvalho Chehab 					  struct i2c_adapter *i2c,
36ccae7af2SMauro Carvalho Chehab 					  struct mt2131_config *cfg,
37ccae7af2SMauro Carvalho Chehab 					  u16 if1);
38ccae7af2SMauro Carvalho Chehab #else
39ccae7af2SMauro Carvalho Chehab static inline struct dvb_frontend* mt2131_attach(struct dvb_frontend *fe,
40ccae7af2SMauro Carvalho Chehab 						 struct i2c_adapter *i2c,
41ccae7af2SMauro Carvalho Chehab 						 struct mt2131_config *cfg,
42ccae7af2SMauro Carvalho Chehab 						 u16 if1)
43ccae7af2SMauro Carvalho Chehab {
44ccae7af2SMauro Carvalho Chehab 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
45ccae7af2SMauro Carvalho Chehab 	return NULL;
46ccae7af2SMauro Carvalho Chehab }
47ccae7af2SMauro Carvalho Chehab #endif /* CONFIG_MEDIA_TUNER_MT2131 */
48ccae7af2SMauro Carvalho Chehab 
49ccae7af2SMauro Carvalho Chehab #endif /* __MT2131_H__ */
50