1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
2 | /* |
3 | */ |
4 | |
5 | #ifndef __TDA8290_H__ |
6 | #define __TDA8290_H__ |
7 | |
8 | #include <linux/i2c.h> |
9 | #include <media/dvb_frontend.h> |
10 | #include "tda18271.h" |
11 | |
12 | enum tda8290_lna { |
13 | TDA8290_LNA_OFF = 0, |
14 | TDA8290_LNA_GP0_HIGH_ON = 1, |
15 | TDA8290_LNA_GP0_HIGH_OFF = 2, |
16 | TDA8290_LNA_ON_BRIDGE = 3, |
17 | }; |
18 | |
19 | struct tda829x_config { |
20 | enum tda8290_lna lna_cfg; |
21 | |
22 | unsigned int probe_tuner:1; |
23 | #define TDA829X_PROBE_TUNER 0 |
24 | #define TDA829X_DONT_PROBE 1 |
25 | unsigned int no_i2c_gate:1; |
26 | struct tda18271_std_map *tda18271_std_map; |
27 | }; |
28 | |
29 | #if IS_REACHABLE(CONFIG_MEDIA_TUNER_TDA8290) |
30 | extern int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr); |
31 | |
32 | extern struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe, |
33 | struct i2c_adapter *i2c_adap, |
34 | u8 i2c_addr, |
35 | struct tda829x_config *cfg); |
36 | #else |
37 | static inline int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr) |
38 | { |
39 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n" , __func__); |
40 | return -EINVAL; |
41 | } |
42 | |
43 | static inline struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe, |
44 | struct i2c_adapter *i2c_adap, |
45 | u8 i2c_addr, |
46 | struct tda829x_config *cfg) |
47 | { |
48 | printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n" , |
49 | __func__); |
50 | return NULL; |
51 | } |
52 | #endif |
53 | |
54 | #endif /* __TDA8290_H__ */ |
55 | |