Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003 */
0004 
0005 #ifndef __TDA8290_H__
0006 #define __TDA8290_H__
0007 
0008 #include <linux/i2c.h>
0009 #include <media/dvb_frontend.h>
0010 #include "tda18271.h"
0011 
0012 enum tda8290_lna {
0013     TDA8290_LNA_OFF = 0,
0014     TDA8290_LNA_GP0_HIGH_ON = 1,
0015     TDA8290_LNA_GP0_HIGH_OFF = 2,
0016     TDA8290_LNA_ON_BRIDGE = 3,
0017 };
0018 
0019 struct tda829x_config {
0020     enum tda8290_lna lna_cfg;
0021 
0022     unsigned int probe_tuner:1;
0023 #define TDA829X_PROBE_TUNER 0
0024 #define TDA829X_DONT_PROBE  1
0025     unsigned int no_i2c_gate:1;
0026     struct tda18271_std_map *tda18271_std_map;
0027 };
0028 
0029 #if IS_REACHABLE(CONFIG_MEDIA_TUNER_TDA8290)
0030 extern int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr);
0031 
0032 extern struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
0033                        struct i2c_adapter *i2c_adap,
0034                        u8 i2c_addr,
0035                        struct tda829x_config *cfg);
0036 #else
0037 static inline int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr)
0038 {
0039     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0040     return -EINVAL;
0041 }
0042 
0043 static inline struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
0044                           struct i2c_adapter *i2c_adap,
0045                           u8 i2c_addr,
0046                           struct tda829x_config *cfg)
0047 {
0048     printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
0049            __func__);
0050     return NULL;
0051 }
0052 #endif
0053 
0054 #endif /* __TDA8290_H__ */