1*16216333SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2a80abc58SMauro Carvalho Chehab /*
3a80abc58SMauro Carvalho Chehab * Elonics R820T silicon tuner driver
4a80abc58SMauro Carvalho Chehab *
5a80abc58SMauro Carvalho Chehab * Copyright (C) 2012 Antti Palosaari <crope@iki.fi>
6a80abc58SMauro Carvalho Chehab */
7a80abc58SMauro Carvalho Chehab
8a80abc58SMauro Carvalho Chehab #ifndef R820T_H
9a80abc58SMauro Carvalho Chehab #define R820T_H
10a80abc58SMauro Carvalho Chehab
11fada1935SMauro Carvalho Chehab #include <media/dvb_frontend.h>
12a80abc58SMauro Carvalho Chehab
13a80abc58SMauro Carvalho Chehab enum r820t_chip {
14a80abc58SMauro Carvalho Chehab CHIP_R820T,
15d75d5388SMauro Carvalho Chehab CHIP_R620D,
16d75d5388SMauro Carvalho Chehab CHIP_R828D,
17d75d5388SMauro Carvalho Chehab CHIP_R828,
18a80abc58SMauro Carvalho Chehab CHIP_R828S,
19a80abc58SMauro Carvalho Chehab CHIP_R820C,
20a80abc58SMauro Carvalho Chehab };
21a80abc58SMauro Carvalho Chehab
22a80abc58SMauro Carvalho Chehab struct r820t_config {
23a80abc58SMauro Carvalho Chehab u8 i2c_addr; /* 0x34 */
24a80abc58SMauro Carvalho Chehab u32 xtal;
25a80abc58SMauro Carvalho Chehab enum r820t_chip rafael_chip;
26a80abc58SMauro Carvalho Chehab unsigned max_i2c_msg_len;
2784ddc33cSMauro Carvalho Chehab bool use_diplexer;
287063c145SMauro Carvalho Chehab bool use_predetect;
29a80abc58SMauro Carvalho Chehab };
30a80abc58SMauro Carvalho Chehab
319b174527SArnd Bergmann #if IS_REACHABLE(CONFIG_MEDIA_TUNER_R820T)
32a80abc58SMauro Carvalho Chehab struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
33a80abc58SMauro Carvalho Chehab struct i2c_adapter *i2c,
34a80abc58SMauro Carvalho Chehab const struct r820t_config *cfg);
35a80abc58SMauro Carvalho Chehab #else
r820t_attach(struct dvb_frontend * fe,struct i2c_adapter * i2c,const struct r820t_config * cfg)36a80abc58SMauro Carvalho Chehab static inline struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
37a80abc58SMauro Carvalho Chehab struct i2c_adapter *i2c,
38a80abc58SMauro Carvalho Chehab const struct r820t_config *cfg)
39a80abc58SMauro Carvalho Chehab {
40a80abc58SMauro Carvalho Chehab pr_warn("%s: driver disabled by Kconfig\n", __func__);
41a80abc58SMauro Carvalho Chehab return NULL;
42a80abc58SMauro Carvalho Chehab }
43a80abc58SMauro Carvalho Chehab #endif
44a80abc58SMauro Carvalho Chehab
45a80abc58SMauro Carvalho Chehab #endif
46