Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *  Driver for Zarlink DVB-T MT352 demodulator
0004  *
0005  *  Written by Holger Waechtler <holger@qanu.de>
0006  *   and Daniel Mack <daniel@qanu.de>
0007  *
0008  *  AVerMedia AVerTV DVB-T 771 support by
0009  *       Wolfram Joost <dbox2@frokaschwei.de>
0010  *
0011  *  Support for Samsung TDTC9251DH01C(M) tuner
0012  *  Copyright (C) 2004 Antonio Mancuso <antonio.mancuso@digitaltelevision.it>
0013  *                     Amauri  Celani  <acelani@essegi.net>
0014  *
0015  *  DVICO FusionHDTV DVB-T1 and DVICO FusionHDTV DVB-T Lite support by
0016  *       Christopher Pascoe <c.pascoe@itee.uq.edu.au>
0017  */
0018 
0019 #ifndef MT352_H
0020 #define MT352_H
0021 
0022 #include <linux/dvb/frontend.h>
0023 
0024 struct mt352_config
0025 {
0026     /* the demodulator's i2c address */
0027     u8 demod_address;
0028 
0029     /* frequencies in kHz */
0030     int adc_clock;  // default: 20480
0031     int if2;        // default: 36166
0032 
0033     /* set if no pll is connected to the secondary i2c bus */
0034     int no_tuner;
0035 
0036     /* Initialise the demodulator and PLL. Cannot be NULL */
0037     int (*demod_init)(struct dvb_frontend* fe);
0038 };
0039 
0040 #if IS_REACHABLE(CONFIG_DVB_MT352)
0041 extern struct dvb_frontend* mt352_attach(const struct mt352_config* config,
0042                      struct i2c_adapter* i2c);
0043 #else
0044 static inline struct dvb_frontend* mt352_attach(const struct mt352_config* config,
0045                      struct i2c_adapter* i2c)
0046 {
0047     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0048     return NULL;
0049 }
0050 #endif // CONFIG_DVB_MT352
0051 
0052 static inline int mt352_write(struct dvb_frontend *fe, const u8 buf[], int len) {
0053     int r = 0;
0054     if (fe->ops.write)
0055         r = fe->ops.write(fe, buf, len);
0056     return r;
0057 }
0058 
0059 #endif // MT352_H