Antti Palosaari | de8e420 | 2011-08-01 01:07:39 -0300 | [diff] [blame] | 1 | /* |
| 2 | * NXP TDA10071 + Conexant CX24118A DVB-S/S2 demodulator + tuner driver |
| 3 | * |
| 4 | * Copyright (C) 2011 Antti Palosaari <crope@iki.fi> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License along |
| 17 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 | */ |
| 20 | |
| 21 | #ifndef TDA10071_H |
| 22 | #define TDA10071_H |
| 23 | |
Mauro Carvalho Chehab | 782d8b7 | 2013-03-21 16:11:54 -0300 | [diff] [blame] | 24 | #include <linux/kconfig.h> |
Antti Palosaari | de8e420 | 2011-08-01 01:07:39 -0300 | [diff] [blame] | 25 | #include <linux/dvb/frontend.h> |
| 26 | |
| 27 | struct tda10071_config { |
| 28 | /* Demodulator I2C address. |
| 29 | * Default: none, must set |
| 30 | * Values: 0x55, |
| 31 | */ |
Michael Krufky | 41f55d5 | 2012-12-16 19:37:11 -0300 | [diff] [blame] | 32 | u8 demod_i2c_addr; |
Antti Palosaari | de8e420 | 2011-08-01 01:07:39 -0300 | [diff] [blame] | 33 | |
Michael Krufky | 0176fd4 | 2012-12-16 13:24:59 -0300 | [diff] [blame] | 34 | /* Tuner I2C address. |
Michael Krufky | 41f55d5 | 2012-12-16 19:37:11 -0300 | [diff] [blame] | 35 | * Default: none, must set |
Michael Krufky | 0176fd4 | 2012-12-16 13:24:59 -0300 | [diff] [blame] | 36 | * Values: 0x14, 0x54, ... |
| 37 | */ |
| 38 | u8 tuner_i2c_addr; |
| 39 | |
Antti Palosaari | de8e420 | 2011-08-01 01:07:39 -0300 | [diff] [blame] | 40 | /* Max bytes I2C provider can write at once. |
| 41 | * Note: Buffer is taken from the stack currently! |
| 42 | * Default: none, must set |
| 43 | * Values: |
| 44 | */ |
| 45 | u16 i2c_wr_max; |
| 46 | |
| 47 | /* TS output mode. |
| 48 | * Default: TDA10071_TS_SERIAL |
| 49 | * Values: |
| 50 | */ |
| 51 | #define TDA10071_TS_SERIAL 0 |
| 52 | #define TDA10071_TS_PARALLEL 1 |
| 53 | u8 ts_mode; |
| 54 | |
| 55 | /* Input spectrum inversion. |
| 56 | * Default: 0 |
| 57 | * Values: 0, 1 |
| 58 | */ |
| 59 | bool spec_inv; |
| 60 | |
| 61 | /* Xtal frequency Hz |
| 62 | * Default: none, must set |
| 63 | * Values: |
| 64 | */ |
| 65 | u32 xtal; |
| 66 | |
| 67 | /* PLL multiplier. |
| 68 | * Default: none, must set |
| 69 | * Values: |
| 70 | */ |
| 71 | u8 pll_multiplier; |
| 72 | }; |
| 73 | |
| 74 | |
Arnd Bergmann | 9b17452 | 2015-02-18 14:12:42 -0300 | [diff] [blame] | 75 | #if IS_REACHABLE(CONFIG_DVB_TDA10071) |
Antti Palosaari | de8e420 | 2011-08-01 01:07:39 -0300 | [diff] [blame] | 76 | extern struct dvb_frontend *tda10071_attach( |
| 77 | const struct tda10071_config *config, struct i2c_adapter *i2c); |
| 78 | #else |
| 79 | static inline struct dvb_frontend *tda10071_attach( |
| 80 | const struct tda10071_config *config, struct i2c_adapter *i2c) |
| 81 | { |
Antti Palosaari | 116802f | 2014-02-11 15:13:46 -0300 | [diff] [blame] | 82 | dev_warn(&i2c->dev, "%s: driver disabled by Kconfig\n", __func__); |
Antti Palosaari | de8e420 | 2011-08-01 01:07:39 -0300 | [diff] [blame] | 83 | return NULL; |
| 84 | } |
| 85 | #endif |
| 86 | |
| 87 | #endif /* TDA10071_H */ |