Thomas Gleixner | c942fdd | 2019-05-27 08:55:06 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Driver for Zarlink DVB-T MT352 demodulator |
| 4 | * |
| 5 | * Written by Holger Waechtler <holger@qanu.de> |
| 6 | * and Daniel Mack <daniel@qanu.de> |
| 7 | * |
| 8 | * AVerMedia AVerTV DVB-T 771 support by |
| 9 | * Wolfram Joost <dbox2@frokaschwei.de> |
| 10 | * |
| 11 | * Support for Samsung TDTC9251DH01C(M) tuner |
| 12 | * Copyright (C) 2004 Antonio Mancuso <antonio.mancuso@digitaltelevision.it> |
| 13 | * Amauri Celani <acelani@essegi.net> |
| 14 | * |
| 15 | * DVICO FusionHDTV DVB-T1 and DVICO FusionHDTV DVB-T Lite support by |
| 16 | * Christopher Pascoe <c.pascoe@itee.uq.edu.au> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | */ |
| 18 | |
| 19 | #ifndef MT352_H |
| 20 | #define MT352_H |
| 21 | |
| 22 | #include <linux/dvb/frontend.h> |
| 23 | |
| 24 | struct mt352_config |
| 25 | { |
| 26 | /* the demodulator's i2c address */ |
| 27 | u8 demod_address; |
| 28 | |
| 29 | /* frequencies in kHz */ |
| 30 | int adc_clock; // default: 20480 |
| 31 | int if2; // default: 36166 |
| 32 | |
| 33 | /* set if no pll is connected to the secondary i2c bus */ |
| 34 | int no_tuner; |
| 35 | |
| 36 | /* Initialise the demodulator and PLL. Cannot be NULL */ |
| 37 | int (*demod_init)(struct dvb_frontend* fe); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | }; |
| 39 | |
Arnd Bergmann | 9b17452 | 2015-02-18 14:12:42 -0300 | [diff] [blame] | 40 | #if IS_REACHABLE(CONFIG_DVB_MT352) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | extern struct dvb_frontend* mt352_attach(const struct mt352_config* config, |
| 42 | struct i2c_adapter* i2c); |
Andrew de Quincey | 102a342 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 43 | #else |
| 44 | static inline struct dvb_frontend* mt352_attach(const struct mt352_config* config, |
| 45 | struct i2c_adapter* i2c) |
| 46 | { |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 47 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
Andrew de Quincey | 102a342 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 48 | return NULL; |
| 49 | } |
| 50 | #endif // CONFIG_DVB_MT352 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | |
lawrence rust | 2e4e98e | 2010-08-25 09:50:20 -0300 | [diff] [blame] | 52 | static inline int mt352_write(struct dvb_frontend *fe, const u8 buf[], int len) { |
Andrew de Quincey | c10d14d | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 53 | int r = 0; |
| 54 | if (fe->ops.write) |
| 55 | r = fe->ops.write(fe, buf, len); |
| 56 | return r; |
| 57 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | |
| 59 | #endif // MT352_H |