Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002   /*
0003      DVB Driver for Philips tda827x / tda827xa Silicon tuners
0004 
0005      (c) 2005 Hartmut Hackmann
0006      (c) 2007 Michael Krufky
0007 
0008 
0009   */
0010 
0011 #ifndef __DVB_TDA827X_H__
0012 #define __DVB_TDA827X_H__
0013 
0014 #include <linux/i2c.h>
0015 #include <media/dvb_frontend.h>
0016 #include "tda8290.h"
0017 
0018 struct tda827x_config
0019 {
0020     /* saa7134 - provided callbacks */
0021     int (*init) (struct dvb_frontend *fe);
0022     int (*sleep) (struct dvb_frontend *fe);
0023 
0024     /* interface to tda829x driver */
0025     enum tda8290_lna config;
0026     int      switch_addr;
0027 
0028     void (*agcf)(struct dvb_frontend *fe);
0029 };
0030 
0031 
0032 /**
0033  * tda827x_attach() - Attach a tda827x tuner to the supplied frontend structure
0034  *
0035  * @fe: Frontend to attach to.
0036  * @addr: i2c address of the tuner.
0037  * @i2c: i2c adapter to use.
0038  * @cfg: optional callback function pointers.
0039  * @return FE pointer on success, NULL on failure.
0040  */
0041 #if IS_REACHABLE(CONFIG_MEDIA_TUNER_TDA827X)
0042 extern struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe, int addr,
0043                        struct i2c_adapter *i2c,
0044                        struct tda827x_config *cfg);
0045 #else
0046 static inline struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe,
0047                           int addr,
0048                           struct i2c_adapter *i2c,
0049                           struct tda827x_config *cfg)
0050 {
0051     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0052     return NULL;
0053 }
0054 #endif // CONFIG_MEDIA_TUNER_TDA827X
0055 
0056 #endif // __DVB_TDA827X_H__