xref: /openbmc/linux/drivers/media/tuners/r820t.h (revision 9b174527e7b756cda9f5d9e541f87b7fec9cfdf0)
1a80abc58SMauro Carvalho Chehab /*
2a80abc58SMauro Carvalho Chehab  * Elonics R820T silicon tuner driver
3a80abc58SMauro Carvalho Chehab  *
4a80abc58SMauro Carvalho Chehab  * Copyright (C) 2012 Antti Palosaari <crope@iki.fi>
5a80abc58SMauro Carvalho Chehab  *
6a80abc58SMauro Carvalho Chehab  *    This program is free software; you can redistribute it and/or modify
7a80abc58SMauro Carvalho Chehab  *    it under the terms of the GNU General Public License as published by
8a80abc58SMauro Carvalho Chehab  *    the Free Software Foundation; either version 2 of the License, or
9a80abc58SMauro Carvalho Chehab  *    (at your option) any later version.
10a80abc58SMauro Carvalho Chehab  *
11a80abc58SMauro Carvalho Chehab  *    This program is distributed in the hope that it will be useful,
12a80abc58SMauro Carvalho Chehab  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
13a80abc58SMauro Carvalho Chehab  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14a80abc58SMauro Carvalho Chehab  *    GNU General Public License for more details.
15a80abc58SMauro Carvalho Chehab  *
16a80abc58SMauro Carvalho Chehab  *    You should have received a copy of the GNU General Public License along
17a80abc58SMauro Carvalho Chehab  *    with this program; if not, write to the Free Software Foundation, Inc.,
18a80abc58SMauro Carvalho Chehab  *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19a80abc58SMauro Carvalho Chehab  */
20a80abc58SMauro Carvalho Chehab 
21a80abc58SMauro Carvalho Chehab #ifndef R820T_H
22a80abc58SMauro Carvalho Chehab #define R820T_H
23a80abc58SMauro Carvalho Chehab 
24a80abc58SMauro Carvalho Chehab #include <linux/kconfig.h>
25a80abc58SMauro Carvalho Chehab #include "dvb_frontend.h"
26a80abc58SMauro Carvalho Chehab 
27a80abc58SMauro Carvalho Chehab enum r820t_chip {
28a80abc58SMauro Carvalho Chehab 	CHIP_R820T,
29d75d5388SMauro Carvalho Chehab 	CHIP_R620D,
30d75d5388SMauro Carvalho Chehab 	CHIP_R828D,
31d75d5388SMauro Carvalho Chehab 	CHIP_R828,
32a80abc58SMauro Carvalho Chehab 	CHIP_R828S,
33a80abc58SMauro Carvalho Chehab 	CHIP_R820C,
34a80abc58SMauro Carvalho Chehab };
35a80abc58SMauro Carvalho Chehab 
36a80abc58SMauro Carvalho Chehab struct r820t_config {
37a80abc58SMauro Carvalho Chehab 	u8 i2c_addr;		/* 0x34 */
38a80abc58SMauro Carvalho Chehab 	u32 xtal;
39a80abc58SMauro Carvalho Chehab 	enum r820t_chip rafael_chip;
40a80abc58SMauro Carvalho Chehab 	unsigned max_i2c_msg_len;
4184ddc33cSMauro Carvalho Chehab 	bool use_diplexer;
427063c145SMauro Carvalho Chehab 	bool use_predetect;
43a80abc58SMauro Carvalho Chehab };
44a80abc58SMauro Carvalho Chehab 
45*9b174527SArnd Bergmann #if IS_REACHABLE(CONFIG_MEDIA_TUNER_R820T)
46a80abc58SMauro Carvalho Chehab struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
47a80abc58SMauro Carvalho Chehab 				  struct i2c_adapter *i2c,
48a80abc58SMauro Carvalho Chehab 				  const struct r820t_config *cfg);
49a80abc58SMauro Carvalho Chehab #else
50a80abc58SMauro Carvalho Chehab static inline struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
51a80abc58SMauro Carvalho Chehab 						struct i2c_adapter *i2c,
52a80abc58SMauro Carvalho Chehab 						const struct r820t_config *cfg)
53a80abc58SMauro Carvalho Chehab {
54a80abc58SMauro Carvalho Chehab 	pr_warn("%s: driver disabled by Kconfig\n", __func__);
55a80abc58SMauro Carvalho Chehab 	return NULL;
56a80abc58SMauro Carvalho Chehab }
57a80abc58SMauro Carvalho Chehab #endif
58a80abc58SMauro Carvalho Chehab 
59a80abc58SMauro Carvalho Chehab #endif
60