Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | Driver for ST STV0299 demodulator |
| 3 | |
| 4 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH |
| 5 | <ralph@convergence.de>, |
| 6 | <holger@convergence.de>, |
| 7 | <js@convergence.de> |
| 8 | |
| 9 | |
| 10 | Philips SU1278/SH |
| 11 | |
| 12 | Copyright (C) 2002 by Peter Schildmann <peter.schildmann@web.de> |
| 13 | |
| 14 | |
| 15 | LG TDQF-S001F |
| 16 | |
| 17 | Copyright (C) 2002 Felix Domke <tmbinc@elitedvb.net> |
| 18 | & Andreas Oberritter <obi@linuxtv.org> |
| 19 | |
| 20 | |
| 21 | Support for Samsung TBMU24112IMB used on Technisat SkyStar2 rev. 2.6B |
| 22 | |
| 23 | Copyright (C) 2003 Vadim Catana <skystar@moldova.cc>: |
| 24 | |
| 25 | Support for Philips SU1278 on Technotrend hardware |
| 26 | |
| 27 | Copyright (C) 2004 Andrew de Quincey <adq_dvb@lidskialf.net> |
| 28 | |
| 29 | This program is free software; you can redistribute it and/or modify |
| 30 | it under the terms of the GNU General Public License as published by |
| 31 | the Free Software Foundation; either version 2 of the License, or |
| 32 | (at your option) any later version. |
| 33 | |
| 34 | This program is distributed in the hope that it will be useful, |
| 35 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 36 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 37 | GNU General Public License for more details. |
| 38 | |
| 39 | You should have received a copy of the GNU General Public License |
| 40 | along with this program; if not, write to the Free Software |
| 41 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 42 | |
| 43 | */ |
| 44 | |
| 45 | #ifndef STV0299_H |
| 46 | #define STV0299_H |
| 47 | |
| 48 | #include <linux/dvb/frontend.h> |
| 49 | #include "dvb_frontend.h" |
| 50 | |
Oliver Endriss | da2c7f6 | 2008-04-20 22:13:37 -0300 | [diff] [blame] | 51 | #define STV0299_LOCKOUTPUT_0 0 |
| 52 | #define STV0299_LOCKOUTPUT_1 1 |
| 53 | #define STV0299_LOCKOUTPUT_CF 2 |
| 54 | #define STV0299_LOCKOUTPUT_LK 3 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | |
| 56 | #define STV0299_VOLT13_OP0 0 |
| 57 | #define STV0299_VOLT13_OP1 1 |
| 58 | |
| 59 | struct stv0299_config |
| 60 | { |
| 61 | /* the demodulator's i2c address */ |
| 62 | u8 demod_address; |
| 63 | |
| 64 | /* inittab - array of pairs of values. |
| 65 | * First of each pair is the register, second is the value. |
| 66 | * List should be terminated with an 0xff, 0xff pair. |
| 67 | */ |
| 68 | u8* inittab; |
| 69 | |
| 70 | /* master clock to use */ |
| 71 | u32 mclk; |
| 72 | |
| 73 | /* does the inversion require inversion? */ |
| 74 | u8 invert:1; |
| 75 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | /* Skip reinitialisation? */ |
| 77 | u8 skip_reinit:1; |
| 78 | |
| 79 | /* LOCK OUTPUT setting */ |
| 80 | u8 lock_output:2; |
| 81 | |
| 82 | /* Is 13v controlled by OP0 or OP1? */ |
| 83 | u8 volt13_op0_op1:1; |
| 84 | |
Oliver Endriss | e84b133 | 2008-04-20 21:57:34 -0300 | [diff] [blame] | 85 | /* Turn-off OP0? */ |
| 86 | u8 op0_off:1; |
| 87 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | /* minimum delay before retuning */ |
| 89 | int min_delay_ms; |
| 90 | |
| 91 | /* Set the symbol rate */ |
Igor M. Liplianin | e4aab64 | 2008-09-23 15:43:57 -0300 | [diff] [blame] | 92 | int (*set_symbol_rate)(struct dvb_frontend *fe, u32 srate, u32 ratio); |
| 93 | |
| 94 | /* Set device param to start dma */ |
| 95 | int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | }; |
| 97 | |
Trent Piepho | c5dec9f | 2006-10-14 15:44:44 -0300 | [diff] [blame] | 98 | #if defined(CONFIG_DVB_STV0299) || (defined(CONFIG_DVB_STV0299_MODULE) && defined(MODULE)) |
Igor M. Liplianin | e4aab64 | 2008-09-23 15:43:57 -0300 | [diff] [blame] | 99 | extern struct dvb_frontend *stv0299_attach(const struct stv0299_config *config, |
| 100 | struct i2c_adapter *i2c); |
Andrew de Quincey | 102a342 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 101 | #else |
Igor M. Liplianin | e4aab64 | 2008-09-23 15:43:57 -0300 | [diff] [blame] | 102 | static inline struct dvb_frontend *stv0299_attach(const struct stv0299_config *config, |
| 103 | struct i2c_adapter *i2c) |
Andrew de Quincey | 102a342 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 104 | { |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 105 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
Andrew de Quincey | 102a342 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 106 | return NULL; |
| 107 | } |
| 108 | #endif // CONFIG_DVB_STV0299 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | |
Andrew de Quincey | c10d14d | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 110 | static inline int stv0299_writereg(struct dvb_frontend *fe, u8 reg, u8 val) { |
| 111 | int r = 0; |
| 112 | u8 buf[] = {reg, val}; |
| 113 | if (fe->ops.write) |
| 114 | r = fe->ops.write(fe, buf, 2); |
| 115 | return r; |
| 116 | } |
| 117 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | #endif // STV0299_H |