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 | #include <linux/init.h> |
| 46 | #include <linux/kernel.h> |
| 47 | #include <linux/module.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | #include <linux/string.h> |
| 49 | #include <linux/slab.h> |
Tim Schmielau | 4e57b68 | 2005-10-30 15:03:48 -0800 | [diff] [blame] | 50 | #include <linux/jiffies.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | #include <asm/div64.h> |
| 52 | |
| 53 | #include "dvb_frontend.h" |
| 54 | #include "stv0299.h" |
| 55 | |
| 56 | struct stv0299_state { |
| 57 | struct i2c_adapter* i2c; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | const struct stv0299_config* config; |
| 59 | struct dvb_frontend frontend; |
| 60 | |
| 61 | u8 initialised:1; |
| 62 | u32 tuner_frequency; |
| 63 | u32 symbol_rate; |
| 64 | fe_code_rate_t fec_inner; |
Andrew de Quincey | 3765022 | 2005-11-08 21:35:11 -0800 | [diff] [blame] | 65 | int errmode; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | }; |
| 67 | |
Andrew de Quincey | 3765022 | 2005-11-08 21:35:11 -0800 | [diff] [blame] | 68 | #define STATUS_BER 0 |
| 69 | #define STATUS_UCBLOCKS 1 |
| 70 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | static int debug; |
Johannes Stezenbach | 591ad98 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 72 | static int debug_legacy_dish_switch; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | #define dprintk(args...) \ |
| 74 | do { \ |
| 75 | if (debug) printk(KERN_DEBUG "stv0299: " args); \ |
| 76 | } while (0) |
| 77 | |
| 78 | |
| 79 | static int stv0299_writeregI (struct stv0299_state* state, u8 reg, u8 data) |
| 80 | { |
| 81 | int ret; |
| 82 | u8 buf [] = { reg, data }; |
| 83 | struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 }; |
| 84 | |
| 85 | ret = i2c_transfer (state->i2c, &msg, 1); |
| 86 | |
| 87 | if (ret != 1) |
| 88 | dprintk("%s: writereg error (reg == 0x%02x, val == 0x%02x, " |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 89 | "ret == %i)\n", __func__, reg, data, ret); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | |
| 91 | return (ret != 1) ? -EREMOTEIO : 0; |
| 92 | } |
| 93 | |
Adrian Bunk | 3463040 | 2007-02-06 21:50:36 -0300 | [diff] [blame] | 94 | static int stv0299_write(struct dvb_frontend* fe, u8 *buf, int len) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 96 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | |
Andrew de Quincey | c10d14d | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 98 | if (len != 2) |
| 99 | return -EINVAL; |
| 100 | |
| 101 | return stv0299_writeregI(state, buf[0], buf[1]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | static u8 stv0299_readreg (struct stv0299_state* state, u8 reg) |
| 105 | { |
| 106 | int ret; |
| 107 | u8 b0 [] = { reg }; |
| 108 | u8 b1 [] = { 0 }; |
| 109 | struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 1 }, |
| 110 | { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; |
| 111 | |
| 112 | ret = i2c_transfer (state->i2c, msg, 2); |
| 113 | |
| 114 | if (ret != 2) |
| 115 | dprintk("%s: readreg error (reg == 0x%02x, ret == %i)\n", |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 116 | __func__, reg, ret); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | |
| 118 | return b1[0]; |
| 119 | } |
| 120 | |
| 121 | static int stv0299_readregs (struct stv0299_state* state, u8 reg1, u8 *b, u8 len) |
| 122 | { |
| 123 | int ret; |
| 124 | struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = ®1, .len = 1 }, |
| 125 | { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b, .len = len } }; |
| 126 | |
| 127 | ret = i2c_transfer (state->i2c, msg, 2); |
| 128 | |
| 129 | if (ret != 2) |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 130 | dprintk("%s: readreg error (ret == %i)\n", __func__, ret); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | |
| 132 | return ret == 2 ? 0 : ret; |
| 133 | } |
| 134 | |
| 135 | static int stv0299_set_FEC (struct stv0299_state* state, fe_code_rate_t fec) |
| 136 | { |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 137 | dprintk ("%s\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | |
| 139 | switch (fec) { |
| 140 | case FEC_AUTO: |
| 141 | { |
| 142 | return stv0299_writeregI (state, 0x31, 0x1f); |
| 143 | } |
| 144 | case FEC_1_2: |
| 145 | { |
| 146 | return stv0299_writeregI (state, 0x31, 0x01); |
| 147 | } |
| 148 | case FEC_2_3: |
| 149 | { |
| 150 | return stv0299_writeregI (state, 0x31, 0x02); |
| 151 | } |
| 152 | case FEC_3_4: |
| 153 | { |
| 154 | return stv0299_writeregI (state, 0x31, 0x04); |
| 155 | } |
| 156 | case FEC_5_6: |
| 157 | { |
| 158 | return stv0299_writeregI (state, 0x31, 0x08); |
| 159 | } |
| 160 | case FEC_7_8: |
| 161 | { |
| 162 | return stv0299_writeregI (state, 0x31, 0x10); |
| 163 | } |
| 164 | default: |
| 165 | { |
| 166 | return -EINVAL; |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | static fe_code_rate_t stv0299_get_fec (struct stv0299_state* state) |
| 172 | { |
| 173 | static fe_code_rate_t fec_tab [] = { FEC_2_3, FEC_3_4, FEC_5_6, |
| 174 | FEC_7_8, FEC_1_2 }; |
| 175 | u8 index; |
| 176 | |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 177 | dprintk ("%s\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | |
| 179 | index = stv0299_readreg (state, 0x1b); |
| 180 | index &= 0x7; |
| 181 | |
| 182 | if (index > 4) |
| 183 | return FEC_AUTO; |
| 184 | |
| 185 | return fec_tab [index]; |
| 186 | } |
| 187 | |
| 188 | static int stv0299_wait_diseqc_fifo (struct stv0299_state* state, int timeout) |
| 189 | { |
| 190 | unsigned long start = jiffies; |
| 191 | |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 192 | dprintk ("%s\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | |
| 194 | while (stv0299_readreg(state, 0x0a) & 1) { |
| 195 | if (jiffies - start > timeout) { |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 196 | dprintk ("%s: timeout!!\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | return -ETIMEDOUT; |
| 198 | } |
| 199 | msleep(10); |
| 200 | }; |
| 201 | |
| 202 | return 0; |
| 203 | } |
| 204 | |
| 205 | static int stv0299_wait_diseqc_idle (struct stv0299_state* state, int timeout) |
| 206 | { |
| 207 | unsigned long start = jiffies; |
| 208 | |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 209 | dprintk ("%s\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | |
| 211 | while ((stv0299_readreg(state, 0x0a) & 3) != 2 ) { |
| 212 | if (jiffies - start > timeout) { |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 213 | dprintk ("%s: timeout!!\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 214 | return -ETIMEDOUT; |
| 215 | } |
| 216 | msleep(10); |
| 217 | }; |
| 218 | |
| 219 | return 0; |
| 220 | } |
| 221 | |
| 222 | static int stv0299_set_symbolrate (struct dvb_frontend* fe, u32 srate) |
| 223 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 224 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | u64 big = srate; |
| 226 | u32 ratio; |
| 227 | |
| 228 | // check rate is within limits |
| 229 | if ((srate < 1000000) || (srate > 45000000)) return -EINVAL; |
| 230 | |
| 231 | // calculate value to program |
| 232 | big = big << 20; |
| 233 | big += (state->config->mclk-1); // round correctly |
| 234 | do_div(big, state->config->mclk); |
| 235 | ratio = big << 4; |
| 236 | |
| 237 | return state->config->set_symbol_rate(fe, srate, ratio); |
| 238 | } |
| 239 | |
| 240 | static int stv0299_get_symbolrate (struct stv0299_state* state) |
| 241 | { |
| 242 | u32 Mclk = state->config->mclk / 4096L; |
| 243 | u32 srate; |
| 244 | s32 offset; |
| 245 | u8 sfr[3]; |
| 246 | s8 rtf; |
| 247 | |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 248 | dprintk ("%s\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | |
| 250 | stv0299_readregs (state, 0x1f, sfr, 3); |
Oliver Endriss | 0402a6c | 2007-07-12 23:22:59 -0300 | [diff] [blame] | 251 | stv0299_readregs (state, 0x1a, (u8 *)&rtf, 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 252 | |
| 253 | srate = (sfr[0] << 8) | sfr[1]; |
| 254 | srate *= Mclk; |
| 255 | srate /= 16; |
| 256 | srate += (sfr[2] >> 4) * Mclk / 256; |
| 257 | offset = (s32) rtf * (srate / 4096L); |
| 258 | offset /= 128; |
| 259 | |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 260 | dprintk ("%s : srate = %i\n", __func__, srate); |
| 261 | dprintk ("%s : ofset = %i\n", __func__, offset); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | |
| 263 | srate += offset; |
| 264 | |
| 265 | srate += 1000; |
| 266 | srate /= 2000; |
| 267 | srate *= 2000; |
| 268 | |
| 269 | return srate; |
| 270 | } |
| 271 | |
| 272 | static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, |
| 273 | struct dvb_diseqc_master_cmd *m) |
| 274 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 275 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | u8 val; |
| 277 | int i; |
| 278 | |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 279 | dprintk ("%s\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 280 | |
| 281 | if (stv0299_wait_diseqc_idle (state, 100) < 0) |
| 282 | return -ETIMEDOUT; |
| 283 | |
| 284 | val = stv0299_readreg (state, 0x08); |
| 285 | |
| 286 | if (stv0299_writeregI (state, 0x08, (val & ~0x7) | 0x6)) /* DiSEqC mode */ |
| 287 | return -EREMOTEIO; |
| 288 | |
| 289 | for (i=0; i<m->msg_len; i++) { |
| 290 | if (stv0299_wait_diseqc_fifo (state, 100) < 0) |
| 291 | return -ETIMEDOUT; |
| 292 | |
| 293 | if (stv0299_writeregI (state, 0x09, m->msg[i])) |
| 294 | return -EREMOTEIO; |
| 295 | } |
| 296 | |
| 297 | if (stv0299_wait_diseqc_idle (state, 100) < 0) |
| 298 | return -ETIMEDOUT; |
| 299 | |
| 300 | return 0; |
| 301 | } |
| 302 | |
| 303 | static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) |
| 304 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 305 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 306 | u8 val; |
| 307 | |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 308 | dprintk ("%s\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 309 | |
| 310 | if (stv0299_wait_diseqc_idle (state, 100) < 0) |
| 311 | return -ETIMEDOUT; |
| 312 | |
| 313 | val = stv0299_readreg (state, 0x08); |
| 314 | |
| 315 | if (stv0299_writeregI (state, 0x08, (val & ~0x7) | 0x2)) /* burst mode */ |
| 316 | return -EREMOTEIO; |
| 317 | |
| 318 | if (stv0299_writeregI (state, 0x09, burst == SEC_MINI_A ? 0x00 : 0xff)) |
| 319 | return -EREMOTEIO; |
| 320 | |
| 321 | if (stv0299_wait_diseqc_idle (state, 100) < 0) |
| 322 | return -ETIMEDOUT; |
| 323 | |
| 324 | if (stv0299_writeregI (state, 0x08, val)) |
| 325 | return -EREMOTEIO; |
| 326 | |
| 327 | return 0; |
| 328 | } |
| 329 | |
| 330 | static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) |
| 331 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 332 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 333 | u8 val; |
| 334 | |
| 335 | if (stv0299_wait_diseqc_idle (state, 100) < 0) |
| 336 | return -ETIMEDOUT; |
| 337 | |
| 338 | val = stv0299_readreg (state, 0x08); |
| 339 | |
| 340 | switch (tone) { |
| 341 | case SEC_TONE_ON: |
| 342 | return stv0299_writeregI (state, 0x08, val | 0x3); |
| 343 | |
| 344 | case SEC_TONE_OFF: |
| 345 | return stv0299_writeregI (state, 0x08, (val & ~0x3) | 0x02); |
| 346 | |
| 347 | default: |
| 348 | return -EINVAL; |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) |
| 353 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 354 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 355 | u8 reg0x08; |
| 356 | u8 reg0x0c; |
| 357 | |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 358 | dprintk("%s: %s\n", __func__, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | voltage == SEC_VOLTAGE_13 ? "SEC_VOLTAGE_13" : |
| 360 | voltage == SEC_VOLTAGE_18 ? "SEC_VOLTAGE_18" : "??"); |
| 361 | |
| 362 | reg0x08 = stv0299_readreg (state, 0x08); |
| 363 | reg0x0c = stv0299_readreg (state, 0x0c); |
| 364 | |
| 365 | /** |
| 366 | * H/V switching over OP0, OP1 and OP2 are LNB power enable bits |
| 367 | */ |
| 368 | reg0x0c &= 0x0f; |
Oliver Endriss | e84b133 | 2008-04-20 21:57:34 -0300 | [diff] [blame] | 369 | reg0x08 = (reg0x08 & 0x3f) | (state->config->lock_output << 6); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | |
| 371 | switch (voltage) { |
| 372 | case SEC_VOLTAGE_13: |
Oliver Endriss | e84b133 | 2008-04-20 21:57:34 -0300 | [diff] [blame] | 373 | if (state->config->volt13_op0_op1 == STV0299_VOLT13_OP0) |
| 374 | reg0x0c |= 0x10; /* OP1 off, OP0 on */ |
| 375 | else |
| 376 | reg0x0c |= 0x40; /* OP1 on, OP0 off */ |
| 377 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 378 | case SEC_VOLTAGE_18: |
Oliver Endriss | e84b133 | 2008-04-20 21:57:34 -0300 | [diff] [blame] | 379 | reg0x0c |= 0x50; /* OP1 on, OP0 on */ |
| 380 | break; |
| 381 | case SEC_VOLTAGE_OFF: |
| 382 | /* LNB power off! */ |
| 383 | reg0x08 = 0x00; |
| 384 | reg0x0c = 0x00; |
| 385 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 386 | default: |
| 387 | return -EINVAL; |
| 388 | }; |
Oliver Endriss | e84b133 | 2008-04-20 21:57:34 -0300 | [diff] [blame] | 389 | |
| 390 | if (state->config->op0_off) |
| 391 | reg0x0c &= ~0x10; |
| 392 | |
| 393 | stv0299_writeregI(state, 0x08, reg0x08); |
| 394 | return stv0299_writeregI(state, 0x0c, reg0x0c); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 395 | } |
| 396 | |
Peter Beutner | 400b708 | 2006-01-09 15:32:43 -0200 | [diff] [blame] | 397 | static int stv0299_send_legacy_dish_cmd (struct dvb_frontend* fe, unsigned long cmd) |
Johannes Stezenbach | 591ad98 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 398 | { |
| 399 | struct stv0299_state* state = fe->demodulator_priv; |
| 400 | u8 reg0x08; |
| 401 | u8 reg0x0c; |
| 402 | u8 lv_mask = 0x40; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 403 | u8 last = 1; |
| 404 | int i; |
Johannes Stezenbach | 591ad98 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 405 | struct timeval nexttime; |
| 406 | struct timeval tv[10]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 407 | |
Johannes Stezenbach | 591ad98 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 408 | reg0x08 = stv0299_readreg (state, 0x08); |
| 409 | reg0x0c = stv0299_readreg (state, 0x0c); |
| 410 | reg0x0c &= 0x0f; |
| 411 | stv0299_writeregI (state, 0x08, (reg0x08 & 0x3f) | (state->config->lock_output << 6)); |
| 412 | if (state->config->volt13_op0_op1 == STV0299_VOLT13_OP0) |
| 413 | lv_mask = 0x10; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 414 | |
| 415 | cmd = cmd << 1; |
Johannes Stezenbach | 591ad98 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 416 | if (debug_legacy_dish_switch) |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 417 | printk ("%s switch command: 0x%04lx\n",__func__, cmd); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 418 | |
Johannes Stezenbach | 591ad98 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 419 | do_gettimeofday (&nexttime); |
| 420 | if (debug_legacy_dish_switch) |
| 421 | memcpy (&tv[0], &nexttime, sizeof (struct timeval)); |
| 422 | stv0299_writeregI (state, 0x0c, reg0x0c | 0x50); /* set LNB to 18V */ |
| 423 | |
NooneImportant | 83b75b0 | 2005-11-08 21:35:27 -0800 | [diff] [blame] | 424 | dvb_frontend_sleep_until(&nexttime, 32000); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 425 | |
| 426 | for (i=0; i<9; i++) { |
Johannes Stezenbach | 591ad98 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 427 | if (debug_legacy_dish_switch) |
| 428 | do_gettimeofday (&tv[i+1]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 429 | if((cmd & 0x01) != last) { |
Johannes Stezenbach | 591ad98 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 430 | /* set voltage to (last ? 13V : 18V) */ |
| 431 | stv0299_writeregI (state, 0x0c, reg0x0c | (last ? lv_mask : 0x50)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 432 | last = (last) ? 0 : 1; |
| 433 | } |
| 434 | |
| 435 | cmd = cmd >> 1; |
| 436 | |
| 437 | if (i != 8) |
NooneImportant | 83b75b0 | 2005-11-08 21:35:27 -0800 | [diff] [blame] | 438 | dvb_frontend_sleep_until(&nexttime, 8000); |
Johannes Stezenbach | 591ad98 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 439 | } |
| 440 | if (debug_legacy_dish_switch) { |
| 441 | printk ("%s(%d): switch delay (should be 32k followed by all 8k\n", |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 442 | __func__, fe->dvb->num); |
NooneImportant | 83b75b0 | 2005-11-08 21:35:27 -0800 | [diff] [blame] | 443 | for (i = 1; i < 10; i++) |
| 444 | printk ("%d: %d\n", i, timeval_usec_diff(tv[i-1] , tv[i])); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 445 | } |
| 446 | |
| 447 | return 0; |
| 448 | } |
| 449 | |
| 450 | static int stv0299_init (struct dvb_frontend* fe) |
| 451 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 452 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 453 | int i; |
Oliver Endriss | e84b133 | 2008-04-20 21:57:34 -0300 | [diff] [blame] | 454 | u8 reg; |
| 455 | u8 val; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 456 | |
| 457 | dprintk("stv0299: init chip\n"); |
| 458 | |
Oliver Endriss | e84b133 | 2008-04-20 21:57:34 -0300 | [diff] [blame] | 459 | for (i = 0; ; i += 2) { |
| 460 | reg = state->config->inittab[i]; |
| 461 | val = state->config->inittab[i+1]; |
| 462 | if (reg == 0xff && val == 0xff) |
| 463 | break; |
| 464 | if (reg == 0x0c && state->config->op0_off) |
| 465 | val &= ~0x10; |
| 466 | stv0299_writeregI(state, reg, val); |
| 467 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 468 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 469 | return 0; |
| 470 | } |
| 471 | |
| 472 | static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status) |
| 473 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 474 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 475 | |
| 476 | u8 signal = 0xff - stv0299_readreg (state, 0x18); |
| 477 | u8 sync = stv0299_readreg (state, 0x1b); |
| 478 | |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 479 | dprintk ("%s : FE_READ_STATUS : VSTATUS: 0x%02x\n", __func__, sync); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 480 | *status = 0; |
| 481 | |
| 482 | if (signal > 10) |
| 483 | *status |= FE_HAS_SIGNAL; |
| 484 | |
| 485 | if (sync & 0x80) |
| 486 | *status |= FE_HAS_CARRIER; |
| 487 | |
| 488 | if (sync & 0x10) |
| 489 | *status |= FE_HAS_VITERBI; |
| 490 | |
| 491 | if (sync & 0x08) |
| 492 | *status |= FE_HAS_SYNC; |
| 493 | |
| 494 | if ((sync & 0x98) == 0x98) |
| 495 | *status |= FE_HAS_LOCK; |
| 496 | |
| 497 | return 0; |
| 498 | } |
| 499 | |
| 500 | static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber) |
| 501 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 502 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 503 | |
Andrew de Quincey | 3765022 | 2005-11-08 21:35:11 -0800 | [diff] [blame] | 504 | if (state->errmode != STATUS_BER) return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 505 | *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); |
| 506 | |
| 507 | return 0; |
| 508 | } |
| 509 | |
| 510 | static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
| 511 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 512 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 513 | |
| 514 | s32 signal = 0xffff - ((stv0299_readreg (state, 0x18) << 8) |
| 515 | | stv0299_readreg (state, 0x19)); |
| 516 | |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 517 | dprintk ("%s : FE_READ_SIGNAL_STRENGTH : AGC2I: 0x%02x%02x, signal=0x%04x\n", __func__, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 518 | stv0299_readreg (state, 0x18), |
| 519 | stv0299_readreg (state, 0x19), (int) signal); |
| 520 | |
| 521 | signal = signal * 5 / 4; |
| 522 | *strength = (signal > 0xffff) ? 0xffff : (signal < 0) ? 0 : signal; |
| 523 | |
| 524 | return 0; |
| 525 | } |
| 526 | |
| 527 | static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr) |
| 528 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 529 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 530 | |
| 531 | s32 xsnr = 0xffff - ((stv0299_readreg (state, 0x24) << 8) |
| 532 | | stv0299_readreg (state, 0x25)); |
| 533 | xsnr = 3 * (xsnr - 0xa100); |
| 534 | *snr = (xsnr > 0xffff) ? 0xffff : (xsnr < 0) ? 0 : xsnr; |
| 535 | |
| 536 | return 0; |
| 537 | } |
| 538 | |
| 539 | static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
| 540 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 541 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 542 | |
Andrew de Quincey | 3765022 | 2005-11-08 21:35:11 -0800 | [diff] [blame] | 543 | if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0; |
| 544 | else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 545 | |
| 546 | return 0; |
| 547 | } |
| 548 | |
| 549 | static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) |
| 550 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 551 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 552 | int invval = 0; |
| 553 | |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 554 | dprintk ("%s : FE_SET_FRONTEND\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 555 | |
| 556 | // set the inversion |
| 557 | if (p->inversion == INVERSION_OFF) invval = 0; |
| 558 | else if (p->inversion == INVERSION_ON) invval = 1; |
| 559 | else { |
| 560 | printk("stv0299 does not support auto-inversion\n"); |
| 561 | return -EINVAL; |
| 562 | } |
| 563 | if (state->config->invert) invval = (~invval) & 1; |
| 564 | stv0299_writeregI(state, 0x0c, (stv0299_readreg(state, 0x0c) & 0xfe) | invval); |
| 565 | |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 566 | if (fe->ops.tuner_ops.set_params) { |
| 567 | fe->ops.tuner_ops.set_params(fe, p); |
| 568 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); |
Andrew de Quincey | 53a8ee3 | 2006-04-18 17:47:10 -0300 | [diff] [blame] | 569 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 570 | |
Andrew de Quincy | 3528cc4e | 2005-11-08 21:35:28 -0800 | [diff] [blame] | 571 | stv0299_set_FEC (state, p->u.qpsk.fec_inner); |
| 572 | stv0299_set_symbolrate (fe, p->u.qpsk.symbol_rate); |
| 573 | stv0299_writeregI(state, 0x22, 0x00); |
| 574 | stv0299_writeregI(state, 0x23, 0x00); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 575 | |
| 576 | state->tuner_frequency = p->frequency; |
| 577 | state->fec_inner = p->u.qpsk.fec_inner; |
| 578 | state->symbol_rate = p->u.qpsk.symbol_rate; |
| 579 | |
| 580 | return 0; |
| 581 | } |
| 582 | |
| 583 | static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) |
| 584 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 585 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 586 | s32 derot_freq; |
| 587 | int invval; |
| 588 | |
| 589 | derot_freq = (s32)(s16) ((stv0299_readreg (state, 0x22) << 8) |
| 590 | | stv0299_readreg (state, 0x23)); |
| 591 | |
| 592 | derot_freq *= (state->config->mclk >> 16); |
| 593 | derot_freq += 500; |
| 594 | derot_freq /= 1000; |
| 595 | |
| 596 | p->frequency += derot_freq; |
| 597 | |
| 598 | invval = stv0299_readreg (state, 0x0c) & 1; |
| 599 | if (state->config->invert) invval = (~invval) & 1; |
| 600 | p->inversion = invval ? INVERSION_ON : INVERSION_OFF; |
| 601 | |
| 602 | p->u.qpsk.fec_inner = stv0299_get_fec (state); |
| 603 | p->u.qpsk.symbol_rate = stv0299_get_symbolrate (state); |
| 604 | |
| 605 | return 0; |
| 606 | } |
| 607 | |
| 608 | static int stv0299_sleep(struct dvb_frontend* fe) |
| 609 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 610 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 611 | |
| 612 | stv0299_writeregI(state, 0x02, 0x80); |
| 613 | state->initialised = 0; |
| 614 | |
| 615 | return 0; |
| 616 | } |
| 617 | |
Andrew de Quincey | 53a8ee3 | 2006-04-18 17:47:10 -0300 | [diff] [blame] | 618 | static int stv0299_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) |
| 619 | { |
| 620 | struct stv0299_state* state = fe->demodulator_priv; |
| 621 | |
| 622 | if (enable) { |
Andrew de Quincey | a9686e0 | 2006-05-22 10:31:40 -0300 | [diff] [blame] | 623 | stv0299_writeregI(state, 0x05, 0xb5); |
Andrew de Quincey | 53a8ee3 | 2006-04-18 17:47:10 -0300 | [diff] [blame] | 624 | } else { |
Andrew de Quincey | a9686e0 | 2006-05-22 10:31:40 -0300 | [diff] [blame] | 625 | stv0299_writeregI(state, 0x05, 0x35); |
Andrew de Quincey | 53a8ee3 | 2006-04-18 17:47:10 -0300 | [diff] [blame] | 626 | } |
Andrew de Quincey | a9686e0 | 2006-05-22 10:31:40 -0300 | [diff] [blame] | 627 | udelay(1); |
| 628 | return 0; |
Andrew de Quincey | 53a8ee3 | 2006-04-18 17:47:10 -0300 | [diff] [blame] | 629 | } |
| 630 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 631 | static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) |
| 632 | { |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 633 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 634 | |
| 635 | fesettings->min_delay_ms = state->config->min_delay_ms; |
| 636 | if (fesettings->parameters.u.qpsk.symbol_rate < 10000000) { |
| 637 | fesettings->step_size = fesettings->parameters.u.qpsk.symbol_rate / 32000; |
| 638 | fesettings->max_drift = 5000; |
| 639 | } else { |
| 640 | fesettings->step_size = fesettings->parameters.u.qpsk.symbol_rate / 16000; |
| 641 | fesettings->max_drift = fesettings->parameters.u.qpsk.symbol_rate / 2000; |
| 642 | } |
| 643 | return 0; |
| 644 | } |
| 645 | |
| 646 | static void stv0299_release(struct dvb_frontend* fe) |
| 647 | { |
Johannes Stezenbach | b874270 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 648 | struct stv0299_state* state = fe->demodulator_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 649 | kfree(state); |
| 650 | } |
| 651 | |
| 652 | static struct dvb_frontend_ops stv0299_ops; |
| 653 | |
| 654 | struct dvb_frontend* stv0299_attach(const struct stv0299_config* config, |
| 655 | struct i2c_adapter* i2c) |
| 656 | { |
| 657 | struct stv0299_state* state = NULL; |
| 658 | int id; |
| 659 | |
| 660 | /* allocate memory for the internal state */ |
Johannes Stezenbach | b874270 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 661 | state = kmalloc(sizeof(struct stv0299_state), GFP_KERNEL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 662 | if (state == NULL) goto error; |
| 663 | |
| 664 | /* setup the state */ |
| 665 | state->config = config; |
| 666 | state->i2c = i2c; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 667 | state->initialised = 0; |
| 668 | state->tuner_frequency = 0; |
| 669 | state->symbol_rate = 0; |
| 670 | state->fec_inner = 0; |
Andrew de Quincey | 3765022 | 2005-11-08 21:35:11 -0800 | [diff] [blame] | 671 | state->errmode = STATUS_BER; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 672 | |
| 673 | /* check if the demod is there */ |
| 674 | stv0299_writeregI(state, 0x02, 0x34); /* standby off */ |
| 675 | msleep(200); |
| 676 | id = stv0299_readreg(state, 0x00); |
| 677 | |
| 678 | /* register 0x00 contains 0xa1 for STV0299 and STV0299B */ |
| 679 | /* register 0x00 might contain 0x80 when returning from standby */ |
| 680 | if (id != 0xa1 && id != 0x80) goto error; |
| 681 | |
| 682 | /* create dvb_frontend */ |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 683 | memcpy(&state->frontend.ops, &stv0299_ops, sizeof(struct dvb_frontend_ops)); |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 684 | state->frontend.demodulator_priv = state; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 685 | return &state->frontend; |
| 686 | |
| 687 | error: |
| 688 | kfree(state); |
| 689 | return NULL; |
| 690 | } |
| 691 | |
| 692 | static struct dvb_frontend_ops stv0299_ops = { |
| 693 | |
| 694 | .info = { |
| 695 | .name = "ST STV0299 DVB-S", |
| 696 | .type = FE_QPSK, |
| 697 | .frequency_min = 950000, |
| 698 | .frequency_max = 2150000, |
| 699 | .frequency_stepsize = 125, /* kHz for QPSK frontends */ |
| 700 | .frequency_tolerance = 0, |
| 701 | .symbol_rate_min = 1000000, |
| 702 | .symbol_rate_max = 45000000, |
| 703 | .symbol_rate_tolerance = 500, /* ppm */ |
| 704 | .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | |
| 705 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | |
| 706 | FE_CAN_QPSK | |
| 707 | FE_CAN_FEC_AUTO |
| 708 | }, |
| 709 | |
| 710 | .release = stv0299_release, |
| 711 | |
| 712 | .init = stv0299_init, |
| 713 | .sleep = stv0299_sleep, |
Andrew de Quincey | c10d14d | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 714 | .write = stv0299_write, |
Andrew de Quincey | 53a8ee3 | 2006-04-18 17:47:10 -0300 | [diff] [blame] | 715 | .i2c_gate_ctrl = stv0299_i2c_gate_ctrl, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 716 | |
| 717 | .set_frontend = stv0299_set_frontend, |
| 718 | .get_frontend = stv0299_get_frontend, |
| 719 | .get_tune_settings = stv0299_get_tune_settings, |
| 720 | |
| 721 | .read_status = stv0299_read_status, |
| 722 | .read_ber = stv0299_read_ber, |
| 723 | .read_signal_strength = stv0299_read_signal_strength, |
| 724 | .read_snr = stv0299_read_snr, |
| 725 | .read_ucblocks = stv0299_read_ucblocks, |
| 726 | |
| 727 | .diseqc_send_master_cmd = stv0299_send_diseqc_msg, |
| 728 | .diseqc_send_burst = stv0299_send_diseqc_burst, |
| 729 | .set_tone = stv0299_set_tone, |
| 730 | .set_voltage = stv0299_set_voltage, |
| 731 | .dishnetwork_send_legacy_command = stv0299_send_legacy_dish_cmd, |
| 732 | }; |
| 733 | |
Johannes Stezenbach | 591ad98 | 2005-05-16 21:54:31 -0700 | [diff] [blame] | 734 | module_param(debug_legacy_dish_switch, int, 0444); |
| 735 | MODULE_PARM_DESC(debug_legacy_dish_switch, "Enable timing analysis for Dish Network legacy switches"); |
| 736 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 737 | module_param(debug, int, 0644); |
| 738 | MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); |
| 739 | |
| 740 | MODULE_DESCRIPTION("ST STV0299 DVB Demodulator driver"); |
| 741 | MODULE_AUTHOR("Ralph Metzler, Holger Waechtler, Peter Schildmann, Felix Domke, " |
Andrew de Quincey | 53a8ee3 | 2006-04-18 17:47:10 -0300 | [diff] [blame] | 742 | "Andreas Oberritter, Andrew de Quincey, Kenneth Aafly"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 743 | MODULE_LICENSE("GPL"); |
| 744 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 745 | EXPORT_SYMBOL(stv0299_attach); |