Lines Matching +full:0 +full:x0c
111 { 0, 8917 }, /* 0.0dB */
168 { -20, 12640 }, /* -2d.0B */
170 { 0, 11101 }, /* -0.0dB */
226 { -5, 0xcaa1 }, /* -5dBm */
227 { -10, 0xc229 }, /* -10dBm */
228 { -15, 0xbb08 }, /* -15dBm */
229 { -20, 0xb4bc }, /* -20dBm */
230 { -25, 0xad5a }, /* -25dBm */
231 { -30, 0xa298 }, /* -30dBm */
232 { -35, 0x98a8 }, /* -35dBm */
233 { -40, 0x8389 }, /* -40dBm */
234 { -45, 0x59be }, /* -45dBm */
235 { -50, 0x3a14 }, /* -50dBm */
236 { -55, 0x2d11 }, /* -55dBm */
237 { -60, 0x210d }, /* -60dBm */
238 { -65, 0xa14f }, /* -65dBm */
239 { -70, 0x07aa } /* -70dBm */
245 { STV090x_OUTCFG, 0x00 },
246 { STV090x_MODECFG, 0xff },
247 { STV090x_AGCRF1CFG, 0x11 },
248 { STV090x_AGCRF2CFG, 0x13 },
249 { STV090x_TSGENERAL1X, 0x14 },
250 { STV090x_TSTTNR2, 0x21 },
251 { STV090x_TSTTNR4, 0x21 },
252 { STV090x_P2_DISTXCTL, 0x22 },
253 { STV090x_P2_F22TX, 0xc0 },
254 { STV090x_P2_F22RX, 0xc0 },
255 { STV090x_P2_DISRXCTL, 0x00 },
256 { STV090x_P2_DMDCFGMD, 0xF9 },
257 { STV090x_P2_DEMOD, 0x08 },
258 { STV090x_P2_DMDCFG3, 0xc4 },
259 { STV090x_P2_CARFREQ, 0xed },
260 { STV090x_P2_LDT, 0xd0 },
261 { STV090x_P2_LDT2, 0xb8 },
262 { STV090x_P2_TMGCFG, 0xd2 },
263 { STV090x_P2_TMGTHRISE, 0x20 },
264 { STV090x_P1_TMGCFG, 0xd2 },
266 { STV090x_P2_TMGTHFALL, 0x00 },
267 { STV090x_P2_FECSPY, 0x88 },
268 { STV090x_P2_FSPYDATA, 0x3a },
269 { STV090x_P2_FBERCPT4, 0x00 },
270 { STV090x_P2_FSPYBER, 0x10 },
271 { STV090x_P2_ERRCTRL1, 0x35 },
272 { STV090x_P2_ERRCTRL2, 0xc1 },
273 { STV090x_P2_CFRICFG, 0xf8 },
274 { STV090x_P2_NOSCFG, 0x1c },
275 { STV090x_P2_DMDTOM, 0x20 },
276 { STV090x_P2_CORRELMANT, 0x70 },
277 { STV090x_P2_CORRELABS, 0x88 },
278 { STV090x_P2_AGC2O, 0x5b },
279 { STV090x_P2_AGC2REF, 0x38 },
280 { STV090x_P2_CARCFG, 0xe4 },
281 { STV090x_P2_ACLC, 0x1A },
282 { STV090x_P2_BCLC, 0x09 },
283 { STV090x_P2_CARHDR, 0x08 },
284 { STV090x_P2_KREFTMG, 0xc1 },
285 { STV090x_P2_SFRUPRATIO, 0xf0 },
286 { STV090x_P2_SFRLOWRATIO, 0x70 },
287 { STV090x_P2_SFRSTEP, 0x58 },
288 { STV090x_P2_TMGCFG2, 0x01 },
289 { STV090x_P2_CAR2CFG, 0x26 },
290 { STV090x_P2_BCLC2S2Q, 0x86 },
291 { STV090x_P2_BCLC2S28, 0x86 },
292 { STV090x_P2_SMAPCOEF7, 0x77 },
293 { STV090x_P2_SMAPCOEF6, 0x85 },
294 { STV090x_P2_SMAPCOEF5, 0x77 },
295 { STV090x_P2_TSCFGL, 0x20 },
296 { STV090x_P2_DMDCFG2, 0x3b },
297 { STV090x_P2_MODCODLST0, 0xff },
298 { STV090x_P2_MODCODLST1, 0xff },
299 { STV090x_P2_MODCODLST2, 0xff },
300 { STV090x_P2_MODCODLST3, 0xff },
301 { STV090x_P2_MODCODLST4, 0xff },
302 { STV090x_P2_MODCODLST5, 0xff },
303 { STV090x_P2_MODCODLST6, 0xff },
304 { STV090x_P2_MODCODLST7, 0xcc },
305 { STV090x_P2_MODCODLST8, 0xcc },
306 { STV090x_P2_MODCODLST9, 0xcc },
307 { STV090x_P2_MODCODLSTA, 0xcc },
308 { STV090x_P2_MODCODLSTB, 0xcc },
309 { STV090x_P2_MODCODLSTC, 0xcc },
310 { STV090x_P2_MODCODLSTD, 0xcc },
311 { STV090x_P2_MODCODLSTE, 0xcc },
312 { STV090x_P2_MODCODLSTF, 0xcf },
313 { STV090x_P1_DISTXCTL, 0x22 },
314 { STV090x_P1_F22TX, 0xc0 },
315 { STV090x_P1_F22RX, 0xc0 },
316 { STV090x_P1_DISRXCTL, 0x00 },
317 { STV090x_P1_DMDCFGMD, 0xf9 },
318 { STV090x_P1_DEMOD, 0x08 },
319 { STV090x_P1_DMDCFG3, 0xc4 },
320 { STV090x_P1_DMDTOM, 0x20 },
321 { STV090x_P1_CARFREQ, 0xed },
322 { STV090x_P1_LDT, 0xd0 },
323 { STV090x_P1_LDT2, 0xb8 },
324 { STV090x_P1_TMGCFG, 0xd2 },
325 { STV090x_P1_TMGTHRISE, 0x20 },
326 { STV090x_P1_TMGTHFALL, 0x00 },
327 { STV090x_P1_SFRUPRATIO, 0xf0 },
328 { STV090x_P1_SFRLOWRATIO, 0x70 },
329 { STV090x_P1_TSCFGL, 0x20 },
330 { STV090x_P1_FECSPY, 0x88 },
331 { STV090x_P1_FSPYDATA, 0x3a },
332 { STV090x_P1_FBERCPT4, 0x00 },
333 { STV090x_P1_FSPYBER, 0x10 },
334 { STV090x_P1_ERRCTRL1, 0x35 },
335 { STV090x_P1_ERRCTRL2, 0xc1 },
336 { STV090x_P1_CFRICFG, 0xf8 },
337 { STV090x_P1_NOSCFG, 0x1c },
338 { STV090x_P1_CORRELMANT, 0x70 },
339 { STV090x_P1_CORRELABS, 0x88 },
340 { STV090x_P1_AGC2O, 0x5b },
341 { STV090x_P1_AGC2REF, 0x38 },
342 { STV090x_P1_CARCFG, 0xe4 },
343 { STV090x_P1_ACLC, 0x1A },
344 { STV090x_P1_BCLC, 0x09 },
345 { STV090x_P1_CARHDR, 0x08 },
346 { STV090x_P1_KREFTMG, 0xc1 },
347 { STV090x_P1_SFRSTEP, 0x58 },
348 { STV090x_P1_TMGCFG2, 0x01 },
349 { STV090x_P1_CAR2CFG, 0x26 },
350 { STV090x_P1_BCLC2S2Q, 0x86 },
351 { STV090x_P1_BCLC2S28, 0x86 },
352 { STV090x_P1_SMAPCOEF7, 0x77 },
353 { STV090x_P1_SMAPCOEF6, 0x85 },
354 { STV090x_P1_SMAPCOEF5, 0x77 },
355 { STV090x_P1_DMDCFG2, 0x3b },
356 { STV090x_P1_MODCODLST0, 0xff },
357 { STV090x_P1_MODCODLST1, 0xff },
358 { STV090x_P1_MODCODLST2, 0xff },
359 { STV090x_P1_MODCODLST3, 0xff },
360 { STV090x_P1_MODCODLST4, 0xff },
361 { STV090x_P1_MODCODLST5, 0xff },
362 { STV090x_P1_MODCODLST6, 0xff },
363 { STV090x_P1_MODCODLST7, 0xcc },
364 { STV090x_P1_MODCODLST8, 0xcc },
365 { STV090x_P1_MODCODLST9, 0xcc },
366 { STV090x_P1_MODCODLSTA, 0xcc },
367 { STV090x_P1_MODCODLSTB, 0xcc },
368 { STV090x_P1_MODCODLSTC, 0xcc },
369 { STV090x_P1_MODCODLSTD, 0xcc },
370 { STV090x_P1_MODCODLSTE, 0xcc },
371 { STV090x_P1_MODCODLSTF, 0xcf },
372 { STV090x_GENCFG, 0x1d },
373 { STV090x_NBITER_NF4, 0x37 },
374 { STV090x_NBITER_NF5, 0x29 },
375 { STV090x_NBITER_NF6, 0x37 },
376 { STV090x_NBITER_NF7, 0x33 },
377 { STV090x_NBITER_NF8, 0x31 },
378 { STV090x_NBITER_NF9, 0x2f },
379 { STV090x_NBITER_NF10, 0x39 },
380 { STV090x_NBITER_NF11, 0x3a },
381 { STV090x_NBITER_NF12, 0x29 },
382 { STV090x_NBITER_NF13, 0x37 },
383 { STV090x_NBITER_NF14, 0x33 },
384 { STV090x_NBITER_NF15, 0x2f },
385 { STV090x_NBITER_NF16, 0x39 },
386 { STV090x_NBITER_NF17, 0x3a },
387 { STV090x_NBITERNOERR, 0x04 },
388 { STV090x_GAINLLR_NF4, 0x0C },
389 { STV090x_GAINLLR_NF5, 0x0F },
390 { STV090x_GAINLLR_NF6, 0x11 },
391 { STV090x_GAINLLR_NF7, 0x14 },
392 { STV090x_GAINLLR_NF8, 0x17 },
393 { STV090x_GAINLLR_NF9, 0x19 },
394 { STV090x_GAINLLR_NF10, 0x20 },
395 { STV090x_GAINLLR_NF11, 0x21 },
396 { STV090x_GAINLLR_NF12, 0x0D },
397 { STV090x_GAINLLR_NF13, 0x0F },
398 { STV090x_GAINLLR_NF14, 0x13 },
399 { STV090x_GAINLLR_NF15, 0x1A },
400 { STV090x_GAINLLR_NF16, 0x1F },
401 { STV090x_GAINLLR_NF17, 0x21 },
402 { STV090x_RCCFGH, 0x20 },
403 { STV090x_P1_FECM, 0x01 }, /* disable DSS modes */
404 { STV090x_P2_FECM, 0x01 }, /* disable DSS modes */
405 { STV090x_P1_PRVIT, 0x2F }, /* disable PR 6/7 */
406 { STV090x_P2_PRVIT, 0x2F }, /* disable PR 6/7 */
410 { STV090x_OUTCFG, 0x00 },
411 { STV090x_AGCRF1CFG, 0x11 },
412 { STV090x_STOPCLK1, 0x48 },
413 { STV090x_STOPCLK2, 0x14 },
414 { STV090x_TSTTNR1, 0x27 },
415 { STV090x_TSTTNR2, 0x21 },
416 { STV090x_P1_DISTXCTL, 0x22 },
417 { STV090x_P1_F22TX, 0xc0 },
418 { STV090x_P1_F22RX, 0xc0 },
419 { STV090x_P1_DISRXCTL, 0x00 },
420 { STV090x_P1_DMDCFGMD, 0xF9 },
421 { STV090x_P1_DEMOD, 0x08 },
422 { STV090x_P1_DMDCFG3, 0xc4 },
423 { STV090x_P1_CARFREQ, 0xed },
424 { STV090x_P1_TNRCFG2, 0x82 },
425 { STV090x_P1_LDT, 0xd0 },
426 { STV090x_P1_LDT2, 0xb8 },
427 { STV090x_P1_TMGCFG, 0xd2 },
428 { STV090x_P1_TMGTHRISE, 0x20 },
429 { STV090x_P1_TMGTHFALL, 0x00 },
430 { STV090x_P1_SFRUPRATIO, 0xf0 },
431 { STV090x_P1_SFRLOWRATIO, 0x70 },
432 { STV090x_P1_TSCFGL, 0x20 },
433 { STV090x_P1_FECSPY, 0x88 },
434 { STV090x_P1_FSPYDATA, 0x3a },
435 { STV090x_P1_FBERCPT4, 0x00 },
436 { STV090x_P1_FSPYBER, 0x10 },
437 { STV090x_P1_ERRCTRL1, 0x35 },
438 { STV090x_P1_ERRCTRL2, 0xc1 },
439 { STV090x_P1_CFRICFG, 0xf8 },
440 { STV090x_P1_NOSCFG, 0x1c },
441 { STV090x_P1_DMDTOM, 0x20 },
442 { STV090x_P1_CORRELMANT, 0x70 },
443 { STV090x_P1_CORRELABS, 0x88 },
444 { STV090x_P1_AGC2O, 0x5b },
445 { STV090x_P1_AGC2REF, 0x38 },
446 { STV090x_P1_CARCFG, 0xe4 },
447 { STV090x_P1_ACLC, 0x1A },
448 { STV090x_P1_BCLC, 0x09 },
449 { STV090x_P1_CARHDR, 0x08 },
450 { STV090x_P1_KREFTMG, 0xc1 },
451 { STV090x_P1_SFRSTEP, 0x58 },
452 { STV090x_P1_TMGCFG2, 0x01 },
453 { STV090x_P1_CAR2CFG, 0x26 },
454 { STV090x_P1_BCLC2S2Q, 0x86 },
455 { STV090x_P1_BCLC2S28, 0x86 },
456 { STV090x_P1_SMAPCOEF7, 0x77 },
457 { STV090x_P1_SMAPCOEF6, 0x85 },
458 { STV090x_P1_SMAPCOEF5, 0x77 },
459 { STV090x_P1_DMDCFG2, 0x3b },
460 { STV090x_P1_MODCODLST0, 0xff },
461 { STV090x_P1_MODCODLST1, 0xff },
462 { STV090x_P1_MODCODLST2, 0xff },
463 { STV090x_P1_MODCODLST3, 0xff },
464 { STV090x_P1_MODCODLST4, 0xff },
465 { STV090x_P1_MODCODLST5, 0xff },
466 { STV090x_P1_MODCODLST6, 0xff },
467 { STV090x_P1_MODCODLST7, 0xcc },
468 { STV090x_P1_MODCODLST8, 0xcc },
469 { STV090x_P1_MODCODLST9, 0xcc },
470 { STV090x_P1_MODCODLSTA, 0xcc },
471 { STV090x_P1_MODCODLSTB, 0xcc },
472 { STV090x_P1_MODCODLSTC, 0xcc },
473 { STV090x_P1_MODCODLSTD, 0xcc },
474 { STV090x_P1_MODCODLSTE, 0xcc },
475 { STV090x_P1_MODCODLSTF, 0xcf },
476 { STV090x_GENCFG, 0x1c },
477 { STV090x_NBITER_NF4, 0x37 },
478 { STV090x_NBITER_NF5, 0x29 },
479 { STV090x_NBITER_NF6, 0x37 },
480 { STV090x_NBITER_NF7, 0x33 },
481 { STV090x_NBITER_NF8, 0x31 },
482 { STV090x_NBITER_NF9, 0x2f },
483 { STV090x_NBITER_NF10, 0x39 },
484 { STV090x_NBITER_NF11, 0x3a },
485 { STV090x_NBITER_NF12, 0x29 },
486 { STV090x_NBITER_NF13, 0x37 },
487 { STV090x_NBITER_NF14, 0x33 },
488 { STV090x_NBITER_NF15, 0x2f },
489 { STV090x_NBITER_NF16, 0x39 },
490 { STV090x_NBITER_NF17, 0x3a },
491 { STV090x_NBITERNOERR, 0x04 },
492 { STV090x_GAINLLR_NF4, 0x0C },
493 { STV090x_GAINLLR_NF5, 0x0F },
494 { STV090x_GAINLLR_NF6, 0x11 },
495 { STV090x_GAINLLR_NF7, 0x14 },
496 { STV090x_GAINLLR_NF8, 0x17 },
497 { STV090x_GAINLLR_NF9, 0x19 },
498 { STV090x_GAINLLR_NF10, 0x20 },
499 { STV090x_GAINLLR_NF11, 0x21 },
500 { STV090x_GAINLLR_NF12, 0x0D },
501 { STV090x_GAINLLR_NF13, 0x0F },
502 { STV090x_GAINLLR_NF14, 0x13 },
503 { STV090x_GAINLLR_NF15, 0x1A },
504 { STV090x_GAINLLR_NF16, 0x1F },
505 { STV090x_GAINLLR_NF17, 0x21 },
506 { STV090x_RCCFGH, 0x20 },
507 { STV090x_P1_FECM, 0x01 }, /*disable the DSS mode */
508 { STV090x_P1_PRVIT, 0x2f } /*disable puncture rate 6/7*/
513 { STV090x_P2_DMDCFG3, 0xe8 },
514 { STV090x_P2_DMDCFG4, 0x10 },
515 { STV090x_P2_CARFREQ, 0x38 },
516 { STV090x_P2_CARHDR, 0x20 },
517 { STV090x_P2_KREFTMG, 0x5a },
518 { STV090x_P2_SMAPCOEF7, 0x06 },
519 { STV090x_P2_SMAPCOEF6, 0x00 },
520 { STV090x_P2_SMAPCOEF5, 0x04 },
521 { STV090x_P2_NOSCFG, 0x0c },
522 { STV090x_P1_DMDCFG3, 0xe8 },
523 { STV090x_P1_DMDCFG4, 0x10 },
524 { STV090x_P1_CARFREQ, 0x38 },
525 { STV090x_P1_CARHDR, 0x20 },
526 { STV090x_P1_KREFTMG, 0x5a },
527 { STV090x_P1_SMAPCOEF7, 0x06 },
528 { STV090x_P1_SMAPCOEF6, 0x00 },
529 { STV090x_P1_SMAPCOEF5, 0x04 },
530 { STV090x_P1_NOSCFG, 0x0c },
531 { STV090x_GAINLLR_NF4, 0x21 },
532 { STV090x_GAINLLR_NF5, 0x21 },
533 { STV090x_GAINLLR_NF6, 0x20 },
534 { STV090x_GAINLLR_NF7, 0x1F },
535 { STV090x_GAINLLR_NF8, 0x1E },
536 { STV090x_GAINLLR_NF9, 0x1E },
537 { STV090x_GAINLLR_NF10, 0x1D },
538 { STV090x_GAINLLR_NF11, 0x1B },
539 { STV090x_GAINLLR_NF12, 0x20 },
540 { STV090x_GAINLLR_NF13, 0x20 },
541 { STV090x_GAINLLR_NF14, 0x20 },
542 { STV090x_GAINLLR_NF15, 0x20 },
543 { STV090x_GAINLLR_NF16, 0x20 },
544 { STV090x_GAINLLR_NF17, 0x21 },
548 { STV090x_P1_DMDCFG3, 0xe8 },
549 { STV090x_P1_DMDCFG4, 0x10 },
550 { STV090x_P1_CARFREQ, 0x38 },
551 { STV090x_P1_CARHDR, 0x20 },
552 { STV090x_P1_KREFTMG, 0x5a },
553 { STV090x_P1_SMAPCOEF7, 0x06 },
554 { STV090x_P1_SMAPCOEF6, 0x00 },
555 { STV090x_P1_SMAPCOEF5, 0x04 },
556 { STV090x_P1_NOSCFG, 0x0c },
557 { STV090x_GAINLLR_NF4, 0x21 },
558 { STV090x_GAINLLR_NF5, 0x21 },
559 { STV090x_GAINLLR_NF6, 0x20 },
560 { STV090x_GAINLLR_NF7, 0x1F },
561 { STV090x_GAINLLR_NF8, 0x1E },
562 { STV090x_GAINLLR_NF9, 0x1E },
563 { STV090x_GAINLLR_NF10, 0x1D },
564 { STV090x_GAINLLR_NF11, 0x1B },
565 { STV090x_GAINLLR_NF12, 0x20 },
566 { STV090x_GAINLLR_NF13, 0x20 },
567 { STV090x_GAINLLR_NF14, 0x20 },
568 { STV090x_GAINLLR_NF15, 0x20 },
569 { STV090x_GAINLLR_NF16, 0x20 },
570 { STV090x_GAINLLR_NF17, 0x21 }
576 { STV090x_QPSK_12, 0x1f, 0x3f, 0x1e, 0x3f, 0x3d, 0x1f, 0x3d, 0x3e, 0x3d, 0x1e },
577 { STV090x_QPSK_35, 0x2f, 0x3f, 0x2e, 0x2f, 0x3d, 0x0f, 0x0e, 0x2e, 0x3d, 0x0e },
578 { STV090x_QPSK_23, 0x2f, 0x3f, 0x2e, 0x2f, 0x0e, 0x0f, 0x0e, 0x1e, 0x3d, 0x3d },
579 { STV090x_QPSK_34, 0x3f, 0x3f, 0x3e, 0x1f, 0x0e, 0x3e, 0x0e, 0x1e, 0x3d, 0x3d },
580 { STV090x_QPSK_45, 0x3f, 0x3f, 0x3e, 0x1f, 0x0e, 0x3e, 0x0e, 0x1e, 0x3d, 0x3d },
581 { STV090x_QPSK_56, 0x3f, 0x3f, 0x3e, 0x1f, 0x0e, 0x3e, 0x0e, 0x1e, 0x3d, 0x3d },
582 { STV090x_QPSK_89, 0x3f, 0x3f, 0x3e, 0x1f, 0x1e, 0x3e, 0x0e, 0x1e, 0x3d, 0x3d },
583 { STV090x_QPSK_910, 0x3f, 0x3f, 0x3e, 0x1f, 0x1e, 0x3e, 0x0e, 0x1e, 0x3d, 0x3d },
584 { STV090x_8PSK_35, 0x3c, 0x3e, 0x1c, 0x2e, 0x0c, 0x1e, 0x2b, 0x2d, 0x1b, 0x1d },
585 { STV090x_8PSK_23, 0x1d, 0x3e, 0x3c, 0x2e, 0x2c, 0x1e, 0x0c, 0x2d, 0x2b, 0x1d },
586 { STV090x_8PSK_34, 0x0e, 0x3e, 0x3d, 0x2e, 0x0d, 0x1e, 0x2c, 0x2d, 0x0c, 0x1d },
587 { STV090x_8PSK_56, 0x2e, 0x3e, 0x1e, 0x2e, 0x2d, 0x1e, 0x3c, 0x2d, 0x2c, 0x1d },
588 { STV090x_8PSK_89, 0x3e, 0x3e, 0x1e, 0x2e, 0x3d, 0x1e, 0x0d, 0x2d, 0x3c, 0x1d },
589 { STV090x_8PSK_910, 0x3e, 0x3e, 0x1e, 0x2e, 0x3d, 0x1e, 0x1d, 0x2d, 0x0d, 0x1d }
595 { STV090x_QPSK_12, 0x3c, 0x2c, 0x0c, 0x2c, 0x1b, 0x2c, 0x1b, 0x1c, 0x0b, 0x3b },
596 { STV090x_QPSK_35, 0x0d, 0x0d, 0x0c, 0x0d, 0x1b, 0x3c, 0x1b, 0x1c, 0x0b, 0x3b },
597 { STV090x_QPSK_23, 0x1d, 0x0d, 0x0c, 0x1d, 0x2b, 0x3c, 0x1b, 0x1c, 0x0b, 0x3b },
598 { STV090x_QPSK_34, 0x1d, 0x1d, 0x0c, 0x1d, 0x2b, 0x3c, 0x1b, 0x1c, 0x0b, 0x3b },
599 { STV090x_QPSK_45, 0x2d, 0x1d, 0x1c, 0x1d, 0x2b, 0x3c, 0x2b, 0x0c, 0x1b, 0x3b },
600 { STV090x_QPSK_56, 0x2d, 0x1d, 0x1c, 0x1d, 0x2b, 0x3c, 0x2b, 0x0c, 0x1b, 0x3b },
601 { STV090x_QPSK_89, 0x3d, 0x2d, 0x1c, 0x1d, 0x3b, 0x3c, 0x2b, 0x0c, 0x1b, 0x3b },
602 { STV090x_QPSK_910, 0x3d, 0x2d, 0x1c, 0x1d, 0x3b, 0x3c, 0x2b, 0x0c, 0x1b, 0x3b },
603 { STV090x_8PSK_35, 0x39, 0x29, 0x39, 0x19, 0x19, 0x19, 0x19, 0x19, 0x09, 0x19 },
604 { STV090x_8PSK_23, 0x2a, 0x39, 0x1a, 0x0a, 0x39, 0x0a, 0x29, 0x39, 0x29, 0x0a },
605 { STV090x_8PSK_34, 0x2b, 0x3a, 0x1b, 0x1b, 0x3a, 0x1b, 0x1a, 0x0b, 0x1a, 0x3a },
606 { STV090x_8PSK_56, 0x0c, 0x1b, 0x3b, 0x3b, 0x1b, 0x3b, 0x3a, 0x3b, 0x3a, 0x1b },
607 { STV090x_8PSK_89, 0x0d, 0x3c, 0x2c, 0x2c, 0x2b, 0x0c, 0x0b, 0x3b, 0x0b, 0x1b },
608 { STV090x_8PSK_910, 0x0d, 0x0d, 0x2c, 0x3c, 0x3b, 0x1c, 0x0b, 0x3b, 0x0b, 0x1b }
614 { STV090x_16APSK_23, 0x0c, 0x0c, 0x0c, 0x0c, 0x1d, 0x0c, 0x3c, 0x0c, 0x2c, 0x0c },
615 { STV090x_16APSK_34, 0x0c, 0x0c, 0x0c, 0x0c, 0x0e, 0x0c, 0x2d, 0x0c, 0x1d, 0x0c },
616 { STV090x_16APSK_45, 0x0c, 0x0c, 0x0c, 0x0c, 0x1e, 0x0c, 0x3d, 0x0c, 0x2d, 0x0c },
617 { STV090x_16APSK_56, 0x0c, 0x0c, 0x0c, 0x0c, 0x1e, 0x0c, 0x3d, 0x0c, 0x2d, 0x0c },
618 { STV090x_16APSK_89, 0x0c, 0x0c, 0x0c, 0x0c, 0x2e, 0x0c, 0x0e, 0x0c, 0x3d, 0x0c },
619 { STV090x_16APSK_910, 0x0c, 0x0c, 0x0c, 0x0c, 0x2e, 0x0c, 0x0e, 0x0c, 0x3d, 0x0c },
620 { STV090x_32APSK_34, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c },
621 { STV090x_32APSK_45, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c },
622 { STV090x_32APSK_56, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c },
623 { STV090x_32APSK_89, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c },
624 { STV090x_32APSK_910, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }
630 { STV090x_16APSK_23, 0x0a, 0x0a, 0x0a, 0x0a, 0x1a, 0x0a, 0x3a, 0x0a, 0x2a, 0x0a },
631 { STV090x_16APSK_34, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0a, 0x3b, 0x0a, 0x1b, 0x0a },
632 { STV090x_16APSK_45, 0x0a, 0x0a, 0x0a, 0x0a, 0x1b, 0x0a, 0x3b, 0x0a, 0x2b, 0x0a },
633 { STV090x_16APSK_56, 0x0a, 0x0a, 0x0a, 0x0a, 0x1b, 0x0a, 0x3b, 0x0a, 0x2b, 0x0a },
634 { STV090x_16APSK_89, 0x0a, 0x0a, 0x0a, 0x0a, 0x2b, 0x0a, 0x0c, 0x0a, 0x3b, 0x0a },
635 { STV090x_16APSK_910, 0x0a, 0x0a, 0x0a, 0x0a, 0x2b, 0x0a, 0x0c, 0x0a, 0x3b, 0x0a },
636 { STV090x_32APSK_34, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a },
637 { STV090x_32APSK_45, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a },
638 { STV090x_32APSK_56, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a },
639 { STV090x_32APSK_89, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a },
640 { STV090x_32APSK_910, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a }
645 { STV090x_QPSK_14, 0x0f, 0x3f, 0x0e, 0x3f, 0x2d, 0x2f, 0x2d, 0x1f, 0x3d, 0x3e },
646 { STV090x_QPSK_13, 0x0f, 0x3f, 0x0e, 0x3f, 0x2d, 0x2f, 0x3d, 0x0f, 0x3d, 0x2e },
647 { STV090x_QPSK_25, 0x1f, 0x3f, 0x1e, 0x3f, 0x3d, 0x1f, 0x3d, 0x3e, 0x3d, 0x2e }
652 { STV090x_QPSK_14, 0x0c, 0x3c, 0x0b, 0x3c, 0x2a, 0x2c, 0x2a, 0x1c, 0x3a, 0x3b },
653 { STV090x_QPSK_13, 0x0c, 0x3c, 0x0b, 0x3c, 0x2a, 0x2c, 0x3a, 0x0c, 0x3a, 0x2b },
654 { STV090x_QPSK_25, 0x1c, 0x3c, 0x1b, 0x3c, 0x3a, 0x1c, 0x3a, 0x3b, 0x3a, 0x2b }
660 { STV090x_QPSK, 0x2f, 0x2e, 0x0e, 0x0e, 0x3d },
661 { STV090x_8PSK, 0x3e, 0x0e, 0x2d, 0x0d, 0x3c },
662 { STV090x_16APSK, 0x1e, 0x1e, 0x1e, 0x3d, 0x2d },
663 { STV090x_32APSK, 0x1e, 0x1e, 0x1e, 0x3d, 0x2d }
669 { STV090x_QPSK, 0x2C, 0x2B, 0x0B, 0x0B, 0x3A },
670 { STV090x_8PSK, 0x3B, 0x0B, 0x2A, 0x0A, 0x39 },
671 { STV090x_16APSK, 0x1B, 0x1B, 0x1B, 0x3A, 0x2A },
672 { STV090x_32APSK, 0x1B, 0x1B, 0x1B, 0x3A, 0x2A }
688 u8 b0[] = { reg >> 8, reg & 0xff }; in stv090x_read_reg()
692 { .addr = config->address, .flags = 0, .buf = b0, .len = 2 }, in stv090x_read_reg()
700 "Read error, Reg=[0x%02x], Status=%d", in stv090x_read_reg()
703 return ret < 0 ? ret : -EREMOTEIO; in stv090x_read_reg()
706 dprintk(FE_ERROR, 1, "Reg=[0x%02x], data=%02x", in stv090x_read_reg()
717 struct i2c_msg i2c_msg = { .addr = config->address, .flags = 0, .buf = buf, .len = 2 + count }; in stv090x_write_regs()
726 buf[0] = reg >> 8; in stv090x_write_regs()
727 buf[1] = reg & 0xff; in stv090x_write_regs()
730 dprintk(FE_DEBUGREG, 1, "%s [0x%04x]: %*ph", in stv090x_write_regs()
736 dprintk(FE_ERROR, 1, "Reg=[0x%04x], Data=[0x%02x ...], Count=%u, Status=%d", in stv090x_write_regs()
737 reg, data[0], count, ret); in stv090x_write_regs()
738 return ret < 0 ? ret : -EREMOTEIO; in stv090x_write_regs()
741 return 0; in stv090x_write_regs()
775 if (STV090x_WRITE_DEMOD(state, I2CRPT, reg) < 0) in stv090x_i2c_gate_ctrl()
780 STV090x_SETFIELD_Px(reg, I2CT_ON_FIELD, 0); in stv090x_i2c_gate_ctrl()
781 if ((STV090x_WRITE_DEMOD(state, I2CRPT, reg)) < 0) in stv090x_i2c_gate_ctrl()
787 state->config->tuner_i2c_lock(&state->frontend, 0); in stv090x_i2c_gate_ctrl()
792 return 0; in stv090x_i2c_gate_ctrl()
796 state->config->tuner_i2c_lock(&state->frontend, 0); in stv090x_i2c_gate_ctrl()
864 if (STV090x_WRITE_DEMOD(state, SFRINIT1, (sym >> 8) & 0x7f) < 0) /* MSB */ in stv090x_set_srate()
866 if (STV090x_WRITE_DEMOD(state, SFRINIT0, (sym & 0xff)) < 0) /* LSB */ in stv090x_set_srate()
869 return 0; in stv090x_set_srate()
891 if (sym < 0x7fff) { in stv090x_set_max_srate()
892 if (STV090x_WRITE_DEMOD(state, SFRUP1, (sym >> 8) & 0x7f) < 0) /* MSB */ in stv090x_set_max_srate()
894 if (STV090x_WRITE_DEMOD(state, SFRUP0, sym & 0xff) < 0) /* LSB */ in stv090x_set_max_srate()
897 if (STV090x_WRITE_DEMOD(state, SFRUP1, 0x7f) < 0) /* MSB */ in stv090x_set_max_srate()
899 if (STV090x_WRITE_DEMOD(state, SFRUP0, 0xff) < 0) /* LSB */ in stv090x_set_max_srate()
903 return 0; in stv090x_set_max_srate()
925 if (STV090x_WRITE_DEMOD(state, SFRLOW1, ((sym >> 8) & 0x7f)) < 0) /* MSB */ in stv090x_set_min_srate()
927 if (STV090x_WRITE_DEMOD(state, SFRLOW0, (sym & 0xff)) < 0) /* LSB */ in stv090x_set_min_srate()
929 return 0; in stv090x_set_min_srate()
957 if (STV090x_WRITE_DEMOD(state, VTH12, 0x96) < 0) in stv090x_set_vit_thacq()
959 if (STV090x_WRITE_DEMOD(state, VTH23, 0x64) < 0) in stv090x_set_vit_thacq()
961 if (STV090x_WRITE_DEMOD(state, VTH34, 0x36) < 0) in stv090x_set_vit_thacq()
963 if (STV090x_WRITE_DEMOD(state, VTH56, 0x23) < 0) in stv090x_set_vit_thacq()
965 if (STV090x_WRITE_DEMOD(state, VTH67, 0x1e) < 0) in stv090x_set_vit_thacq()
967 if (STV090x_WRITE_DEMOD(state, VTH78, 0x19) < 0) in stv090x_set_vit_thacq()
969 return 0; in stv090x_set_vit_thacq()
977 if (STV090x_WRITE_DEMOD(state, VTH12, 0xd0) < 0) in stv090x_set_vit_thtracq()
979 if (STV090x_WRITE_DEMOD(state, VTH23, 0x7d) < 0) in stv090x_set_vit_thtracq()
981 if (STV090x_WRITE_DEMOD(state, VTH34, 0x53) < 0) in stv090x_set_vit_thtracq()
983 if (STV090x_WRITE_DEMOD(state, VTH56, 0x2f) < 0) in stv090x_set_vit_thtracq()
985 if (STV090x_WRITE_DEMOD(state, VTH67, 0x24) < 0) in stv090x_set_vit_thtracq()
987 if (STV090x_WRITE_DEMOD(state, VTH78, 0x1f) < 0) in stv090x_set_vit_thtracq()
989 return 0; in stv090x_set_vit_thtracq()
999 if (STV090x_WRITE_DEMOD(state, FECM, 0x10) < 0) /* DVB-S and DVB-S2 */ in stv090x_set_viterbi()
1001 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x3f) < 0) /* all puncture rate */ in stv090x_set_viterbi()
1005 if (STV090x_WRITE_DEMOD(state, FECM, 0x00) < 0) /* disable DSS */ in stv090x_set_viterbi()
1009 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x01) < 0) in stv090x_set_viterbi()
1014 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x02) < 0) in stv090x_set_viterbi()
1019 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x04) < 0) in stv090x_set_viterbi()
1024 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x08) < 0) in stv090x_set_viterbi()
1029 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x20) < 0) in stv090x_set_viterbi()
1034 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x2f) < 0) /* all */ in stv090x_set_viterbi()
1040 if (STV090x_WRITE_DEMOD(state, FECM, 0x80) < 0) in stv090x_set_viterbi()
1044 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x01) < 0) in stv090x_set_viterbi()
1049 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x02) < 0) in stv090x_set_viterbi()
1054 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x10) < 0) in stv090x_set_viterbi()
1059 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x13) < 0) /* 1/2, 2/3, 6/7 */ in stv090x_set_viterbi()
1067 return 0; in stv090x_set_viterbi()
1075 if (STV090x_WRITE_DEMOD(state, MODCODLST0, 0xff) < 0) in stv090x_stop_modcod()
1077 if (STV090x_WRITE_DEMOD(state, MODCODLST1, 0xff) < 0) in stv090x_stop_modcod()
1079 if (STV090x_WRITE_DEMOD(state, MODCODLST2, 0xff) < 0) in stv090x_stop_modcod()
1081 if (STV090x_WRITE_DEMOD(state, MODCODLST3, 0xff) < 0) in stv090x_stop_modcod()
1083 if (STV090x_WRITE_DEMOD(state, MODCODLST4, 0xff) < 0) in stv090x_stop_modcod()
1085 if (STV090x_WRITE_DEMOD(state, MODCODLST5, 0xff) < 0) in stv090x_stop_modcod()
1087 if (STV090x_WRITE_DEMOD(state, MODCODLST6, 0xff) < 0) in stv090x_stop_modcod()
1089 if (STV090x_WRITE_DEMOD(state, MODCODLST7, 0xff) < 0) in stv090x_stop_modcod()
1091 if (STV090x_WRITE_DEMOD(state, MODCODLST8, 0xff) < 0) in stv090x_stop_modcod()
1093 if (STV090x_WRITE_DEMOD(state, MODCODLST9, 0xff) < 0) in stv090x_stop_modcod()
1095 if (STV090x_WRITE_DEMOD(state, MODCODLSTA, 0xff) < 0) in stv090x_stop_modcod()
1097 if (STV090x_WRITE_DEMOD(state, MODCODLSTB, 0xff) < 0) in stv090x_stop_modcod()
1099 if (STV090x_WRITE_DEMOD(state, MODCODLSTC, 0xff) < 0) in stv090x_stop_modcod()
1101 if (STV090x_WRITE_DEMOD(state, MODCODLSTD, 0xff) < 0) in stv090x_stop_modcod()
1103 if (STV090x_WRITE_DEMOD(state, MODCODLSTE, 0xff) < 0) in stv090x_stop_modcod()
1105 if (STV090x_WRITE_DEMOD(state, MODCODLSTF, 0xff) < 0) in stv090x_stop_modcod()
1107 return 0; in stv090x_stop_modcod()
1115 if (STV090x_WRITE_DEMOD(state, MODCODLST0, 0xff) < 0) in stv090x_activate_modcod()
1117 if (STV090x_WRITE_DEMOD(state, MODCODLST1, 0xfc) < 0) in stv090x_activate_modcod()
1119 if (STV090x_WRITE_DEMOD(state, MODCODLST2, 0xcc) < 0) in stv090x_activate_modcod()
1121 if (STV090x_WRITE_DEMOD(state, MODCODLST3, 0xcc) < 0) in stv090x_activate_modcod()
1123 if (STV090x_WRITE_DEMOD(state, MODCODLST4, 0xcc) < 0) in stv090x_activate_modcod()
1125 if (STV090x_WRITE_DEMOD(state, MODCODLST5, 0xcc) < 0) in stv090x_activate_modcod()
1127 if (STV090x_WRITE_DEMOD(state, MODCODLST6, 0xcc) < 0) in stv090x_activate_modcod()
1129 if (STV090x_WRITE_DEMOD(state, MODCODLST7, 0xcc) < 0) in stv090x_activate_modcod()
1131 if (STV090x_WRITE_DEMOD(state, MODCODLST8, 0xcc) < 0) in stv090x_activate_modcod()
1133 if (STV090x_WRITE_DEMOD(state, MODCODLST9, 0xcc) < 0) in stv090x_activate_modcod()
1135 if (STV090x_WRITE_DEMOD(state, MODCODLSTA, 0xcc) < 0) in stv090x_activate_modcod()
1137 if (STV090x_WRITE_DEMOD(state, MODCODLSTB, 0xcc) < 0) in stv090x_activate_modcod()
1139 if (STV090x_WRITE_DEMOD(state, MODCODLSTC, 0xcc) < 0) in stv090x_activate_modcod()
1141 if (STV090x_WRITE_DEMOD(state, MODCODLSTD, 0xcc) < 0) in stv090x_activate_modcod()
1143 if (STV090x_WRITE_DEMOD(state, MODCODLSTE, 0xcc) < 0) in stv090x_activate_modcod()
1145 if (STV090x_WRITE_DEMOD(state, MODCODLSTF, 0xcf) < 0) in stv090x_activate_modcod()
1148 return 0; in stv090x_activate_modcod()
1157 if (STV090x_WRITE_DEMOD(state, MODCODLST0, 0xff) < 0) in stv090x_activate_modcod_single()
1159 if (STV090x_WRITE_DEMOD(state, MODCODLST1, 0xf0) < 0) in stv090x_activate_modcod_single()
1161 if (STV090x_WRITE_DEMOD(state, MODCODLST2, 0x00) < 0) in stv090x_activate_modcod_single()
1163 if (STV090x_WRITE_DEMOD(state, MODCODLST3, 0x00) < 0) in stv090x_activate_modcod_single()
1165 if (STV090x_WRITE_DEMOD(state, MODCODLST4, 0x00) < 0) in stv090x_activate_modcod_single()
1167 if (STV090x_WRITE_DEMOD(state, MODCODLST5, 0x00) < 0) in stv090x_activate_modcod_single()
1169 if (STV090x_WRITE_DEMOD(state, MODCODLST6, 0x00) < 0) in stv090x_activate_modcod_single()
1171 if (STV090x_WRITE_DEMOD(state, MODCODLST7, 0x00) < 0) in stv090x_activate_modcod_single()
1173 if (STV090x_WRITE_DEMOD(state, MODCODLST8, 0x00) < 0) in stv090x_activate_modcod_single()
1175 if (STV090x_WRITE_DEMOD(state, MODCODLST9, 0x00) < 0) in stv090x_activate_modcod_single()
1177 if (STV090x_WRITE_DEMOD(state, MODCODLSTA, 0x00) < 0) in stv090x_activate_modcod_single()
1179 if (STV090x_WRITE_DEMOD(state, MODCODLSTB, 0x00) < 0) in stv090x_activate_modcod_single()
1181 if (STV090x_WRITE_DEMOD(state, MODCODLSTC, 0x00) < 0) in stv090x_activate_modcod_single()
1183 if (STV090x_WRITE_DEMOD(state, MODCODLSTD, 0x00) < 0) in stv090x_activate_modcod_single()
1185 if (STV090x_WRITE_DEMOD(state, MODCODLSTE, 0x00) < 0) in stv090x_activate_modcod_single()
1187 if (STV090x_WRITE_DEMOD(state, MODCODLSTF, 0x0f) < 0) in stv090x_activate_modcod_single()
1190 return 0; in stv090x_activate_modcod_single()
1206 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_vitclk_ctl()
1215 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_vitclk_ctl()
1224 return 0; in stv090x_vitclk_ctl()
1233 if (state->internal->dev_ver >= 0x30) { in stv090x_dvbs_track_crl()
1236 if (STV090x_WRITE_DEMOD(state, ACLC, 0x2b) < 0) in stv090x_dvbs_track_crl()
1238 if (STV090x_WRITE_DEMOD(state, BCLC, 0x1a) < 0) in stv090x_dvbs_track_crl()
1241 if (STV090x_WRITE_DEMOD(state, ACLC, 0x0c) < 0) in stv090x_dvbs_track_crl()
1243 if (STV090x_WRITE_DEMOD(state, BCLC, 0x1b) < 0) in stv090x_dvbs_track_crl()
1246 if (STV090x_WRITE_DEMOD(state, ACLC, 0x2c) < 0) in stv090x_dvbs_track_crl()
1248 if (STV090x_WRITE_DEMOD(state, BCLC, 0x1c) < 0) in stv090x_dvbs_track_crl()
1254 if (STV090x_WRITE_DEMOD(state, ACLC, 0x1a) < 0) in stv090x_dvbs_track_crl()
1256 if (STV090x_WRITE_DEMOD(state, BCLC, 0x09) < 0) in stv090x_dvbs_track_crl()
1259 return 0; in stv090x_dvbs_track_crl()
1274 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_delivery_search()
1275 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1281 if (stv090x_vitclk_ctl(state, 0) < 0) in stv090x_delivery_search()
1284 if (stv090x_dvbs_track_crl(state) < 0) in stv090x_delivery_search()
1287 if (STV090x_WRITE_DEMOD(state, CAR2CFG, 0x22) < 0) /* disable DVB-S2 */ in stv090x_delivery_search()
1290 if (stv090x_set_vit_thacq(state) < 0) in stv090x_delivery_search()
1292 if (stv090x_set_viterbi(state) < 0) in stv090x_delivery_search()
1298 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 0); in stv090x_delivery_search()
1299 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_delivery_search()
1300 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1304 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1307 if (stv090x_vitclk_ctl(state, 1) < 0) in stv090x_delivery_search()
1310 if (STV090x_WRITE_DEMOD(state, ACLC, 0x1a) < 0) /* stop DVB-S CR loop */ in stv090x_delivery_search()
1312 if (STV090x_WRITE_DEMOD(state, BCLC, 0x09) < 0) in stv090x_delivery_search()
1315 if (state->internal->dev_ver <= 0x20) { in stv090x_delivery_search()
1317 if (STV090x_WRITE_DEMOD(state, CAR2CFG, 0x26) < 0) in stv090x_delivery_search()
1321 if (STV090x_WRITE_DEMOD(state, CAR2CFG, 0x66) < 0) in stv090x_delivery_search()
1327 if (stv090x_activate_modcod(state) < 0) in stv090x_delivery_search()
1334 if (stv090x_activate_modcod_single(state) < 0) in stv090x_delivery_search()
1338 if (stv090x_set_vit_thtracq(state) < 0) in stv090x_delivery_search()
1346 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 0); in stv090x_delivery_search()
1347 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_delivery_search()
1348 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1352 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1355 if (stv090x_vitclk_ctl(state, 0) < 0) in stv090x_delivery_search()
1358 if (stv090x_dvbs_track_crl(state) < 0) in stv090x_delivery_search()
1361 if (state->internal->dev_ver <= 0x20) { in stv090x_delivery_search()
1363 if (STV090x_WRITE_DEMOD(state, CAR2CFG, 0x26) < 0) in stv090x_delivery_search()
1367 if (STV090x_WRITE_DEMOD(state, CAR2CFG, 0x66) < 0) in stv090x_delivery_search()
1373 if (stv090x_activate_modcod(state) < 0) in stv090x_delivery_search()
1380 if (stv090x_activate_modcod_single(state) < 0) in stv090x_delivery_search()
1384 if (stv090x_set_vit_thacq(state) < 0) in stv090x_delivery_search()
1387 if (stv090x_set_viterbi(state) < 0) in stv090x_delivery_search()
1391 return 0; in stv090x_delivery_search()
1404 STV090x_SETFIELD_Px(reg, I2C_DEMOD_MODE_FIELD, 0x1f); in stv090x_start_search()
1405 if (STV090x_WRITE_DEMOD(state, DMDISTATE, reg) < 0) in stv090x_start_search()
1408 if (state->internal->dev_ver <= 0x20) { in stv090x_start_search()
1410 if (STV090x_WRITE_DEMOD(state, CARCFG, 0x44) < 0) in stv090x_start_search()
1412 if (STV090x_WRITE_DEMOD(state, CFRUP1, 0x0f) < 0) in stv090x_start_search()
1414 if (STV090x_WRITE_DEMOD(state, CFRUP0, 0xff) < 0) in stv090x_start_search()
1416 if (STV090x_WRITE_DEMOD(state, CFRLOW1, 0xf0) < 0) in stv090x_start_search()
1418 if (STV090x_WRITE_DEMOD(state, CFRLOW0, 0x00) < 0) in stv090x_start_search()
1422 if (STV090x_WRITE_DEMOD(state, RTCS2, 0x68) < 0) in stv090x_start_search()
1427 if (STV090x_WRITE_DEMOD(state, CARCFG, 0xc4) < 0) in stv090x_start_search()
1430 if (STV090x_WRITE_DEMOD(state, RTCS2, 0x44) < 0) in stv090x_start_search()
1437 STV090x_WRITE_DEMOD(state, RTCS2, 0x68); in stv090x_start_search()
1440 STV090x_WRITE_DEMOD(state, RTCS2, 0x44); in stv090x_start_search()
1444 STV090x_WRITE_DEMOD(state, CARCFG, 0x46); in stv090x_start_search()
1466 if (STV090x_WRITE_DEMOD(state, CFRUP1, MSB(freq)) < 0) in stv090x_start_search()
1468 if (STV090x_WRITE_DEMOD(state, CFRUP0, LSB(freq)) < 0) in stv090x_start_search()
1473 if (STV090x_WRITE_DEMOD(state, CFRLOW1, MSB(freq)) < 0) in stv090x_start_search()
1475 if (STV090x_WRITE_DEMOD(state, CFRLOW0, LSB(freq)) < 0) in stv090x_start_search()
1480 if (STV090x_WRITE_DEMOD(state, CFRINIT1, 0) < 0) in stv090x_start_search()
1482 if (STV090x_WRITE_DEMOD(state, CFRINIT0, 0) < 0) in stv090x_start_search()
1485 if (state->internal->dev_ver >= 0x20) { in stv090x_start_search()
1486 if (STV090x_WRITE_DEMOD(state, EQUALCFG, 0x41) < 0) in stv090x_start_search()
1488 if (STV090x_WRITE_DEMOD(state, FFECFG, 0x41) < 0) in stv090x_start_search()
1495 if (STV090x_WRITE_DEMOD(state, VITSCALE, 0x82) < 0) in stv090x_start_search()
1497 if (STV090x_WRITE_DEMOD(state, VAVSRVIT, 0x00) < 0) in stv090x_start_search()
1502 if (STV090x_WRITE_DEMOD(state, SFRSTEP, 0x00) < 0) in stv090x_start_search()
1504 if (STV090x_WRITE_DEMOD(state, TMGTHRISE, 0xe0) < 0) in stv090x_start_search()
1506 if (STV090x_WRITE_DEMOD(state, TMGTHFALL, 0xc0) < 0) in stv090x_start_search()
1510 STV090x_SETFIELD_Px(reg, SCAN_ENABLE_FIELD, 0); in stv090x_start_search()
1511 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0); in stv090x_start_search()
1512 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_start_search()
1515 STV090x_SETFIELD_Px(reg, S1S2_SEQUENTIAL_FIELD, 0x0); in stv090x_start_search()
1516 if (STV090x_WRITE_DEMOD(state, DMDCFG2, reg) < 0) in stv090x_start_search()
1519 if (STV090x_WRITE_DEMOD(state, RTC, 0x88) < 0) in stv090x_start_search()
1522 if (state->internal->dev_ver >= 0x20) { in stv090x_start_search()
1525 if (state->internal->dev_ver <= 0x20) { in stv090x_start_search()
1527 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x39) < 0) in stv090x_start_search()
1531 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x89) < 0) in stv090x_start_search()
1534 if (STV090x_WRITE_DEMOD(state, CARHDR, 0x40) < 0) in stv090x_start_search()
1537 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x4c) < 0) in stv090x_start_search()
1539 if (STV090x_WRITE_DEMOD(state, CARHDR, 0x20) < 0) in stv090x_start_search()
1542 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x4b) < 0) in stv090x_start_search()
1544 if (STV090x_WRITE_DEMOD(state, CARHDR, 0x20) < 0) in stv090x_start_search()
1549 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0xef) < 0) in stv090x_start_search()
1552 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0xed) < 0) in stv090x_start_search()
1562 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_start_search()
1564 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x18) < 0) in stv090x_start_search()
1570 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_start_search()
1572 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x15) < 0) in stv090x_start_search()
1579 return 0; in stv090x_start_search()
1587 u32 agc2_min = 0xffff, agc2 = 0, freq_init, freq_step, reg; in stv090x_get_agc2_min_level()
1590 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x38) < 0) in stv090x_get_agc2_min_level()
1593 STV090x_SETFIELD_Px(reg, SCAN_ENABLE_FIELD, 0); in stv090x_get_agc2_min_level()
1594 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0); in stv090x_get_agc2_min_level()
1595 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_get_agc2_min_level()
1598 if (STV090x_WRITE_DEMOD(state, SFRUP1, 0x83) < 0) /* SR = 65 Msps Max */ in stv090x_get_agc2_min_level()
1600 if (STV090x_WRITE_DEMOD(state, SFRUP0, 0xc0) < 0) in stv090x_get_agc2_min_level()
1602 if (STV090x_WRITE_DEMOD(state, SFRLOW1, 0x82) < 0) /* SR= 400 ksps Min */ in stv090x_get_agc2_min_level()
1604 if (STV090x_WRITE_DEMOD(state, SFRLOW0, 0xa0) < 0) in stv090x_get_agc2_min_level()
1606 if (STV090x_WRITE_DEMOD(state, DMDTOM, 0x00) < 0) /* stop acq @ coarse carrier state */ in stv090x_get_agc2_min_level()
1608 if (stv090x_set_srate(state, 1000000) < 0) in stv090x_get_agc2_min_level()
1612 if (steps <= 0) in stv090x_get_agc2_min_level()
1617 freq_init = 0; in stv090x_get_agc2_min_level()
1619 for (i = 0; i < steps; i++) { in stv090x_get_agc2_min_level()
1620 if (dir > 0) in stv090x_get_agc2_min_level()
1627 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x5c) < 0) /* Demod RESET */ in stv090x_get_agc2_min_level()
1629 if (STV090x_WRITE_DEMOD(state, CFRINIT1, (freq_init >> 8) & 0xff) < 0) in stv090x_get_agc2_min_level()
1631 if (STV090x_WRITE_DEMOD(state, CFRINIT0, freq_init & 0xff) < 0) in stv090x_get_agc2_min_level()
1633 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x58) < 0) /* Demod RESET */ in stv090x_get_agc2_min_level()
1637 agc2 = 0; in stv090x_get_agc2_min_level()
1638 for (j = 0; j < 10; j++) { in stv090x_get_agc2_min_level()
1668 tmp_1 = clk % 0x10000; in stv090x_get_srate()
1669 tmp_2 = srate % 0x10000; in stv090x_get_srate()
1682 int tmg_lock = 0, i; in stv090x_srate_srch_coarse()
1683 s32 tmg_cpt = 0, dir = 1, steps, cur_step = 0, freq; in stv090x_srate_srch_coarse()
1684 u32 srate_coarse = 0, agc2 = 0, car_step = 1200, reg; in stv090x_srate_srch_coarse()
1687 if (state->internal->dev_ver >= 0x30) in stv090x_srate_srch_coarse()
1688 agc2th = 0x2e00; in stv090x_srate_srch_coarse()
1690 agc2th = 0x1f00; in stv090x_srate_srch_coarse()
1693 STV090x_SETFIELD_Px(reg, I2C_DEMOD_MODE_FIELD, 0x1f); /* Demod RESET */ in stv090x_srate_srch_coarse()
1694 if (STV090x_WRITE_DEMOD(state, DMDISTATE, reg) < 0) in stv090x_srate_srch_coarse()
1696 if (STV090x_WRITE_DEMOD(state, TMGCFG, 0x12) < 0) in stv090x_srate_srch_coarse()
1698 if (STV090x_WRITE_DEMOD(state, TMGCFG2, 0xc0) < 0) in stv090x_srate_srch_coarse()
1700 if (STV090x_WRITE_DEMOD(state, TMGTHRISE, 0xf0) < 0) in stv090x_srate_srch_coarse()
1702 if (STV090x_WRITE_DEMOD(state, TMGTHFALL, 0xe0) < 0) in stv090x_srate_srch_coarse()
1706 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0); in stv090x_srate_srch_coarse()
1707 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_srate_srch_coarse()
1710 if (STV090x_WRITE_DEMOD(state, SFRUP1, 0x83) < 0) in stv090x_srate_srch_coarse()
1712 if (STV090x_WRITE_DEMOD(state, SFRUP0, 0xc0) < 0) in stv090x_srate_srch_coarse()
1714 if (STV090x_WRITE_DEMOD(state, SFRLOW1, 0x82) < 0) in stv090x_srate_srch_coarse()
1716 if (STV090x_WRITE_DEMOD(state, SFRLOW0, 0xa0) < 0) in stv090x_srate_srch_coarse()
1718 if (STV090x_WRITE_DEMOD(state, DMDTOM, 0x00) < 0) in stv090x_srate_srch_coarse()
1720 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x50) < 0) in stv090x_srate_srch_coarse()
1723 if (state->internal->dev_ver >= 0x30) { in stv090x_srate_srch_coarse()
1724 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x99) < 0) in stv090x_srate_srch_coarse()
1726 if (STV090x_WRITE_DEMOD(state, SFRSTEP, 0x98) < 0) in stv090x_srate_srch_coarse()
1729 } else if (state->internal->dev_ver >= 0x20) { in stv090x_srate_srch_coarse()
1730 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x6a) < 0) in stv090x_srate_srch_coarse()
1732 if (STV090x_WRITE_DEMOD(state, SFRSTEP, 0x95) < 0) in stv090x_srate_srch_coarse()
1748 if (steps < 0) in stv090x_srate_srch_coarse()
1754 cur_step = 0; in stv090x_srate_srch_coarse()
1759 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x5f) < 0) /* Demod RESET */ in stv090x_srate_srch_coarse()
1761 if (STV090x_WRITE_DEMOD(state, CFRINIT1, 0x00) < 0) in stv090x_srate_srch_coarse()
1763 if (STV090x_WRITE_DEMOD(state, CFRINIT0, 0x00) < 0) in stv090x_srate_srch_coarse()
1765 if (STV090x_WRITE_DEMOD(state, SFRINIT1, 0x00) < 0) in stv090x_srate_srch_coarse()
1767 if (STV090x_WRITE_DEMOD(state, SFRINIT0, 0x00) < 0) in stv090x_srate_srch_coarse()
1770 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x40) < 0) in stv090x_srate_srch_coarse()
1773 for (i = 0; i < 10; i++) { in stv090x_srate_srch_coarse()
1788 if (dir > 0) in stv090x_srate_srch_coarse()
1794 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_srate_srch_coarse()
1798 if (state->config->tuner_set_frequency(fe, freq) < 0) in stv090x_srate_srch_coarse()
1803 if (state->config->tuner_set_bandwidth(fe, state->tuner_bw) < 0) in stv090x_srate_srch_coarse()
1807 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_srate_srch_coarse()
1812 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_srate_srch_coarse()
1816 if (state->config->tuner_get_status(fe, ®) < 0) in stv090x_srate_srch_coarse()
1825 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_srate_srch_coarse()
1831 srate_coarse = 0; in stv090x_srate_srch_coarse()
1838 stv090x_i2c_gate_ctrl(state, 0); in stv090x_srate_srch_coarse()
1854 srate_coarse = 0; in stv090x_srate_srch_fine()
1856 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) /* Demod RESET */ in stv090x_srate_srch_fine()
1858 if (STV090x_WRITE_DEMOD(state, TMGCFG2, 0xc1) < 0) in stv090x_srate_srch_fine()
1860 if (STV090x_WRITE_DEMOD(state, TMGTHRISE, 0x20) < 0) in stv090x_srate_srch_fine()
1862 if (STV090x_WRITE_DEMOD(state, TMGTHFALL, 0x00) < 0) in stv090x_srate_srch_fine()
1864 if (STV090x_WRITE_DEMOD(state, TMGCFG, 0xd2) < 0) in stv090x_srate_srch_fine()
1867 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0x00); in stv090x_srate_srch_fine()
1868 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_srate_srch_fine()
1871 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x38) < 0) in stv090x_srate_srch_fine()
1874 if (state->internal->dev_ver >= 0x30) { in stv090x_srate_srch_fine()
1875 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x79) < 0) in stv090x_srate_srch_fine()
1877 } else if (state->internal->dev_ver >= 0x20) { in stv090x_srate_srch_fine()
1878 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x49) < 0) in stv090x_srate_srch_fine()
1886 if (STV090x_WRITE_DEMOD(state, SFRUP1, (sym >> 8) & 0x7f) < 0) in stv090x_srate_srch_fine()
1888 if (STV090x_WRITE_DEMOD(state, SFRUP0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1893 if (STV090x_WRITE_DEMOD(state, SFRLOW1, (sym >> 8) & 0x7f) < 0) in stv090x_srate_srch_fine()
1895 if (STV090x_WRITE_DEMOD(state, SFRLOW0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1899 if (STV090x_WRITE_DEMOD(state, SFRINIT1, (sym >> 8) & 0xff) < 0) in stv090x_srate_srch_fine()
1901 if (STV090x_WRITE_DEMOD(state, SFRINIT0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1907 if (STV090x_WRITE_DEMOD(state, SFRUP1, (sym >> 8) & 0x7f) < 0) in stv090x_srate_srch_fine()
1909 if (STV090x_WRITE_DEMOD(state, SFRUP0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1914 if (STV090x_WRITE_DEMOD(state, SFRLOW1, (sym >> 8) & 0x7f) < 0) in stv090x_srate_srch_fine()
1916 if (STV090x_WRITE_DEMOD(state, SFRLOW0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1920 if (STV090x_WRITE_DEMOD(state, SFRINIT1, (sym >> 8) & 0xff) < 0) in stv090x_srate_srch_fine()
1922 if (STV090x_WRITE_DEMOD(state, SFRINIT0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1925 if (STV090x_WRITE_DEMOD(state, DMDTOM, 0x20) < 0) in stv090x_srate_srch_fine()
1927 if (STV090x_WRITE_DEMOD(state, CFRINIT1, (freq_coarse >> 8) & 0xff) < 0) in stv090x_srate_srch_fine()
1929 if (STV090x_WRITE_DEMOD(state, CFRINIT0, freq_coarse & 0xff) < 0) in stv090x_srate_srch_fine()
1931 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x15) < 0) /* trigger acquisition */ in stv090x_srate_srch_fine()
1944 s32 timer = 0, lock = 0; in stv090x_get_dmdlock()
1953 case 0: /* searching */ in stv090x_get_dmdlock()
1957 lock = 0; in stv090x_get_dmdlock()
1981 int coarse_fail = 0; in stv090x_blind_search()
1990 lock = 0; in stv090x_blind_search()
1993 if (state->internal->dev_ver <= 0x20) { in stv090x_blind_search()
1994 if (STV090x_WRITE_DEMOD(state, CARCFG, 0xc4) < 0) in stv090x_blind_search()
1998 if (STV090x_WRITE_DEMOD(state, CARCFG, 0x06) < 0) in stv090x_blind_search()
2002 if (STV090x_WRITE_DEMOD(state, RTCS2, 0x44) < 0) in stv090x_blind_search()
2005 if (state->internal->dev_ver >= 0x20) { in stv090x_blind_search()
2006 if (STV090x_WRITE_DEMOD(state, EQUALCFG, 0x41) < 0) in stv090x_blind_search()
2008 if (STV090x_WRITE_DEMOD(state, FFECFG, 0x41) < 0) in stv090x_blind_search()
2010 if (STV090x_WRITE_DEMOD(state, VITSCALE, 0x82) < 0) in stv090x_blind_search()
2012 if (STV090x_WRITE_DEMOD(state, VAVSRVIT, 0x00) < 0) /* set viterbi hysteresis */ in stv090x_blind_search()
2018 if (STV090x_WRITE_DEMOD(state, KREFTMG, k_ref) < 0) in stv090x_blind_search()
2020 if (stv090x_srate_srch_coarse(state) != 0) { in stv090x_blind_search()
2022 if (srate_coarse != 0) { in stv090x_blind_search()
2027 lock = 0; in stv090x_blind_search()
2030 cpt_fail = 0; in stv090x_blind_search()
2031 agc2_ovflw = 0; in stv090x_blind_search()
2032 for (i = 0; i < 10; i++) { in stv090x_blind_search()
2035 if (agc2 >= 0xff00) in stv090x_blind_search()
2038 if ((STV090x_GETFIELD_Px(reg, CFR_OVERFLOW_FIELD) == 0x01) && in stv090x_blind_search()
2039 (STV090x_GETFIELD_Px(reg, DEMOD_DELOCK_FIELD) == 0x01)) in stv090x_blind_search()
2046 lock = 0; in stv090x_blind_search()
2062 s32 tmg_cpt = 0, i; in stv090x_chk_tmg()
2064 int tmg_lock = 0; in stv090x_chk_tmg()
2069 if (STV090x_WRITE_DEMOD(state, TMGTHRISE, 0x20) < 0) in stv090x_chk_tmg()
2071 if (STV090x_WRITE_DEMOD(state, TMGTHFALL, 0x00) < 0) in stv090x_chk_tmg()
2075 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0x00); /* stop carrier offset search */ in stv090x_chk_tmg()
2076 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_chk_tmg()
2078 if (STV090x_WRITE_DEMOD(state, RTC, 0x80) < 0) in stv090x_chk_tmg()
2081 if (STV090x_WRITE_DEMOD(state, RTCS2, 0x40) < 0) in stv090x_chk_tmg()
2083 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x00) < 0) in stv090x_chk_tmg()
2086 if (STV090x_WRITE_DEMOD(state, CFRINIT1, 0x00) < 0) /* set car ofset to 0 */ in stv090x_chk_tmg()
2088 if (STV090x_WRITE_DEMOD(state, CFRINIT0, 0x00) < 0) in stv090x_chk_tmg()
2090 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x65) < 0) in stv090x_chk_tmg()
2093 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x18) < 0) /* trigger acquisition */ in stv090x_chk_tmg()
2097 for (i = 0; i < 10; i++) { in stv090x_chk_tmg()
2106 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x38) < 0) in stv090x_chk_tmg()
2108 if (STV090x_WRITE_DEMOD(state, RTC, 0x88) < 0) /* DVB-S1 timing */ in stv090x_chk_tmg()
2110 if (STV090x_WRITE_DEMOD(state, RTCS2, 0x68) < 0) /* DVB-S2 timing */ in stv090x_chk_tmg()
2113 if (STV090x_WRITE_DEMOD(state, CARFREQ, freq) < 0) in stv090x_chk_tmg()
2115 if (STV090x_WRITE_DEMOD(state, TMGTHRISE, tmg_thh) < 0) in stv090x_chk_tmg()
2117 if (STV090x_WRITE_DEMOD(state, TMGTHFALL, tmg_thl) < 0) in stv090x_chk_tmg()
2146 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_get_coldlock()
2148 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x15) < 0) in stv090x_get_coldlock()
2152 return 0; in stv090x_get_coldlock()
2167 if (steps < 0) in stv090x_get_coldlock()
2178 if (dir > 0) in stv090x_get_coldlock()
2184 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_get_coldlock()
2188 if (state->config->tuner_set_frequency(fe, freq) < 0) in stv090x_get_coldlock()
2193 if (state->config->tuner_set_bandwidth(fe, state->tuner_bw) < 0) in stv090x_get_coldlock()
2197 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_get_coldlock()
2202 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_get_coldlock()
2206 if (state->config->tuner_get_status(fe, ®) < 0) in stv090x_get_coldlock()
2214 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_get_coldlock()
2217 STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1c); in stv090x_get_coldlock()
2218 if (STV090x_WRITE_DEMOD(state, CFRINIT1, 0x00) < 0) in stv090x_get_coldlock()
2220 if (STV090x_WRITE_DEMOD(state, CFRINIT0, 0x00) < 0) in stv090x_get_coldlock()
2222 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_get_coldlock()
2224 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x15) < 0) in stv090x_get_coldlock()
2235 stv090x_i2c_gate_ctrl(state, 0); in stv090x_get_coldlock()
2251 if (car_max > 0x4000) in stv090x_get_loop_params()
2252 car_max = 0x4000 ; /* maxcarrier should be<= +-1/4 Mclk */ in stv090x_get_loop_params()
2279 if ((inc > car_max) || (inc < 0)) in stv090x_get_loop_params()
2283 if (srate > 0) in stv090x_get_loop_params()
2286 if ((timeout > 100) || (timeout < 0)) in stv090x_get_loop_params()
2290 if ((steps_max > 100) || (steps_max < 0)) { in stv090x_get_loop_params()
2298 return 0; in stv090x_get_loop_params()
2318 if (car_max > 0x4000) in stv090x_chk_signal()
2319 car_max = 0x4000; in stv090x_chk_signal()
2321 if ((agc2 > 0x2000) || (offst_car > 2 * car_max) || (offst_car < -2 * car_max)) { in stv090x_chk_signal()
2325 no_signal = 0; in stv090x_chk_signal()
2334 int no_signal, lock = 0; in stv090x_search_car_loop()
2335 s32 cpt_step = 0, offst_freq, car_max; in stv090x_search_car_loop()
2342 if (car_max > 0x4000) in stv090x_search_car_loop()
2343 car_max = 0x4000; in stv090x_search_car_loop()
2346 offst_freq = 0; in stv090x_search_car_loop()
2351 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1c) < 0) in stv090x_search_car_loop()
2353 if (STV090x_WRITE_DEMOD(state, CFRINIT1, ((offst_freq / 256) & 0xff)) < 0) in stv090x_search_car_loop()
2355 if (STV090x_WRITE_DEMOD(state, CFRINIT0, offst_freq & 0xff) < 0) in stv090x_search_car_loop()
2357 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x18) < 0) in stv090x_search_car_loop()
2361 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0x1); /* stop DVB-S2 packet delin */ in stv090x_search_car_loop()
2362 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_search_car_loop()
2366 if (offst_freq >= 0) in stv090x_search_car_loop()
2386 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0); in stv090x_search_car_loop()
2387 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_search_car_loop()
2398 int no_signal, zigzag, lock = 0; in stv090x_sw_algo()
2411 if (state->internal->dev_ver >= 0x20) { in stv090x_sw_algo()
2412 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x3B) < 0) in stv090x_sw_algo()
2416 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, 0x49) < 0) in stv090x_sw_algo()
2418 zigzag = 0; in stv090x_sw_algo()
2422 if (state->internal->dev_ver >= 0x20) { in stv090x_sw_algo()
2423 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x79) < 0) in stv090x_sw_algo()
2427 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, 0x89) < 0) in stv090x_sw_algo()
2435 if (state->internal->dev_ver >= 0x20) { in stv090x_sw_algo()
2436 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x3b) < 0) in stv090x_sw_algo()
2438 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x79) < 0) in stv090x_sw_algo()
2442 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, 0xc9) < 0) in stv090x_sw_algo()
2444 zigzag = 0; in stv090x_sw_algo()
2448 trials = 0; in stv090x_sw_algo()
2457 if (state->internal->dev_ver >= 0x20) { in stv090x_sw_algo()
2458 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x49) < 0) in stv090x_sw_algo()
2460 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x9e) < 0) in stv090x_sw_algo()
2470 if (dvbs2_fly_wheel < 0xd) { /*if correct frames is decrementing */ in stv090x_sw_algo()
2475 if (dvbs2_fly_wheel < 0xd) { in stv090x_sw_algo()
2477 lock = 0; in stv090x_sw_algo()
2479 if (state->internal->dev_ver >= 0x20) { in stv090x_sw_algo()
2480 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x79) < 0) in stv090x_sw_algo()
2484 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, 0x89) < 0) in stv090x_sw_algo()
2533 tmp_1 = mclk % 0x1000; in stv090x_get_car_freq()
2534 tmp_2 = derot % 0x1000; in stv090x_get_car_freq()
2580 return 0; in stv090x_get_viterbi()
2589 s32 i = 0, offst_freq; in stv090x_get_sig_params()
2595 STV090x_WRITE_DEMOD(state, SFRSTEP, 0x5c); in stv090x_get_sig_params()
2596 while ((i <= 50) && (tmg != 0) && (tmg != 0xff)) { in stv090x_get_sig_params()
2604 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_get_sig_params()
2608 if (state->config->tuner_get_frequency(fe, &state->frequency) < 0) in stv090x_get_sig_params()
2612 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_get_sig_params()
2618 if (stv090x_get_viterbi(state) < 0) in stv090x_get_sig_params()
2623 state->pilots = STV090x_GETFIELD_Px(reg, DEMOD_TYPE_FIELD) & 0x01; in stv090x_get_sig_params()
2632 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_get_sig_params()
2636 if (state->config->tuner_get_frequency(fe, &state->frequency) < 0) in stv090x_get_sig_params()
2640 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_get_sig_params()
2655 stv090x_i2c_gate_ctrl(state, 0); in stv090x_get_sig_params()
2673 offst_tmg = ((s32) srate * 10) / ((s32) 0x1000000 / offst_tmg); in stv090x_get_tmgoffst()
2681 u8 aclc = 0x29; in stv090x_optimize_carloop()
2685 if (state->internal->dev_ver == 0x20) { in stv090x_optimize_carloop()
2697 i = 0; in stv090x_optimize_carloop()
2705 i = 0; in stv090x_optimize_carloop()
2710 i = 0; in stv090x_optimize_carloop()
2793 s32 index = 0; in stv090x_optimize_carloop_short()
2794 u8 aclc = 0x0b; in stv090x_optimize_carloop_short()
2799 index = 0; in stv090x_optimize_carloop_short()
2812 if (state->internal->dev_ver >= 0x30) { in stv090x_optimize_carloop_short()
2840 s32 srate, pilots, aclc, f_1, f_0, i = 0, blind_tune = 0; in stv090x_optimize_track()
2852 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_optimize_track()
2853 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
2858 STV090x_SETFIELD_Px(reg, MANUAL_SXROLLOFF_FIELD, 0x01); in stv090x_optimize_track()
2859 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_optimize_track()
2862 if (state->internal->dev_ver >= 0x30) { in stv090x_optimize_track()
2863 if (stv090x_get_viterbi(state) < 0) in stv090x_optimize_track()
2867 if (STV090x_WRITE_DEMOD(state, GAUSSR0, 0x98) < 0) in stv090x_optimize_track()
2869 if (STV090x_WRITE_DEMOD(state, CCIR0, 0x18) < 0) in stv090x_optimize_track()
2872 if (STV090x_WRITE_DEMOD(state, GAUSSR0, 0x18) < 0) in stv090x_optimize_track()
2874 if (STV090x_WRITE_DEMOD(state, CCIR0, 0x18) < 0) in stv090x_optimize_track()
2879 if (STV090x_WRITE_DEMOD(state, ERRCTRL1, 0x75) < 0) in stv090x_optimize_track()
2885 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 0); in stv090x_optimize_track()
2887 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
2889 if (state->internal->dev_ver >= 0x30) { in stv090x_optimize_track()
2890 if (STV090x_WRITE_DEMOD(state, ACLC, 0) < 0) in stv090x_optimize_track()
2892 if (STV090x_WRITE_DEMOD(state, BCLC, 0) < 0) in stv090x_optimize_track()
2898 pilots = STV090x_GETFIELD_Px(reg, DEMOD_TYPE_FIELD) & 0x01; in stv090x_optimize_track()
2903 if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, 0x2a) < 0) in stv090x_optimize_track()
2905 if (STV090x_WRITE_DEMOD(state, ACLC2S28, aclc) < 0) in stv090x_optimize_track()
2910 if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, 0x2a) < 0) in stv090x_optimize_track()
2912 if (STV090x_WRITE_DEMOD(state, ACLC2S216A, aclc) < 0) in stv090x_optimize_track()
2915 if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, 0x2a) < 0) in stv090x_optimize_track()
2917 if (STV090x_WRITE_DEMOD(state, ACLC2S232A, aclc) < 0) in stv090x_optimize_track()
2925 if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, aclc) < 0) in stv090x_optimize_track()
2928 if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, 0x2a) < 0) in stv090x_optimize_track()
2930 if (STV090x_WRITE_DEMOD(state, ACLC2S28, aclc) < 0) in stv090x_optimize_track()
2933 if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, 0x2a) < 0) in stv090x_optimize_track()
2935 if (STV090x_WRITE_DEMOD(state, ACLC2S216A, aclc) < 0) in stv090x_optimize_track()
2938 if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, 0x2a) < 0) in stv090x_optimize_track()
2940 if (STV090x_WRITE_DEMOD(state, ACLC2S232A, aclc) < 0) in stv090x_optimize_track()
2945 STV090x_WRITE_DEMOD(state, ERRCTRL1, 0x67); /* PER */ in stv090x_optimize_track()
2953 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
2963 STV090x_WRITE_DEMOD(state, SFRSTEP, 0x00); in stv090x_optimize_track()
2965 STV090x_SETFIELD_Px(reg, SCAN_ENABLE_FIELD, 0x00); in stv090x_optimize_track()
2966 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0x00); in stv090x_optimize_track()
2967 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
2969 if (STV090x_WRITE_DEMOD(state, TMGCFG2, 0xc1) < 0) in stv090x_optimize_track()
2972 if (stv090x_set_srate(state, srate) < 0) in stv090x_optimize_track()
2976 if (stv090x_dvbs_track_crl(state) < 0) in stv090x_optimize_track()
2980 if (state->internal->dev_ver >= 0x20) { in stv090x_optimize_track()
2985 if (STV090x_WRITE_DEMOD(state, VAVSRVIT, 0x0a) < 0) in stv090x_optimize_track()
2987 if (STV090x_WRITE_DEMOD(state, VITSCALE, 0x00) < 0) in stv090x_optimize_track()
2992 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x38) < 0) in stv090x_optimize_track()
2996 if (STV090x_WRITE_DEMOD(state, SFRUP1, 0x80) < 0) in stv090x_optimize_track()
2999 if (STV090x_WRITE_DEMOD(state, SFRLOW1, 0x80) < 0) in stv090x_optimize_track()
3002 if ((state->internal->dev_ver >= 0x20) || (blind_tune == 1) || in stv090x_optimize_track()
3005 if (STV090x_WRITE_DEMOD(state, CFRINIT1, f_1) < 0) in stv090x_optimize_track()
3007 if (STV090x_WRITE_DEMOD(state, CFRINIT0, f_0) < 0) in stv090x_optimize_track()
3011 if ((state->internal->dev_ver >= 0x20) || (blind_tune == 1)) { in stv090x_optimize_track()
3015 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_optimize_track()
3019 if (state->config->tuner_set_bandwidth(fe, state->tuner_bw) < 0) in stv090x_optimize_track()
3023 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_optimize_track()
3036 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_optimize_track()
3038 if (STV090x_WRITE_DEMOD(state, CFRINIT1, f_1) < 0) in stv090x_optimize_track()
3040 if (STV090x_WRITE_DEMOD(state, CFRINIT0, f_0) < 0) in stv090x_optimize_track()
3042 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x18) < 0) in stv090x_optimize_track()
3045 i = 0; in stv090x_optimize_track()
3049 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_optimize_track()
3051 if (STV090x_WRITE_DEMOD(state, CFRINIT1, f_1) < 0) in stv090x_optimize_track()
3053 if (STV090x_WRITE_DEMOD(state, CFRINIT0, f_0) < 0) in stv090x_optimize_track()
3055 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x18) < 0) in stv090x_optimize_track()
3063 if (state->internal->dev_ver >= 0x20) { in stv090x_optimize_track()
3064 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x49) < 0) in stv090x_optimize_track()
3071 return 0; in stv090x_optimize_track()
3074 stv090x_i2c_gate_ctrl(state, 0); in stv090x_optimize_track()
3082 s32 timer = 0, lock = 0, stat; in stv090x_get_feclock()
3090 case 0: /* searching */ in stv090x_get_feclock()
3093 lock = 0; in stv090x_get_feclock()
3117 s32 timer = 0; in stv090x_get_lock()
3125 lock = 0; in stv090x_get_lock()
3142 if (state->internal->dev_ver <= 0x20) { in stv090x_set_s2rolloff()
3145 STV090x_SETFIELD_Px(reg, MANUAL_SXROLLOFF_FIELD, 0x00); in stv090x_set_s2rolloff()
3146 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_set_s2rolloff()
3151 STV090x_SETFIELD_Px(reg, MANUAL_S2ROLLOFF_FIELD, 0x00); in stv090x_set_s2rolloff()
3152 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_set_s2rolloff()
3155 return 0; in stv090x_set_s2rolloff()
3167 s32 agc1_power, power_iq = 0, i; in stv090x_algo()
3168 int lock = 0, low_sr = 0; in stv090x_algo()
3172 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3175 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x5c) < 0) /* Demod stop */ in stv090x_algo()
3178 if (state->internal->dev_ver >= 0x20) { in stv090x_algo()
3180 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x9e) < 0) in stv090x_algo()
3183 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x82) < 0) in stv090x_algo()
3192 if (STV090x_WRITE_DEMOD(state, TMGCFG2, 0xc0) < 0) /* wider srate scan */ in stv090x_algo()
3194 if (STV090x_WRITE_DEMOD(state, CORRELMANT, 0x70) < 0) in stv090x_algo()
3196 if (stv090x_set_srate(state, 1000000) < 0) /* initial srate = 1Msps */ in stv090x_algo()
3200 if (STV090x_WRITE_DEMOD(state, DMDTOM, 0x20) < 0) in stv090x_algo()
3202 if (STV090x_WRITE_DEMOD(state, TMGCFG, 0xd2) < 0) in stv090x_algo()
3207 if (STV090x_WRITE_DEMOD(state, CORRELMANT, 0x63) < 0) in stv090x_algo()
3211 if (STV090x_WRITE_DEMOD(state, CORRELMANT, 0x70) < 0) in stv090x_algo()
3215 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x38) < 0) in stv090x_algo()
3218 if (state->internal->dev_ver >= 0x20) { in stv090x_algo()
3219 if (STV090x_WRITE_DEMOD(state, KREFTMG, 0x5a) < 0) in stv090x_algo()
3230 if (STV090x_WRITE_DEMOD(state, TMGCFG2, 0xc1) < 0) /* narrow srate scan */ in stv090x_algo()
3233 if (stv090x_set_srate(state, state->srate) < 0) in stv090x_algo()
3237 state->srate) < 0) in stv090x_algo()
3240 state->srate) < 0) in stv090x_algo()
3244 low_sr = 0; in stv090x_algo()
3250 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_algo()
3255 if (reg == 0) in stv090x_algo()
3257 if (state->config->tuner_set_bbgain(fe, reg) < 0) in stv090x_algo()
3262 if (state->config->tuner_set_frequency(fe, state->frequency) < 0) in stv090x_algo()
3267 if (state->config->tuner_set_bandwidth(fe, state->tuner_bw) < 0) in stv090x_algo()
3271 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_algo()
3277 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_algo()
3279 if (state->config->tuner_get_status(fe, ®) < 0) in stv090x_algo()
3281 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_algo()
3296 if (agc1_power == 0) { in stv090x_algo()
3297 /* If AGC1 integrator value is 0 in stv090x_algo()
3300 for (i = 0; i < 5; i++) { in stv090x_algo()
3307 if ((agc1_power == 0) && (power_iq < STV090x_IQPOWER_THRESHOLD)) { in stv090x_algo()
3308 dprintk(FE_ERROR, 1, "No Signal: POWER_IQ=0x%02x", power_iq); in stv090x_algo()
3309 lock = 0; in stv090x_algo()
3315 if (state->internal->dev_ver <= 0x20) { in stv090x_algo()
3322 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_algo()
3325 if (stv090x_delivery_search(state) < 0) in stv090x_algo()
3329 if (stv090x_start_search(state) < 0) in stv090x_algo()
3359 if (state->internal->dev_ver >= 0x20) { in stv090x_algo()
3364 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0); /* release merger reset */ in stv090x_algo()
3365 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3371 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3374 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0); /* release merger reset */ in stv090x_algo()
3375 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3387 if (STV090x_WRITE_DEMOD(state, PDELCTRL2, reg) < 0) in stv090x_algo()
3391 STV090x_SETFIELD_Px(reg, RESET_UPKO_COUNT, 0); in stv090x_algo()
3392 if (STV090x_WRITE_DEMOD(state, PDELCTRL2, reg) < 0) in stv090x_algo()
3395 if (STV090x_WRITE_DEMOD(state, ERRCTRL1, 0x67) < 0) /* PER */ in stv090x_algo()
3398 if (STV090x_WRITE_DEMOD(state, ERRCTRL1, 0x75) < 0) in stv090x_algo()
3402 if (STV090x_WRITE_DEMOD(state, FBERCPT4, 0x00) < 0) in stv090x_algo()
3405 if (STV090x_WRITE_DEMOD(state, ERRCTRL2, 0xc1) < 0) in stv090x_algo()
3415 stv090x_i2c_gate_ctrl(state, 0); in stv090x_algo()
3424 if (STV090x_WRITE_DEMOD(state, PLROOT0, pls_code & 0xff) < 0) in stv090x_set_pls()
3426 if (STV090x_WRITE_DEMOD(state, PLROOT1, (pls_code >> 8) & 0xff) < 0) in stv090x_set_pls()
3428 if (STV090x_WRITE_DEMOD(state, PLROOT2, 0x04 | (pls_code >> 16)) < 0) in stv090x_set_pls()
3430 return 0; in stv090x_set_pls()
3440 if (mis < 0 || mis > 255) { in stv090x_set_mis()
3443 STV090x_SETFIELD_Px(reg, FILTER_EN_FIELD, 0x00); in stv090x_set_mis()
3444 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_set_mis()
3449 STV090x_SETFIELD_Px(reg, FILTER_EN_FIELD, 0x01); in stv090x_set_mis()
3450 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_set_mis()
3452 if (STV090x_WRITE_DEMOD(state, ISIENTRY, mis) < 0) in stv090x_set_mis()
3454 if (STV090x_WRITE_DEMOD(state, ISIBITENA, 0xff) < 0) in stv090x_set_mis()
3457 return 0; in stv090x_set_mis()
3468 if (props->frequency == 0) in stv090x_search()
3518 *status = 0; in stv090x_read_status()
3528 case 0: /* searching */ in stv090x_read_status()
3561 return 0; in stv090x_read_status()
3595 count = (count_2 & 0xff) << 16; in stv090x_read_per()
3596 count |= (count_1 & 0xff) << 8; in stv090x_read_per()
3597 count |= count_0 & 0xff; in stv090x_read_per()
3601 if (count == 0) in stv090x_read_per()
3604 if (STV090x_WRITE_DEMOD(state, FBERCPT4, 0) < 0) in stv090x_read_per()
3606 if (STV090x_WRITE_DEMOD(state, ERRCTRL2, 0xc1) < 0) in stv090x_read_per()
3609 return 0; in stv090x_read_per()
3617 int res = 0; in stv090x_table_lookup()
3618 int min = 0, med; in stv090x_table_lookup()
3666 if (agc > stv090x_rf_tab[0].read) in stv090x_read_signal_strength()
3667 str = 0; in stv090x_read_signal_strength()
3670 *strength = (str + 100) * 0xFFFF / 100; in stv090x_read_signal_strength()
3672 return 0; in stv090x_read_signal_strength()
3679 s32 val_0, val_1, val = 0; in stv090x_read_cnr()
3690 for (i = 0; i < 16; i++) { in stv090x_read_cnr()
3703 if (val < 0) in stv090x_read_cnr()
3704 val = 0; in stv090x_read_cnr()
3705 *cnr = val * 0xFFFF / div; in stv090x_read_cnr()
3715 for (i = 0; i < 16; i++) { in stv090x_read_cnr()
3726 stv090x_s1cn_tab[0].real; in stv090x_read_cnr()
3728 *cnr = val * 0xFFFF / div; in stv090x_read_cnr()
3735 return 0; in stv090x_read_cnr()
3746 STV090x_SETFIELD_Px(reg, DISTX_MODE_FIELD, 0); in stv090x_set_tone()
3748 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_set_tone()
3750 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 0); in stv090x_set_tone()
3751 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_set_tone()
3756 STV090x_SETFIELD_Px(reg, DISTX_MODE_FIELD, 0); in stv090x_set_tone()
3758 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_set_tone()
3765 return 0; in stv090x_set_tone()
3780 u32 reg, idle = 0, fifo_full = 1; in stv090x_send_diseqc_msg()
3788 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3790 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 0); in stv090x_send_diseqc_msg()
3791 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3795 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3798 for (i = 0; i < cmd->msg_len; i++) { in stv090x_send_diseqc_msg()
3805 if (STV090x_WRITE_DEMOD(state, DISTXDATA, cmd->msg[i]) < 0) in stv090x_send_diseqc_msg()
3809 STV090x_SETFIELD_Px(reg, DIS_PRECHARGE_FIELD, 0); in stv090x_send_diseqc_msg()
3810 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3813 i = 0; in stv090x_send_diseqc_msg()
3822 return 0; in stv090x_send_diseqc_msg()
3832 u32 reg, idle = 0, fifo_full = 1; in stv090x_send_diseqc_burst()
3840 value = 0x00; in stv090x_send_diseqc_burst()
3843 value = 0xFF; in stv090x_send_diseqc_burst()
3848 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3850 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 0); in stv090x_send_diseqc_burst()
3851 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3855 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3863 if (STV090x_WRITE_DEMOD(state, DISTXDATA, value) < 0) in stv090x_send_diseqc_burst()
3867 STV090x_SETFIELD_Px(reg, DIS_PRECHARGE_FIELD, 0); in stv090x_send_diseqc_burst()
3868 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3871 i = 0; in stv090x_send_diseqc_burst()
3880 return 0; in stv090x_send_diseqc_burst()
3889 u32 reg = 0, i = 0, rx_end = 0; in stv090x_recv_slave_reply()
3900 for (i = 0; i < reply->msg_len; i++) in stv090x_recv_slave_reply()
3904 return 0; in stv090x_recv_slave_reply()
3911 u8 full_standby = 0; in stv090x_sleep()
3913 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_sleep()
3917 if (state->config->tuner_sleep(fe) < 0) in stv090x_sleep()
3921 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_sleep()
3934 STV090x_SETFIELD(reg, ADC1_PON_FIELD, 0); in stv090x_sleep()
3935 if (stv090x_write_reg(state, STV090x_TSTTNR1, reg) < 0) in stv090x_sleep()
3939 STV090x_SETFIELD(reg, DISEQC1_PON_FIELD, 0); in stv090x_sleep()
3940 if (stv090x_write_reg(state, STV090x_TSTTNR2, reg) < 0) in stv090x_sleep()
3946 if (STV090x_GETFIELD(reg, ADC2_PON_FIELD) == 0) in stv090x_sleep()
3959 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_sleep()
3970 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_sleep()
3977 STV090x_SETFIELD(reg, ADC2_PON_FIELD, 0); in stv090x_sleep()
3978 if (stv090x_write_reg(state, STV090x_TSTTNR3, reg) < 0) in stv090x_sleep()
3982 STV090x_SETFIELD(reg, DISEQC2_PON_FIELD, 0); in stv090x_sleep()
3983 if (stv090x_write_reg(state, STV090x_TSTTNR4, reg) < 0) in stv090x_sleep()
3989 if (STV090x_GETFIELD(reg, ADC1_PON_FIELD) == 0) in stv090x_sleep()
4002 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_sleep()
4013 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_sleep()
4025 STV090x_SETFIELD(reg, STANDBY_FIELD, 0x01); in stv090x_sleep()
4026 if (stv090x_write_reg(state, STV090x_SYNTCTRL, reg) < 0) in stv090x_sleep()
4031 return 0; in stv090x_sleep()
4034 stv090x_i2c_gate_ctrl(state, 0); in stv090x_sleep()
4056 STV090x_SETFIELD(reg, STANDBY_FIELD, 0x00); in stv090x_wakeup()
4057 if (stv090x_write_reg(state, STV090x_SYNTCTRL, reg) < 0) in stv090x_wakeup()
4065 if (stv090x_write_reg(state, STV090x_TSTTNR1, reg) < 0) in stv090x_wakeup()
4070 if (stv090x_write_reg(state, STV090x_TSTTNR2, reg) < 0) in stv090x_wakeup()
4076 STV090x_SETFIELD(reg, STOP_CLKPKDT1_FIELD, 0); in stv090x_wakeup()
4078 STV090x_SETFIELD(reg, STOP_CLKADCI1_FIELD, 0); in stv090x_wakeup()
4080 STV090x_SETFIELD(reg, STOP_CLKFEC_FIELD, 0); in stv090x_wakeup()
4081 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_wakeup()
4085 STV090x_SETFIELD(reg, STOP_CLKSAMP1_FIELD, 0); in stv090x_wakeup()
4087 STV090x_SETFIELD(reg, STOP_CLKVIT1_FIELD, 0); in stv090x_wakeup()
4089 STV090x_SETFIELD(reg, STOP_CLKTS_FIELD, 0); in stv090x_wakeup()
4090 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_wakeup()
4098 if (stv090x_write_reg(state, STV090x_TSTTNR3, reg) < 0) in stv090x_wakeup()
4103 if (stv090x_write_reg(state, STV090x_TSTTNR4, reg) < 0) in stv090x_wakeup()
4109 STV090x_SETFIELD(reg, STOP_CLKPKDT2_FIELD, 0); in stv090x_wakeup()
4111 STV090x_SETFIELD(reg, STOP_CLKADCI2_FIELD, 0); in stv090x_wakeup()
4113 STV090x_SETFIELD(reg, STOP_CLKFEC_FIELD, 0); in stv090x_wakeup()
4114 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_wakeup()
4118 STV090x_SETFIELD(reg, STOP_CLKSAMP2_FIELD, 0); in stv090x_wakeup()
4120 STV090x_SETFIELD(reg, STOP_CLKVIT2_FIELD, 0); in stv090x_wakeup()
4122 STV090x_SETFIELD(reg, STOP_CLKTS_FIELD, 0); in stv090x_wakeup()
4123 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_wakeup()
4133 return 0; in stv090x_wakeup()
4145 if (state->internal->num_used <= 0) { in stv090x_release()
4158 u32 reg = 0; in stv090x_ldpc_mode()
4167 if (stv090x_write_reg(state, STV090x_GENCFG, 0x1d) < 0) in stv090x_ldpc_mode()
4173 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x1); in stv090x_ldpc_mode()
4174 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4176 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x0); in stv090x_ldpc_mode()
4177 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4180 if (STV090x_WRITE_DEMOD(state, MODCODLST0, 0xff) < 0) in stv090x_ldpc_mode()
4182 if (STV090x_WRITE_DEMOD(state, MODCODLST1, 0xff) < 0) in stv090x_ldpc_mode()
4184 if (STV090x_WRITE_DEMOD(state, MODCODLST2, 0xff) < 0) in stv090x_ldpc_mode()
4186 if (STV090x_WRITE_DEMOD(state, MODCODLST3, 0xff) < 0) in stv090x_ldpc_mode()
4188 if (STV090x_WRITE_DEMOD(state, MODCODLST4, 0xff) < 0) in stv090x_ldpc_mode()
4190 if (STV090x_WRITE_DEMOD(state, MODCODLST5, 0xff) < 0) in stv090x_ldpc_mode()
4192 if (STV090x_WRITE_DEMOD(state, MODCODLST6, 0xff) < 0) in stv090x_ldpc_mode()
4195 if (STV090x_WRITE_DEMOD(state, MODCODLST7, 0xcc) < 0) in stv090x_ldpc_mode()
4197 if (STV090x_WRITE_DEMOD(state, MODCODLST8, 0xcc) < 0) in stv090x_ldpc_mode()
4199 if (STV090x_WRITE_DEMOD(state, MODCODLST9, 0xcc) < 0) in stv090x_ldpc_mode()
4201 if (STV090x_WRITE_DEMOD(state, MODCODLSTA, 0xcc) < 0) in stv090x_ldpc_mode()
4203 if (STV090x_WRITE_DEMOD(state, MODCODLSTB, 0xcc) < 0) in stv090x_ldpc_mode()
4205 if (STV090x_WRITE_DEMOD(state, MODCODLSTC, 0xcc) < 0) in stv090x_ldpc_mode()
4207 if (STV090x_WRITE_DEMOD(state, MODCODLSTD, 0xcc) < 0) in stv090x_ldpc_mode()
4210 if (STV090x_WRITE_DEMOD(state, MODCODLSTE, 0xff) < 0) in stv090x_ldpc_mode()
4212 if (STV090x_WRITE_DEMOD(state, MODCODLSTF, 0xcf) < 0) in stv090x_ldpc_mode()
4218 if (stv090x_stop_modcod(state) < 0) in stv090x_ldpc_mode()
4220 if (stv090x_activate_modcod_single(state) < 0) in stv090x_ldpc_mode()
4224 if (stv090x_write_reg(state, STV090x_GENCFG, 0x06) < 0) /* path 2 */ in stv090x_ldpc_mode()
4227 if (stv090x_write_reg(state, STV090x_GENCFG, 0x04) < 0) /* path 1 */ in stv090x_ldpc_mode()
4232 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x1); in stv090x_ldpc_mode()
4233 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4235 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x0); in stv090x_ldpc_mode()
4236 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4240 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0x01); in stv090x_ldpc_mode()
4241 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_ldpc_mode()
4243 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0x00); in stv090x_ldpc_mode()
4244 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_ldpc_mode()
4249 return 0; in stv090x_ldpc_mode()
4281 if (stv090x_write_reg(state, STV090x_NCOARSE, reg) < 0) in stv090x_set_mclk()
4288 if (STV090x_WRITE_DEMOD(state, F22TX, div) < 0) in stv090x_set_mclk()
4290 if (STV090x_WRITE_DEMOD(state, F22RX, div) < 0) in stv090x_set_mclk()
4293 return 0; in stv090x_set_mclk()
4303 if (state->internal->dev_ver >= 0x20) { in stv0900_set_tspath()
4311 stv090x_write_reg(state, STV090x_TSGENERAL, 0x00); in stv0900_set_tspath()
4316 if (stv090x_write_reg(state, STV090x_TSGENERAL, 0x06) < 0) /* Mux'd stream mode */ in stv0900_set_tspath()
4320 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4324 if (stv090x_write_reg(state, STV090x_P2_TSCFGM, reg) < 0) in stv0900_set_tspath()
4326 if (stv090x_write_reg(state, STV090x_P1_TSSPEED, 0x14) < 0) in stv0900_set_tspath()
4328 if (stv090x_write_reg(state, STV090x_P2_TSSPEED, 0x28) < 0) in stv0900_set_tspath()
4341 if (stv090x_write_reg(state, STV090x_TSGENERAL, 0x0c) < 0) in stv0900_set_tspath()
4347 if (stv090x_write_reg(state, STV090x_TSGENERAL, 0x0a) < 0) in stv0900_set_tspath()
4361 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x10); in stv0900_set_tspath()
4366 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x16); in stv0900_set_tspath()
4369 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4372 STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 0); in stv0900_set_tspath()
4373 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4375 if (stv090x_write_reg(state, STV090x_P1_TSSPEED, 0x14) < 0) in stv0900_set_tspath()
4377 if (stv090x_write_reg(state, STV090x_P2_TSSPEED, 0x28) < 0) in stv0900_set_tspath()
4390 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x14); in stv0900_set_tspath()
4395 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x12); in stv0900_set_tspath()
4406 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4407 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4408 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4415 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4416 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4417 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4424 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4425 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4426 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4433 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4434 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4435 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4447 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4448 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4449 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4456 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4457 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4458 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4465 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4466 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4467 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4474 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4475 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4476 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4484 if (state->config->ts1_clk > 0) { in stv0900_set_tspath()
4493 if (speed < 0x08) in stv0900_set_tspath()
4494 speed = 0x08; in stv0900_set_tspath()
4495 if (speed > 0xFF) in stv0900_set_tspath()
4496 speed = 0xFF; in stv0900_set_tspath()
4502 if (speed < 0x20) in stv0900_set_tspath()
4503 speed = 0x20; in stv0900_set_tspath()
4504 if (speed > 0xFF) in stv0900_set_tspath()
4505 speed = 0xFF; in stv0900_set_tspath()
4510 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4512 if (stv090x_write_reg(state, STV090x_P1_TSSPEED, speed) < 0) in stv0900_set_tspath()
4516 if (state->config->ts2_clk > 0) { in stv0900_set_tspath()
4525 if (speed < 0x08) in stv0900_set_tspath()
4526 speed = 0x08; in stv0900_set_tspath()
4527 if (speed > 0xFF) in stv0900_set_tspath()
4528 speed = 0xFF; in stv0900_set_tspath()
4534 if (speed < 0x20) in stv0900_set_tspath()
4535 speed = 0x20; in stv0900_set_tspath()
4536 if (speed > 0xFF) in stv0900_set_tspath()
4537 speed = 0xFF; in stv0900_set_tspath()
4542 if (stv090x_write_reg(state, STV090x_P2_TSCFGM, reg) < 0) in stv0900_set_tspath()
4544 if (stv090x_write_reg(state, STV090x_P2_TSSPEED, speed) < 0) in stv0900_set_tspath()
4549 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x01); in stv0900_set_tspath()
4550 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4552 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x00); in stv0900_set_tspath()
4553 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4557 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x01); in stv0900_set_tspath()
4558 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4560 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x00); in stv0900_set_tspath()
4561 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4564 return 0; in stv0900_set_tspath()
4574 if (state->internal->dev_ver >= 0x20) { in stv0903_set_tspath()
4578 stv090x_write_reg(state, STV090x_TSGENERAL, 0x00); in stv0903_set_tspath()
4584 stv090x_write_reg(state, STV090x_TSGENERAL, 0x0c); in stv0903_set_tspath()
4591 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x10); in stv0903_set_tspath()
4597 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x14); in stv0903_set_tspath()
4605 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0903_set_tspath()
4606 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0903_set_tspath()
4607 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4613 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0903_set_tspath()
4614 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0903_set_tspath()
4615 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4621 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0903_set_tspath()
4622 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0903_set_tspath()
4623 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4629 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0903_set_tspath()
4630 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0903_set_tspath()
4631 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4639 if (state->config->ts1_clk > 0) { in stv0903_set_tspath()
4648 if (speed < 0x08) in stv0903_set_tspath()
4649 speed = 0x08; in stv0903_set_tspath()
4650 if (speed > 0xFF) in stv0903_set_tspath()
4651 speed = 0xFF; in stv0903_set_tspath()
4657 if (speed < 0x20) in stv0903_set_tspath()
4658 speed = 0x20; in stv0903_set_tspath()
4659 if (speed > 0xFF) in stv0903_set_tspath()
4660 speed = 0xFF; in stv0903_set_tspath()
4665 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0903_set_tspath()
4667 if (stv090x_write_reg(state, STV090x_P1_TSSPEED, speed) < 0) in stv0903_set_tspath()
4672 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x01); in stv0903_set_tspath()
4673 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4675 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x00); in stv0903_set_tspath()
4676 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4679 return 0; in stv0903_set_tspath()
4691 if (state->internal->mclk == 0) { in stv090x_init()
4695 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_init()
4699 if (config->tuner_init(fe) < 0) in stv090x_init()
4703 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_init()
4709 0x20 | config->clk_mode) < 0) in stv090x_init()
4714 if (stv090x_wakeup(fe) < 0) { in stv090x_init()
4719 if (stv090x_ldpc_mode(state, state->demod_mode) < 0) in stv090x_init()
4724 if (STV090x_WRITE_DEMOD(state, TNRCFG2, reg) < 0) in stv090x_init()
4728 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_init()
4731 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_init()
4735 if (config->tuner_set_mode(fe, TUNER_WAKE) < 0) in stv090x_init()
4740 if (config->tuner_init(fe) < 0) in stv090x_init()
4744 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_init()
4748 if (stv0900_set_tspath(state) < 0) in stv090x_init()
4751 if (stv0903_set_tspath(state) < 0) in stv090x_init()
4755 return 0; in stv090x_init()
4758 stv090x_i2c_gate_ctrl(state, 0); in stv090x_init()
4770 unsigned long t1_size = 0, t2_size = 0; in stv090x_setup()
4771 u32 reg = 0; in stv090x_setup()
4792 if (stv090x_write_reg(state, STV090x_P1_DMDISTATE, 0x5c) < 0) in stv090x_setup()
4795 if (stv090x_write_reg(state, STV090x_P2_DMDISTATE, 0x5c) < 0) in stv090x_setup()
4801 if (stv090x_write_reg(state, STV090x_P1_TNRCFG, 0x6c) < 0) in stv090x_setup()
4804 if (stv090x_write_reg(state, STV090x_P2_TNRCFG, 0x6c) < 0) in stv090x_setup()
4809 if (stv090x_write_reg(state, STV090x_P1_I2CRPT, reg) < 0) in stv090x_setup()
4812 if (stv090x_write_reg(state, STV090x_P2_I2CRPT, reg) < 0) in stv090x_setup()
4815 if (stv090x_write_reg(state, STV090x_NCOARSE, 0x13) < 0) /* set PLL divider */ in stv090x_setup()
4818 if (stv090x_write_reg(state, STV090x_I2CCFG, 0x08) < 0) /* 1/41 oversampling */ in stv090x_setup()
4820 if (stv090x_write_reg(state, STV090x_SYNTCTRL, 0x20 | config->clk_mode) < 0) /* enable PLL */ in stv090x_setup()
4826 for (i = 0; i < t1_size; i++) { in stv090x_setup()
4827 if (stv090x_write_reg(state, stv090x_initval[i].addr, stv090x_initval[i].data) < 0) in stv090x_setup()
4832 if (state->internal->dev_ver >= 0x20) { in stv090x_setup()
4833 if (stv090x_write_reg(state, STV090x_TSGENERAL, 0x0c) < 0) in stv090x_setup()
4838 for (i = 0; i < t2_size; i++) { in stv090x_setup()
4839 if (stv090x_write_reg(state, stv090x_cut20_val[i].addr, stv090x_cut20_val[i].data) < 0) in stv090x_setup()
4843 } else if (state->internal->dev_ver < 0x20) { in stv090x_setup()
4844 dprintk(FE_ERROR, 1, "ERROR: Unsupported Cut: 0x%02x!", in stv090x_setup()
4848 } else if (state->internal->dev_ver > 0x30) { in stv090x_setup()
4850 dprintk(FE_ERROR, 1, "INFO: Cut: 0x%02x probably incomplete support!", in stv090x_setup()
4857 (config->adc1_range == STV090x_ADC_1Vpp) ? 0 : 1); in stv090x_setup()
4858 if (stv090x_write_reg(state, STV090x_TSTTNR1, reg) < 0) in stv090x_setup()
4864 (config->adc2_range == STV090x_ADC_1Vpp) ? 0 : 1); in stv090x_setup()
4865 if (stv090x_write_reg(state, STV090x_TSTTNR3, reg) < 0) in stv090x_setup()
4868 if (stv090x_write_reg(state, STV090x_TSTRES0, 0x80) < 0) in stv090x_setup()
4870 if (stv090x_write_reg(state, STV090x_TSTRES0, 0x00) < 0) in stv090x_setup()
4873 return 0; in stv090x_setup()
4883 u8 reg = 0; in stv090x_set_gpio()
4913 state->internal->mclk = 0; in stv090x_setup_compound()
4914 state->internal->dev_ver = 0; in stv090x_setup_compound()
4922 if (stv090x_setup(&state->frontend) < 0) { in stv090x_setup_compound()
4928 if (state->internal->dev_ver >= 0x30) in stv090x_setup_compound()
4937 dprintk(FE_ERROR, 1, "Probing %s demodulator(%d) Cut=0x%02x", in stv090x_setup_compound()
4942 return 0; in stv090x_setup_compound()
4996 int ret = 0; in stv090x_probe()
5028 return 0; in stv090x_probe()
5040 return 0; in stv090x_remove()
5047 int ret = 0; in stv090x_attach()
5079 {"stv090x", 0},