Lines Matching +full:0 +full:x3d

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()
762 state->config->tuner_i2c_lock(&state->frontend, 0); in stv090x_tuner_i2c_unlock()
787 if (STV090x_WRITE_DEMOD(state, I2CRPT, reg) < 0) in stv090x_i2c_gate_ctrl()
792 STV090x_SETFIELD_Px(reg, I2CT_ON_FIELD, 0); in stv090x_i2c_gate_ctrl()
793 if ((STV090x_WRITE_DEMOD(state, I2CRPT, reg)) < 0) in stv090x_i2c_gate_ctrl()
800 return 0; in stv090x_i2c_gate_ctrl()
869 if (STV090x_WRITE_DEMOD(state, SFRINIT1, (sym >> 8) & 0x7f) < 0) /* MSB */ in stv090x_set_srate()
871 if (STV090x_WRITE_DEMOD(state, SFRINIT0, (sym & 0xff)) < 0) /* LSB */ in stv090x_set_srate()
874 return 0; in stv090x_set_srate()
896 if (sym < 0x7fff) { in stv090x_set_max_srate()
897 if (STV090x_WRITE_DEMOD(state, SFRUP1, (sym >> 8) & 0x7f) < 0) /* MSB */ in stv090x_set_max_srate()
899 if (STV090x_WRITE_DEMOD(state, SFRUP0, sym & 0xff) < 0) /* LSB */ in stv090x_set_max_srate()
902 if (STV090x_WRITE_DEMOD(state, SFRUP1, 0x7f) < 0) /* MSB */ in stv090x_set_max_srate()
904 if (STV090x_WRITE_DEMOD(state, SFRUP0, 0xff) < 0) /* LSB */ in stv090x_set_max_srate()
908 return 0; in stv090x_set_max_srate()
930 if (STV090x_WRITE_DEMOD(state, SFRLOW1, ((sym >> 8) & 0x7f)) < 0) /* MSB */ in stv090x_set_min_srate()
932 if (STV090x_WRITE_DEMOD(state, SFRLOW0, (sym & 0xff)) < 0) /* LSB */ in stv090x_set_min_srate()
934 return 0; in stv090x_set_min_srate()
962 if (STV090x_WRITE_DEMOD(state, VTH12, 0x96) < 0) in stv090x_set_vit_thacq()
964 if (STV090x_WRITE_DEMOD(state, VTH23, 0x64) < 0) in stv090x_set_vit_thacq()
966 if (STV090x_WRITE_DEMOD(state, VTH34, 0x36) < 0) in stv090x_set_vit_thacq()
968 if (STV090x_WRITE_DEMOD(state, VTH56, 0x23) < 0) in stv090x_set_vit_thacq()
970 if (STV090x_WRITE_DEMOD(state, VTH67, 0x1e) < 0) in stv090x_set_vit_thacq()
972 if (STV090x_WRITE_DEMOD(state, VTH78, 0x19) < 0) in stv090x_set_vit_thacq()
974 return 0; in stv090x_set_vit_thacq()
982 if (STV090x_WRITE_DEMOD(state, VTH12, 0xd0) < 0) in stv090x_set_vit_thtracq()
984 if (STV090x_WRITE_DEMOD(state, VTH23, 0x7d) < 0) in stv090x_set_vit_thtracq()
986 if (STV090x_WRITE_DEMOD(state, VTH34, 0x53) < 0) in stv090x_set_vit_thtracq()
988 if (STV090x_WRITE_DEMOD(state, VTH56, 0x2f) < 0) in stv090x_set_vit_thtracq()
990 if (STV090x_WRITE_DEMOD(state, VTH67, 0x24) < 0) in stv090x_set_vit_thtracq()
992 if (STV090x_WRITE_DEMOD(state, VTH78, 0x1f) < 0) in stv090x_set_vit_thtracq()
994 return 0; in stv090x_set_vit_thtracq()
1004 if (STV090x_WRITE_DEMOD(state, FECM, 0x10) < 0) /* DVB-S and DVB-S2 */ in stv090x_set_viterbi()
1006 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x3f) < 0) /* all puncture rate */ in stv090x_set_viterbi()
1010 if (STV090x_WRITE_DEMOD(state, FECM, 0x00) < 0) /* disable DSS */ in stv090x_set_viterbi()
1014 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x01) < 0) in stv090x_set_viterbi()
1019 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x02) < 0) in stv090x_set_viterbi()
1024 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x04) < 0) in stv090x_set_viterbi()
1029 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x08) < 0) in stv090x_set_viterbi()
1034 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x20) < 0) in stv090x_set_viterbi()
1039 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x2f) < 0) /* all */ in stv090x_set_viterbi()
1045 if (STV090x_WRITE_DEMOD(state, FECM, 0x80) < 0) in stv090x_set_viterbi()
1049 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x01) < 0) in stv090x_set_viterbi()
1054 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x02) < 0) in stv090x_set_viterbi()
1059 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x10) < 0) in stv090x_set_viterbi()
1064 if (STV090x_WRITE_DEMOD(state, PRVIT, 0x13) < 0) /* 1/2, 2/3, 6/7 */ in stv090x_set_viterbi()
1072 return 0; in stv090x_set_viterbi()
1080 if (STV090x_WRITE_DEMOD(state, MODCODLST0, 0xff) < 0) in stv090x_stop_modcod()
1082 if (STV090x_WRITE_DEMOD(state, MODCODLST1, 0xff) < 0) in stv090x_stop_modcod()
1084 if (STV090x_WRITE_DEMOD(state, MODCODLST2, 0xff) < 0) in stv090x_stop_modcod()
1086 if (STV090x_WRITE_DEMOD(state, MODCODLST3, 0xff) < 0) in stv090x_stop_modcod()
1088 if (STV090x_WRITE_DEMOD(state, MODCODLST4, 0xff) < 0) in stv090x_stop_modcod()
1090 if (STV090x_WRITE_DEMOD(state, MODCODLST5, 0xff) < 0) in stv090x_stop_modcod()
1092 if (STV090x_WRITE_DEMOD(state, MODCODLST6, 0xff) < 0) in stv090x_stop_modcod()
1094 if (STV090x_WRITE_DEMOD(state, MODCODLST7, 0xff) < 0) in stv090x_stop_modcod()
1096 if (STV090x_WRITE_DEMOD(state, MODCODLST8, 0xff) < 0) in stv090x_stop_modcod()
1098 if (STV090x_WRITE_DEMOD(state, MODCODLST9, 0xff) < 0) in stv090x_stop_modcod()
1100 if (STV090x_WRITE_DEMOD(state, MODCODLSTA, 0xff) < 0) in stv090x_stop_modcod()
1102 if (STV090x_WRITE_DEMOD(state, MODCODLSTB, 0xff) < 0) in stv090x_stop_modcod()
1104 if (STV090x_WRITE_DEMOD(state, MODCODLSTC, 0xff) < 0) in stv090x_stop_modcod()
1106 if (STV090x_WRITE_DEMOD(state, MODCODLSTD, 0xff) < 0) in stv090x_stop_modcod()
1108 if (STV090x_WRITE_DEMOD(state, MODCODLSTE, 0xff) < 0) in stv090x_stop_modcod()
1110 if (STV090x_WRITE_DEMOD(state, MODCODLSTF, 0xff) < 0) in stv090x_stop_modcod()
1112 return 0; in stv090x_stop_modcod()
1120 if (STV090x_WRITE_DEMOD(state, MODCODLST0, 0xff) < 0) in stv090x_activate_modcod()
1122 if (STV090x_WRITE_DEMOD(state, MODCODLST1, 0xfc) < 0) in stv090x_activate_modcod()
1124 if (STV090x_WRITE_DEMOD(state, MODCODLST2, 0xcc) < 0) in stv090x_activate_modcod()
1126 if (STV090x_WRITE_DEMOD(state, MODCODLST3, 0xcc) < 0) in stv090x_activate_modcod()
1128 if (STV090x_WRITE_DEMOD(state, MODCODLST4, 0xcc) < 0) in stv090x_activate_modcod()
1130 if (STV090x_WRITE_DEMOD(state, MODCODLST5, 0xcc) < 0) in stv090x_activate_modcod()
1132 if (STV090x_WRITE_DEMOD(state, MODCODLST6, 0xcc) < 0) in stv090x_activate_modcod()
1134 if (STV090x_WRITE_DEMOD(state, MODCODLST7, 0xcc) < 0) in stv090x_activate_modcod()
1136 if (STV090x_WRITE_DEMOD(state, MODCODLST8, 0xcc) < 0) in stv090x_activate_modcod()
1138 if (STV090x_WRITE_DEMOD(state, MODCODLST9, 0xcc) < 0) in stv090x_activate_modcod()
1140 if (STV090x_WRITE_DEMOD(state, MODCODLSTA, 0xcc) < 0) in stv090x_activate_modcod()
1142 if (STV090x_WRITE_DEMOD(state, MODCODLSTB, 0xcc) < 0) in stv090x_activate_modcod()
1144 if (STV090x_WRITE_DEMOD(state, MODCODLSTC, 0xcc) < 0) in stv090x_activate_modcod()
1146 if (STV090x_WRITE_DEMOD(state, MODCODLSTD, 0xcc) < 0) in stv090x_activate_modcod()
1148 if (STV090x_WRITE_DEMOD(state, MODCODLSTE, 0xcc) < 0) in stv090x_activate_modcod()
1150 if (STV090x_WRITE_DEMOD(state, MODCODLSTF, 0xcf) < 0) in stv090x_activate_modcod()
1153 return 0; in stv090x_activate_modcod()
1162 if (STV090x_WRITE_DEMOD(state, MODCODLST0, 0xff) < 0) in stv090x_activate_modcod_single()
1164 if (STV090x_WRITE_DEMOD(state, MODCODLST1, 0xf0) < 0) in stv090x_activate_modcod_single()
1166 if (STV090x_WRITE_DEMOD(state, MODCODLST2, 0x00) < 0) in stv090x_activate_modcod_single()
1168 if (STV090x_WRITE_DEMOD(state, MODCODLST3, 0x00) < 0) in stv090x_activate_modcod_single()
1170 if (STV090x_WRITE_DEMOD(state, MODCODLST4, 0x00) < 0) in stv090x_activate_modcod_single()
1172 if (STV090x_WRITE_DEMOD(state, MODCODLST5, 0x00) < 0) in stv090x_activate_modcod_single()
1174 if (STV090x_WRITE_DEMOD(state, MODCODLST6, 0x00) < 0) in stv090x_activate_modcod_single()
1176 if (STV090x_WRITE_DEMOD(state, MODCODLST7, 0x00) < 0) in stv090x_activate_modcod_single()
1178 if (STV090x_WRITE_DEMOD(state, MODCODLST8, 0x00) < 0) in stv090x_activate_modcod_single()
1180 if (STV090x_WRITE_DEMOD(state, MODCODLST9, 0x00) < 0) in stv090x_activate_modcod_single()
1182 if (STV090x_WRITE_DEMOD(state, MODCODLSTA, 0x00) < 0) in stv090x_activate_modcod_single()
1184 if (STV090x_WRITE_DEMOD(state, MODCODLSTB, 0x00) < 0) in stv090x_activate_modcod_single()
1186 if (STV090x_WRITE_DEMOD(state, MODCODLSTC, 0x00) < 0) in stv090x_activate_modcod_single()
1188 if (STV090x_WRITE_DEMOD(state, MODCODLSTD, 0x00) < 0) in stv090x_activate_modcod_single()
1190 if (STV090x_WRITE_DEMOD(state, MODCODLSTE, 0x00) < 0) in stv090x_activate_modcod_single()
1192 if (STV090x_WRITE_DEMOD(state, MODCODLSTF, 0x0f) < 0) in stv090x_activate_modcod_single()
1195 return 0; in stv090x_activate_modcod_single()
1211 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_vitclk_ctl()
1220 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_vitclk_ctl()
1229 return 0; in stv090x_vitclk_ctl()
1238 if (state->internal->dev_ver >= 0x30) { in stv090x_dvbs_track_crl()
1241 if (STV090x_WRITE_DEMOD(state, ACLC, 0x2b) < 0) in stv090x_dvbs_track_crl()
1243 if (STV090x_WRITE_DEMOD(state, BCLC, 0x1a) < 0) in stv090x_dvbs_track_crl()
1246 if (STV090x_WRITE_DEMOD(state, ACLC, 0x0c) < 0) in stv090x_dvbs_track_crl()
1248 if (STV090x_WRITE_DEMOD(state, BCLC, 0x1b) < 0) in stv090x_dvbs_track_crl()
1251 if (STV090x_WRITE_DEMOD(state, ACLC, 0x2c) < 0) in stv090x_dvbs_track_crl()
1253 if (STV090x_WRITE_DEMOD(state, BCLC, 0x1c) < 0) in stv090x_dvbs_track_crl()
1259 if (STV090x_WRITE_DEMOD(state, ACLC, 0x1a) < 0) in stv090x_dvbs_track_crl()
1261 if (STV090x_WRITE_DEMOD(state, BCLC, 0x09) < 0) in stv090x_dvbs_track_crl()
1264 return 0; in stv090x_dvbs_track_crl()
1279 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_delivery_search()
1280 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1286 if (stv090x_vitclk_ctl(state, 0) < 0) in stv090x_delivery_search()
1289 if (stv090x_dvbs_track_crl(state) < 0) in stv090x_delivery_search()
1292 if (STV090x_WRITE_DEMOD(state, CAR2CFG, 0x22) < 0) /* disable DVB-S2 */ in stv090x_delivery_search()
1295 if (stv090x_set_vit_thacq(state) < 0) in stv090x_delivery_search()
1297 if (stv090x_set_viterbi(state) < 0) in stv090x_delivery_search()
1303 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 0); in stv090x_delivery_search()
1304 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_delivery_search()
1305 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1309 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1312 if (stv090x_vitclk_ctl(state, 1) < 0) in stv090x_delivery_search()
1315 if (STV090x_WRITE_DEMOD(state, ACLC, 0x1a) < 0) /* stop DVB-S CR loop */ in stv090x_delivery_search()
1317 if (STV090x_WRITE_DEMOD(state, BCLC, 0x09) < 0) in stv090x_delivery_search()
1320 if (state->internal->dev_ver <= 0x20) { in stv090x_delivery_search()
1322 if (STV090x_WRITE_DEMOD(state, CAR2CFG, 0x26) < 0) in stv090x_delivery_search()
1326 if (STV090x_WRITE_DEMOD(state, CAR2CFG, 0x66) < 0) in stv090x_delivery_search()
1332 if (stv090x_activate_modcod(state) < 0) in stv090x_delivery_search()
1339 if (stv090x_activate_modcod_single(state) < 0) in stv090x_delivery_search()
1343 if (stv090x_set_vit_thtracq(state) < 0) in stv090x_delivery_search()
1351 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 0); in stv090x_delivery_search()
1352 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_delivery_search()
1353 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1357 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1360 if (stv090x_vitclk_ctl(state, 0) < 0) in stv090x_delivery_search()
1363 if (stv090x_dvbs_track_crl(state) < 0) in stv090x_delivery_search()
1366 if (state->internal->dev_ver <= 0x20) { in stv090x_delivery_search()
1368 if (STV090x_WRITE_DEMOD(state, CAR2CFG, 0x26) < 0) in stv090x_delivery_search()
1372 if (STV090x_WRITE_DEMOD(state, CAR2CFG, 0x66) < 0) in stv090x_delivery_search()
1378 if (stv090x_activate_modcod(state) < 0) in stv090x_delivery_search()
1385 if (stv090x_activate_modcod_single(state) < 0) in stv090x_delivery_search()
1389 if (stv090x_set_vit_thacq(state) < 0) in stv090x_delivery_search()
1392 if (stv090x_set_viterbi(state) < 0) in stv090x_delivery_search()
1396 return 0; in stv090x_delivery_search()
1409 STV090x_SETFIELD_Px(reg, I2C_DEMOD_MODE_FIELD, 0x1f); in stv090x_start_search()
1410 if (STV090x_WRITE_DEMOD(state, DMDISTATE, reg) < 0) in stv090x_start_search()
1413 if (state->internal->dev_ver <= 0x20) { in stv090x_start_search()
1415 if (STV090x_WRITE_DEMOD(state, CARCFG, 0x44) < 0) in stv090x_start_search()
1417 if (STV090x_WRITE_DEMOD(state, CFRUP1, 0x0f) < 0) in stv090x_start_search()
1419 if (STV090x_WRITE_DEMOD(state, CFRUP0, 0xff) < 0) in stv090x_start_search()
1421 if (STV090x_WRITE_DEMOD(state, CFRLOW1, 0xf0) < 0) in stv090x_start_search()
1423 if (STV090x_WRITE_DEMOD(state, CFRLOW0, 0x00) < 0) in stv090x_start_search()
1427 if (STV090x_WRITE_DEMOD(state, RTCS2, 0x68) < 0) in stv090x_start_search()
1432 if (STV090x_WRITE_DEMOD(state, CARCFG, 0xc4) < 0) in stv090x_start_search()
1435 if (STV090x_WRITE_DEMOD(state, RTCS2, 0x44) < 0) in stv090x_start_search()
1442 STV090x_WRITE_DEMOD(state, RTCS2, 0x68); in stv090x_start_search()
1445 STV090x_WRITE_DEMOD(state, RTCS2, 0x44); in stv090x_start_search()
1449 STV090x_WRITE_DEMOD(state, CARCFG, 0x46); in stv090x_start_search()
1471 if (STV090x_WRITE_DEMOD(state, CFRUP1, MSB(freq)) < 0) in stv090x_start_search()
1473 if (STV090x_WRITE_DEMOD(state, CFRUP0, LSB(freq)) < 0) in stv090x_start_search()
1478 if (STV090x_WRITE_DEMOD(state, CFRLOW1, MSB(freq)) < 0) in stv090x_start_search()
1480 if (STV090x_WRITE_DEMOD(state, CFRLOW0, LSB(freq)) < 0) in stv090x_start_search()
1485 if (STV090x_WRITE_DEMOD(state, CFRINIT1, 0) < 0) in stv090x_start_search()
1487 if (STV090x_WRITE_DEMOD(state, CFRINIT0, 0) < 0) in stv090x_start_search()
1490 if (state->internal->dev_ver >= 0x20) { in stv090x_start_search()
1491 if (STV090x_WRITE_DEMOD(state, EQUALCFG, 0x41) < 0) in stv090x_start_search()
1493 if (STV090x_WRITE_DEMOD(state, FFECFG, 0x41) < 0) in stv090x_start_search()
1500 if (STV090x_WRITE_DEMOD(state, VITSCALE, 0x82) < 0) in stv090x_start_search()
1502 if (STV090x_WRITE_DEMOD(state, VAVSRVIT, 0x00) < 0) in stv090x_start_search()
1507 if (STV090x_WRITE_DEMOD(state, SFRSTEP, 0x00) < 0) in stv090x_start_search()
1509 if (STV090x_WRITE_DEMOD(state, TMGTHRISE, 0xe0) < 0) in stv090x_start_search()
1511 if (STV090x_WRITE_DEMOD(state, TMGTHFALL, 0xc0) < 0) in stv090x_start_search()
1515 STV090x_SETFIELD_Px(reg, SCAN_ENABLE_FIELD, 0); in stv090x_start_search()
1516 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0); in stv090x_start_search()
1517 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_start_search()
1520 STV090x_SETFIELD_Px(reg, S1S2_SEQUENTIAL_FIELD, 0x0); in stv090x_start_search()
1521 if (STV090x_WRITE_DEMOD(state, DMDCFG2, reg) < 0) in stv090x_start_search()
1524 if (STV090x_WRITE_DEMOD(state, RTC, 0x88) < 0) in stv090x_start_search()
1527 if (state->internal->dev_ver >= 0x20) { in stv090x_start_search()
1530 if (state->internal->dev_ver <= 0x20) { in stv090x_start_search()
1532 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x39) < 0) in stv090x_start_search()
1536 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x89) < 0) in stv090x_start_search()
1539 if (STV090x_WRITE_DEMOD(state, CARHDR, 0x40) < 0) in stv090x_start_search()
1542 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x4c) < 0) in stv090x_start_search()
1544 if (STV090x_WRITE_DEMOD(state, CARHDR, 0x20) < 0) in stv090x_start_search()
1547 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x4b) < 0) in stv090x_start_search()
1549 if (STV090x_WRITE_DEMOD(state, CARHDR, 0x20) < 0) in stv090x_start_search()
1554 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0xef) < 0) in stv090x_start_search()
1557 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0xed) < 0) in stv090x_start_search()
1567 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_start_search()
1569 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x18) < 0) in stv090x_start_search()
1575 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_start_search()
1577 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x15) < 0) in stv090x_start_search()
1584 return 0; in stv090x_start_search()
1592 u32 agc2_min = 0xffff, agc2 = 0, freq_init, freq_step, reg; in stv090x_get_agc2_min_level()
1595 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x38) < 0) in stv090x_get_agc2_min_level()
1598 STV090x_SETFIELD_Px(reg, SCAN_ENABLE_FIELD, 0); in stv090x_get_agc2_min_level()
1599 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0); in stv090x_get_agc2_min_level()
1600 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_get_agc2_min_level()
1603 if (STV090x_WRITE_DEMOD(state, SFRUP1, 0x83) < 0) /* SR = 65 Msps Max */ in stv090x_get_agc2_min_level()
1605 if (STV090x_WRITE_DEMOD(state, SFRUP0, 0xc0) < 0) in stv090x_get_agc2_min_level()
1607 if (STV090x_WRITE_DEMOD(state, SFRLOW1, 0x82) < 0) /* SR= 400 ksps Min */ in stv090x_get_agc2_min_level()
1609 if (STV090x_WRITE_DEMOD(state, SFRLOW0, 0xa0) < 0) in stv090x_get_agc2_min_level()
1611 if (STV090x_WRITE_DEMOD(state, DMDTOM, 0x00) < 0) /* stop acq @ coarse carrier state */ in stv090x_get_agc2_min_level()
1613 if (stv090x_set_srate(state, 1000000) < 0) in stv090x_get_agc2_min_level()
1617 if (steps <= 0) in stv090x_get_agc2_min_level()
1622 freq_init = 0; in stv090x_get_agc2_min_level()
1624 for (i = 0; i < steps; i++) { in stv090x_get_agc2_min_level()
1625 if (dir > 0) in stv090x_get_agc2_min_level()
1632 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x5c) < 0) /* Demod RESET */ in stv090x_get_agc2_min_level()
1634 if (STV090x_WRITE_DEMOD(state, CFRINIT1, (freq_init >> 8) & 0xff) < 0) in stv090x_get_agc2_min_level()
1636 if (STV090x_WRITE_DEMOD(state, CFRINIT0, freq_init & 0xff) < 0) in stv090x_get_agc2_min_level()
1638 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x58) < 0) /* Demod RESET */ in stv090x_get_agc2_min_level()
1642 agc2 = 0; in stv090x_get_agc2_min_level()
1643 for (j = 0; j < 10; j++) { in stv090x_get_agc2_min_level()
1673 tmp_1 = clk % 0x10000; in stv090x_get_srate()
1674 tmp_2 = srate % 0x10000; in stv090x_get_srate()
1687 int tmg_lock = 0, i; in stv090x_srate_srch_coarse()
1688 s32 tmg_cpt = 0, dir = 1, steps, cur_step = 0, freq; in stv090x_srate_srch_coarse()
1689 u32 srate_coarse = 0, agc2 = 0, car_step = 1200, reg; in stv090x_srate_srch_coarse()
1692 if (state->internal->dev_ver >= 0x30) in stv090x_srate_srch_coarse()
1693 agc2th = 0x2e00; in stv090x_srate_srch_coarse()
1695 agc2th = 0x1f00; in stv090x_srate_srch_coarse()
1698 STV090x_SETFIELD_Px(reg, I2C_DEMOD_MODE_FIELD, 0x1f); /* Demod RESET */ in stv090x_srate_srch_coarse()
1699 if (STV090x_WRITE_DEMOD(state, DMDISTATE, reg) < 0) in stv090x_srate_srch_coarse()
1701 if (STV090x_WRITE_DEMOD(state, TMGCFG, 0x12) < 0) in stv090x_srate_srch_coarse()
1703 if (STV090x_WRITE_DEMOD(state, TMGCFG2, 0xc0) < 0) in stv090x_srate_srch_coarse()
1705 if (STV090x_WRITE_DEMOD(state, TMGTHRISE, 0xf0) < 0) in stv090x_srate_srch_coarse()
1707 if (STV090x_WRITE_DEMOD(state, TMGTHFALL, 0xe0) < 0) in stv090x_srate_srch_coarse()
1711 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0); in stv090x_srate_srch_coarse()
1712 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_srate_srch_coarse()
1715 if (STV090x_WRITE_DEMOD(state, SFRUP1, 0x83) < 0) in stv090x_srate_srch_coarse()
1717 if (STV090x_WRITE_DEMOD(state, SFRUP0, 0xc0) < 0) in stv090x_srate_srch_coarse()
1719 if (STV090x_WRITE_DEMOD(state, SFRLOW1, 0x82) < 0) in stv090x_srate_srch_coarse()
1721 if (STV090x_WRITE_DEMOD(state, SFRLOW0, 0xa0) < 0) in stv090x_srate_srch_coarse()
1723 if (STV090x_WRITE_DEMOD(state, DMDTOM, 0x00) < 0) in stv090x_srate_srch_coarse()
1725 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x50) < 0) in stv090x_srate_srch_coarse()
1728 if (state->internal->dev_ver >= 0x30) { in stv090x_srate_srch_coarse()
1729 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x99) < 0) in stv090x_srate_srch_coarse()
1731 if (STV090x_WRITE_DEMOD(state, SFRSTEP, 0x98) < 0) in stv090x_srate_srch_coarse()
1734 } else if (state->internal->dev_ver >= 0x20) { in stv090x_srate_srch_coarse()
1735 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x6a) < 0) in stv090x_srate_srch_coarse()
1737 if (STV090x_WRITE_DEMOD(state, SFRSTEP, 0x95) < 0) in stv090x_srate_srch_coarse()
1753 if (steps < 0) in stv090x_srate_srch_coarse()
1759 cur_step = 0; in stv090x_srate_srch_coarse()
1764 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x5f) < 0) /* Demod RESET */ in stv090x_srate_srch_coarse()
1766 if (STV090x_WRITE_DEMOD(state, CFRINIT1, 0x00) < 0) in stv090x_srate_srch_coarse()
1768 if (STV090x_WRITE_DEMOD(state, CFRINIT0, 0x00) < 0) in stv090x_srate_srch_coarse()
1770 if (STV090x_WRITE_DEMOD(state, SFRINIT1, 0x00) < 0) in stv090x_srate_srch_coarse()
1772 if (STV090x_WRITE_DEMOD(state, SFRINIT0, 0x00) < 0) in stv090x_srate_srch_coarse()
1775 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x40) < 0) in stv090x_srate_srch_coarse()
1778 for (i = 0; i < 10; i++) { in stv090x_srate_srch_coarse()
1793 if (dir > 0) in stv090x_srate_srch_coarse()
1799 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_srate_srch_coarse()
1803 if (state->config->tuner_set_frequency(fe, freq) < 0) in stv090x_srate_srch_coarse()
1808 if (state->config->tuner_set_bandwidth(fe, state->tuner_bw) < 0) in stv090x_srate_srch_coarse()
1812 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_srate_srch_coarse()
1817 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_srate_srch_coarse()
1821 if (state->config->tuner_get_status(fe, &reg) < 0) in stv090x_srate_srch_coarse()
1830 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_srate_srch_coarse()
1836 srate_coarse = 0; in stv090x_srate_srch_coarse()
1843 stv090x_i2c_gate_ctrl(state, 0); in stv090x_srate_srch_coarse()
1859 srate_coarse = 0; in stv090x_srate_srch_fine()
1861 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) /* Demod RESET */ in stv090x_srate_srch_fine()
1863 if (STV090x_WRITE_DEMOD(state, TMGCFG2, 0xc1) < 0) in stv090x_srate_srch_fine()
1865 if (STV090x_WRITE_DEMOD(state, TMGTHRISE, 0x20) < 0) in stv090x_srate_srch_fine()
1867 if (STV090x_WRITE_DEMOD(state, TMGTHFALL, 0x00) < 0) in stv090x_srate_srch_fine()
1869 if (STV090x_WRITE_DEMOD(state, TMGCFG, 0xd2) < 0) in stv090x_srate_srch_fine()
1872 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0x00); in stv090x_srate_srch_fine()
1873 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_srate_srch_fine()
1876 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x38) < 0) in stv090x_srate_srch_fine()
1879 if (state->internal->dev_ver >= 0x30) { in stv090x_srate_srch_fine()
1880 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x79) < 0) in stv090x_srate_srch_fine()
1882 } else if (state->internal->dev_ver >= 0x20) { in stv090x_srate_srch_fine()
1883 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x49) < 0) in stv090x_srate_srch_fine()
1891 if (STV090x_WRITE_DEMOD(state, SFRUP1, (sym >> 8) & 0x7f) < 0) in stv090x_srate_srch_fine()
1893 if (STV090x_WRITE_DEMOD(state, SFRUP0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1898 if (STV090x_WRITE_DEMOD(state, SFRLOW1, (sym >> 8) & 0x7f) < 0) in stv090x_srate_srch_fine()
1900 if (STV090x_WRITE_DEMOD(state, SFRLOW0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1904 if (STV090x_WRITE_DEMOD(state, SFRINIT1, (sym >> 8) & 0xff) < 0) in stv090x_srate_srch_fine()
1906 if (STV090x_WRITE_DEMOD(state, SFRINIT0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1912 if (STV090x_WRITE_DEMOD(state, SFRUP1, (sym >> 8) & 0x7f) < 0) in stv090x_srate_srch_fine()
1914 if (STV090x_WRITE_DEMOD(state, SFRUP0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1919 if (STV090x_WRITE_DEMOD(state, SFRLOW1, (sym >> 8) & 0x7f) < 0) in stv090x_srate_srch_fine()
1921 if (STV090x_WRITE_DEMOD(state, SFRLOW0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1925 if (STV090x_WRITE_DEMOD(state, SFRINIT1, (sym >> 8) & 0xff) < 0) in stv090x_srate_srch_fine()
1927 if (STV090x_WRITE_DEMOD(state, SFRINIT0, sym & 0xff) < 0) in stv090x_srate_srch_fine()
1930 if (STV090x_WRITE_DEMOD(state, DMDTOM, 0x20) < 0) in stv090x_srate_srch_fine()
1932 if (STV090x_WRITE_DEMOD(state, CFRINIT1, (freq_coarse >> 8) & 0xff) < 0) in stv090x_srate_srch_fine()
1934 if (STV090x_WRITE_DEMOD(state, CFRINIT0, freq_coarse & 0xff) < 0) in stv090x_srate_srch_fine()
1936 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x15) < 0) /* trigger acquisition */ in stv090x_srate_srch_fine()
1949 s32 timer = 0, lock = 0; in stv090x_get_dmdlock()
1958 case 0: /* searching */ in stv090x_get_dmdlock()
1962 lock = 0; in stv090x_get_dmdlock()
1986 int coarse_fail = 0; in stv090x_blind_search()
1995 lock = 0; in stv090x_blind_search()
1998 if (state->internal->dev_ver <= 0x20) { in stv090x_blind_search()
1999 if (STV090x_WRITE_DEMOD(state, CARCFG, 0xc4) < 0) in stv090x_blind_search()
2003 if (STV090x_WRITE_DEMOD(state, CARCFG, 0x06) < 0) in stv090x_blind_search()
2007 if (STV090x_WRITE_DEMOD(state, RTCS2, 0x44) < 0) in stv090x_blind_search()
2010 if (state->internal->dev_ver >= 0x20) { in stv090x_blind_search()
2011 if (STV090x_WRITE_DEMOD(state, EQUALCFG, 0x41) < 0) in stv090x_blind_search()
2013 if (STV090x_WRITE_DEMOD(state, FFECFG, 0x41) < 0) in stv090x_blind_search()
2015 if (STV090x_WRITE_DEMOD(state, VITSCALE, 0x82) < 0) in stv090x_blind_search()
2017 if (STV090x_WRITE_DEMOD(state, VAVSRVIT, 0x00) < 0) /* set viterbi hysteresis */ in stv090x_blind_search()
2023 if (STV090x_WRITE_DEMOD(state, KREFTMG, k_ref) < 0) in stv090x_blind_search()
2025 if (stv090x_srate_srch_coarse(state) != 0) { in stv090x_blind_search()
2027 if (srate_coarse != 0) { in stv090x_blind_search()
2032 lock = 0; in stv090x_blind_search()
2035 cpt_fail = 0; in stv090x_blind_search()
2036 agc2_ovflw = 0; in stv090x_blind_search()
2037 for (i = 0; i < 10; i++) { in stv090x_blind_search()
2040 if (agc2 >= 0xff00) in stv090x_blind_search()
2043 if ((STV090x_GETFIELD_Px(reg, CFR_OVERFLOW_FIELD) == 0x01) && in stv090x_blind_search()
2044 (STV090x_GETFIELD_Px(reg, DEMOD_DELOCK_FIELD) == 0x01)) in stv090x_blind_search()
2051 lock = 0; in stv090x_blind_search()
2067 s32 tmg_cpt = 0, i; in stv090x_chk_tmg()
2069 int tmg_lock = 0; in stv090x_chk_tmg()
2074 if (STV090x_WRITE_DEMOD(state, TMGTHRISE, 0x20) < 0) in stv090x_chk_tmg()
2076 if (STV090x_WRITE_DEMOD(state, TMGTHFALL, 0x00) < 0) in stv090x_chk_tmg()
2080 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0x00); /* stop carrier offset search */ in stv090x_chk_tmg()
2081 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_chk_tmg()
2083 if (STV090x_WRITE_DEMOD(state, RTC, 0x80) < 0) in stv090x_chk_tmg()
2086 if (STV090x_WRITE_DEMOD(state, RTCS2, 0x40) < 0) in stv090x_chk_tmg()
2088 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x00) < 0) in stv090x_chk_tmg()
2091 if (STV090x_WRITE_DEMOD(state, CFRINIT1, 0x00) < 0) /* set car ofset to 0 */ in stv090x_chk_tmg()
2093 if (STV090x_WRITE_DEMOD(state, CFRINIT0, 0x00) < 0) in stv090x_chk_tmg()
2095 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x65) < 0) in stv090x_chk_tmg()
2098 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x18) < 0) /* trigger acquisition */ in stv090x_chk_tmg()
2102 for (i = 0; i < 10; i++) { in stv090x_chk_tmg()
2111 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x38) < 0) in stv090x_chk_tmg()
2113 if (STV090x_WRITE_DEMOD(state, RTC, 0x88) < 0) /* DVB-S1 timing */ in stv090x_chk_tmg()
2115 if (STV090x_WRITE_DEMOD(state, RTCS2, 0x68) < 0) /* DVB-S2 timing */ in stv090x_chk_tmg()
2118 if (STV090x_WRITE_DEMOD(state, CARFREQ, freq) < 0) in stv090x_chk_tmg()
2120 if (STV090x_WRITE_DEMOD(state, TMGTHRISE, tmg_thh) < 0) in stv090x_chk_tmg()
2122 if (STV090x_WRITE_DEMOD(state, TMGTHFALL, tmg_thl) < 0) in stv090x_chk_tmg()
2151 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_get_coldlock()
2153 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x15) < 0) in stv090x_get_coldlock()
2157 return 0; in stv090x_get_coldlock()
2172 if (steps < 0) in stv090x_get_coldlock()
2183 if (dir > 0) in stv090x_get_coldlock()
2189 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_get_coldlock()
2193 if (state->config->tuner_set_frequency(fe, freq) < 0) in stv090x_get_coldlock()
2198 if (state->config->tuner_set_bandwidth(fe, state->tuner_bw) < 0) in stv090x_get_coldlock()
2202 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_get_coldlock()
2207 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_get_coldlock()
2211 if (state->config->tuner_get_status(fe, &reg) < 0) in stv090x_get_coldlock()
2219 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_get_coldlock()
2222 STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1c); in stv090x_get_coldlock()
2223 if (STV090x_WRITE_DEMOD(state, CFRINIT1, 0x00) < 0) in stv090x_get_coldlock()
2225 if (STV090x_WRITE_DEMOD(state, CFRINIT0, 0x00) < 0) in stv090x_get_coldlock()
2227 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_get_coldlock()
2229 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x15) < 0) in stv090x_get_coldlock()
2240 stv090x_i2c_gate_ctrl(state, 0); in stv090x_get_coldlock()
2256 if (car_max > 0x4000) in stv090x_get_loop_params()
2257 car_max = 0x4000 ; /* maxcarrier should be<= +-1/4 Mclk */ in stv090x_get_loop_params()
2284 if ((inc > car_max) || (inc < 0)) in stv090x_get_loop_params()
2288 if (srate > 0) in stv090x_get_loop_params()
2291 if ((timeout > 100) || (timeout < 0)) in stv090x_get_loop_params()
2295 if ((steps_max > 100) || (steps_max < 0)) { in stv090x_get_loop_params()
2303 return 0; in stv090x_get_loop_params()
2323 if (car_max > 0x4000) in stv090x_chk_signal()
2324 car_max = 0x4000; in stv090x_chk_signal()
2326 if ((agc2 > 0x2000) || (offst_car > 2 * car_max) || (offst_car < -2 * car_max)) { in stv090x_chk_signal()
2330 no_signal = 0; in stv090x_chk_signal()
2339 int no_signal, lock = 0; in stv090x_search_car_loop()
2340 s32 cpt_step = 0, offst_freq, car_max; in stv090x_search_car_loop()
2347 if (car_max > 0x4000) in stv090x_search_car_loop()
2348 car_max = 0x4000; in stv090x_search_car_loop()
2351 offst_freq = 0; in stv090x_search_car_loop()
2356 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1c) < 0) in stv090x_search_car_loop()
2358 if (STV090x_WRITE_DEMOD(state, CFRINIT1, ((offst_freq / 256) & 0xff)) < 0) in stv090x_search_car_loop()
2360 if (STV090x_WRITE_DEMOD(state, CFRINIT0, offst_freq & 0xff) < 0) in stv090x_search_car_loop()
2362 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x18) < 0) in stv090x_search_car_loop()
2366 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0x1); /* stop DVB-S2 packet delin */ in stv090x_search_car_loop()
2367 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_search_car_loop()
2371 if (offst_freq >= 0) in stv090x_search_car_loop()
2391 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0); in stv090x_search_car_loop()
2392 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_search_car_loop()
2403 int no_signal, zigzag, lock = 0; in stv090x_sw_algo()
2416 if (state->internal->dev_ver >= 0x20) { in stv090x_sw_algo()
2417 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x3B) < 0) in stv090x_sw_algo()
2421 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, 0x49) < 0) in stv090x_sw_algo()
2423 zigzag = 0; in stv090x_sw_algo()
2427 if (state->internal->dev_ver >= 0x20) { in stv090x_sw_algo()
2428 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x79) < 0) in stv090x_sw_algo()
2432 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, 0x89) < 0) in stv090x_sw_algo()
2440 if (state->internal->dev_ver >= 0x20) { in stv090x_sw_algo()
2441 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x3b) < 0) in stv090x_sw_algo()
2443 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x79) < 0) in stv090x_sw_algo()
2447 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, 0xc9) < 0) in stv090x_sw_algo()
2449 zigzag = 0; in stv090x_sw_algo()
2453 trials = 0; in stv090x_sw_algo()
2462 if (state->internal->dev_ver >= 0x20) { in stv090x_sw_algo()
2463 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x49) < 0) in stv090x_sw_algo()
2465 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x9e) < 0) in stv090x_sw_algo()
2475 if (dvbs2_fly_wheel < 0xd) { /*if correct frames is decrementing */ in stv090x_sw_algo()
2480 if (dvbs2_fly_wheel < 0xd) { in stv090x_sw_algo()
2482 lock = 0; in stv090x_sw_algo()
2484 if (state->internal->dev_ver >= 0x20) { in stv090x_sw_algo()
2485 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x79) < 0) in stv090x_sw_algo()
2489 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, 0x89) < 0) in stv090x_sw_algo()
2538 tmp_1 = mclk % 0x1000; in stv090x_get_car_freq()
2539 tmp_2 = derot % 0x1000; in stv090x_get_car_freq()
2585 return 0; in stv090x_get_viterbi()
2594 s32 i = 0, offst_freq; in stv090x_get_sig_params()
2600 STV090x_WRITE_DEMOD(state, SFRSTEP, 0x5c); in stv090x_get_sig_params()
2601 while ((i <= 50) && (tmg != 0) && (tmg != 0xff)) { in stv090x_get_sig_params()
2609 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_get_sig_params()
2613 if (state->config->tuner_get_frequency(fe, &state->frequency) < 0) in stv090x_get_sig_params()
2617 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_get_sig_params()
2623 if (stv090x_get_viterbi(state) < 0) in stv090x_get_sig_params()
2628 state->pilots = STV090x_GETFIELD_Px(reg, DEMOD_TYPE_FIELD) & 0x01; in stv090x_get_sig_params()
2637 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_get_sig_params()
2641 if (state->config->tuner_get_frequency(fe, &state->frequency) < 0) in stv090x_get_sig_params()
2645 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_get_sig_params()
2660 stv090x_i2c_gate_ctrl(state, 0); in stv090x_get_sig_params()
2678 offst_tmg = ((s32) srate * 10) / ((s32) 0x1000000 / offst_tmg); in stv090x_get_tmgoffst()
2686 u8 aclc = 0x29; in stv090x_optimize_carloop()
2690 if (state->internal->dev_ver == 0x20) { in stv090x_optimize_carloop()
2702 i = 0; in stv090x_optimize_carloop()
2710 i = 0; in stv090x_optimize_carloop()
2715 i = 0; in stv090x_optimize_carloop()
2798 s32 index = 0; in stv090x_optimize_carloop_short()
2799 u8 aclc = 0x0b; in stv090x_optimize_carloop_short()
2804 index = 0; in stv090x_optimize_carloop_short()
2817 if (state->internal->dev_ver >= 0x30) { in stv090x_optimize_carloop_short()
2845 s32 srate, pilots, aclc, f_1, f_0, i = 0, blind_tune = 0; in stv090x_optimize_track()
2857 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_optimize_track()
2858 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
2863 STV090x_SETFIELD_Px(reg, MANUAL_SXROLLOFF_FIELD, 0x01); in stv090x_optimize_track()
2864 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_optimize_track()
2867 if (state->internal->dev_ver >= 0x30) { in stv090x_optimize_track()
2868 if (stv090x_get_viterbi(state) < 0) in stv090x_optimize_track()
2872 if (STV090x_WRITE_DEMOD(state, GAUSSR0, 0x98) < 0) in stv090x_optimize_track()
2874 if (STV090x_WRITE_DEMOD(state, CCIR0, 0x18) < 0) in stv090x_optimize_track()
2877 if (STV090x_WRITE_DEMOD(state, GAUSSR0, 0x18) < 0) in stv090x_optimize_track()
2879 if (STV090x_WRITE_DEMOD(state, CCIR0, 0x18) < 0) in stv090x_optimize_track()
2884 if (STV090x_WRITE_DEMOD(state, ERRCTRL1, 0x75) < 0) in stv090x_optimize_track()
2890 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 0); in stv090x_optimize_track()
2892 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
2894 if (state->internal->dev_ver >= 0x30) { in stv090x_optimize_track()
2895 if (STV090x_WRITE_DEMOD(state, ACLC, 0) < 0) in stv090x_optimize_track()
2897 if (STV090x_WRITE_DEMOD(state, BCLC, 0) < 0) in stv090x_optimize_track()
2903 pilots = STV090x_GETFIELD_Px(reg, DEMOD_TYPE_FIELD) & 0x01; in stv090x_optimize_track()
2908 if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, 0x2a) < 0) in stv090x_optimize_track()
2910 if (STV090x_WRITE_DEMOD(state, ACLC2S28, 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, ACLC2S216A, aclc) < 0) in stv090x_optimize_track()
2920 if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, 0x2a) < 0) in stv090x_optimize_track()
2922 if (STV090x_WRITE_DEMOD(state, ACLC2S232A, aclc) < 0) in stv090x_optimize_track()
2930 if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, 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, ACLC2S28, 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, ACLC2S216A, aclc) < 0) in stv090x_optimize_track()
2943 if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, 0x2a) < 0) in stv090x_optimize_track()
2945 if (STV090x_WRITE_DEMOD(state, ACLC2S232A, aclc) < 0) in stv090x_optimize_track()
2950 STV090x_WRITE_DEMOD(state, ERRCTRL1, 0x67); /* PER */ in stv090x_optimize_track()
2958 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
2968 STV090x_WRITE_DEMOD(state, SFRSTEP, 0x00); in stv090x_optimize_track()
2970 STV090x_SETFIELD_Px(reg, SCAN_ENABLE_FIELD, 0x00); in stv090x_optimize_track()
2971 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0x00); in stv090x_optimize_track()
2972 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
2974 if (STV090x_WRITE_DEMOD(state, TMGCFG2, 0xc1) < 0) in stv090x_optimize_track()
2977 if (stv090x_set_srate(state, srate) < 0) in stv090x_optimize_track()
2981 if (stv090x_dvbs_track_crl(state) < 0) in stv090x_optimize_track()
2985 if (state->internal->dev_ver >= 0x20) { in stv090x_optimize_track()
2990 if (STV090x_WRITE_DEMOD(state, VAVSRVIT, 0x0a) < 0) in stv090x_optimize_track()
2992 if (STV090x_WRITE_DEMOD(state, VITSCALE, 0x00) < 0) in stv090x_optimize_track()
2997 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x38) < 0) in stv090x_optimize_track()
3001 if (STV090x_WRITE_DEMOD(state, SFRUP1, 0x80) < 0) in stv090x_optimize_track()
3004 if (STV090x_WRITE_DEMOD(state, SFRLOW1, 0x80) < 0) in stv090x_optimize_track()
3007 if ((state->internal->dev_ver >= 0x20) || (blind_tune == 1) || in stv090x_optimize_track()
3010 if (STV090x_WRITE_DEMOD(state, CFRINIT1, f_1) < 0) in stv090x_optimize_track()
3012 if (STV090x_WRITE_DEMOD(state, CFRINIT0, f_0) < 0) in stv090x_optimize_track()
3016 if ((state->internal->dev_ver >= 0x20) || (blind_tune == 1)) { in stv090x_optimize_track()
3020 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_optimize_track()
3024 if (state->config->tuner_set_bandwidth(fe, state->tuner_bw) < 0) in stv090x_optimize_track()
3028 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_optimize_track()
3041 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_optimize_track()
3043 if (STV090x_WRITE_DEMOD(state, CFRINIT1, f_1) < 0) in stv090x_optimize_track()
3045 if (STV090x_WRITE_DEMOD(state, CFRINIT0, f_0) < 0) in stv090x_optimize_track()
3047 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x18) < 0) in stv090x_optimize_track()
3050 i = 0; in stv090x_optimize_track()
3054 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x1f) < 0) in stv090x_optimize_track()
3056 if (STV090x_WRITE_DEMOD(state, CFRINIT1, f_1) < 0) in stv090x_optimize_track()
3058 if (STV090x_WRITE_DEMOD(state, CFRINIT0, f_0) < 0) in stv090x_optimize_track()
3060 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x18) < 0) in stv090x_optimize_track()
3068 if (state->internal->dev_ver >= 0x20) { in stv090x_optimize_track()
3069 if (STV090x_WRITE_DEMOD(state, CARFREQ, 0x49) < 0) in stv090x_optimize_track()
3076 return 0; in stv090x_optimize_track()
3079 stv090x_i2c_gate_ctrl(state, 0); in stv090x_optimize_track()
3087 s32 timer = 0, lock = 0, stat; in stv090x_get_feclock()
3095 case 0: /* searching */ in stv090x_get_feclock()
3098 lock = 0; in stv090x_get_feclock()
3122 s32 timer = 0; in stv090x_get_lock()
3130 lock = 0; in stv090x_get_lock()
3147 if (state->internal->dev_ver <= 0x20) { in stv090x_set_s2rolloff()
3150 STV090x_SETFIELD_Px(reg, MANUAL_SXROLLOFF_FIELD, 0x00); in stv090x_set_s2rolloff()
3151 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_set_s2rolloff()
3156 STV090x_SETFIELD_Px(reg, MANUAL_S2ROLLOFF_FIELD, 0x00); in stv090x_set_s2rolloff()
3157 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_set_s2rolloff()
3160 return 0; in stv090x_set_s2rolloff()
3172 s32 agc1_power, power_iq = 0, i; in stv090x_algo()
3173 int lock = 0, low_sr = 0; in stv090x_algo()
3177 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3180 if (STV090x_WRITE_DEMOD(state, DMDISTATE, 0x5c) < 0) /* Demod stop */ in stv090x_algo()
3183 if (state->internal->dev_ver >= 0x20) { in stv090x_algo()
3185 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x9e) < 0) in stv090x_algo()
3188 if (STV090x_WRITE_DEMOD(state, CORRELABS, 0x82) < 0) in stv090x_algo()
3197 if (STV090x_WRITE_DEMOD(state, TMGCFG2, 0xc0) < 0) /* wider srate scan */ in stv090x_algo()
3199 if (STV090x_WRITE_DEMOD(state, CORRELMANT, 0x70) < 0) in stv090x_algo()
3201 if (stv090x_set_srate(state, 1000000) < 0) /* initial srate = 1Msps */ in stv090x_algo()
3205 if (STV090x_WRITE_DEMOD(state, DMDTOM, 0x20) < 0) in stv090x_algo()
3207 if (STV090x_WRITE_DEMOD(state, TMGCFG, 0xd2) < 0) in stv090x_algo()
3212 if (STV090x_WRITE_DEMOD(state, CORRELMANT, 0x63) < 0) in stv090x_algo()
3216 if (STV090x_WRITE_DEMOD(state, CORRELMANT, 0x70) < 0) in stv090x_algo()
3220 if (STV090x_WRITE_DEMOD(state, AGC2REF, 0x38) < 0) in stv090x_algo()
3223 if (state->internal->dev_ver >= 0x20) { in stv090x_algo()
3224 if (STV090x_WRITE_DEMOD(state, KREFTMG, 0x5a) < 0) in stv090x_algo()
3235 if (STV090x_WRITE_DEMOD(state, TMGCFG2, 0xc1) < 0) /* narrow srate scan */ in stv090x_algo()
3238 if (stv090x_set_srate(state, state->srate) < 0) in stv090x_algo()
3242 state->srate) < 0) in stv090x_algo()
3245 state->srate) < 0) in stv090x_algo()
3249 low_sr = 0; in stv090x_algo()
3255 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_algo()
3260 if (reg == 0) in stv090x_algo()
3262 if (state->config->tuner_set_bbgain(fe, reg) < 0) in stv090x_algo()
3267 if (state->config->tuner_set_frequency(fe, state->frequency) < 0) in stv090x_algo()
3272 if (state->config->tuner_set_bandwidth(fe, state->tuner_bw) < 0) in stv090x_algo()
3276 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_algo()
3282 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_algo()
3284 if (state->config->tuner_get_status(fe, &reg) < 0) in stv090x_algo()
3286 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_algo()
3301 if (agc1_power == 0) { in stv090x_algo()
3302 /* If AGC1 integrator value is 0 in stv090x_algo()
3305 for (i = 0; i < 5; i++) { in stv090x_algo()
3312 if ((agc1_power == 0) && (power_iq < STV090x_IQPOWER_THRESHOLD)) { in stv090x_algo()
3313 dprintk(FE_ERROR, 1, "No Signal: POWER_IQ=0x%02x", power_iq); in stv090x_algo()
3314 lock = 0; in stv090x_algo()
3320 if (state->internal->dev_ver <= 0x20) { in stv090x_algo()
3327 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_algo()
3330 if (stv090x_delivery_search(state) < 0) in stv090x_algo()
3334 if (stv090x_start_search(state) < 0) in stv090x_algo()
3364 if (state->internal->dev_ver >= 0x20) { in stv090x_algo()
3369 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0); /* release merger reset */ in stv090x_algo()
3370 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3376 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3379 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0); /* release merger reset */ in stv090x_algo()
3380 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3392 if (STV090x_WRITE_DEMOD(state, PDELCTRL2, reg) < 0) in stv090x_algo()
3396 STV090x_SETFIELD_Px(reg, RESET_UPKO_COUNT, 0); in stv090x_algo()
3397 if (STV090x_WRITE_DEMOD(state, PDELCTRL2, reg) < 0) in stv090x_algo()
3400 if (STV090x_WRITE_DEMOD(state, ERRCTRL1, 0x67) < 0) /* PER */ in stv090x_algo()
3403 if (STV090x_WRITE_DEMOD(state, ERRCTRL1, 0x75) < 0) in stv090x_algo()
3407 if (STV090x_WRITE_DEMOD(state, FBERCPT4, 0x00) < 0) in stv090x_algo()
3410 if (STV090x_WRITE_DEMOD(state, ERRCTRL2, 0xc1) < 0) in stv090x_algo()
3420 stv090x_i2c_gate_ctrl(state, 0); in stv090x_algo()
3429 if (STV090x_WRITE_DEMOD(state, PLROOT0, pls_code & 0xff) < 0) in stv090x_set_pls()
3431 if (STV090x_WRITE_DEMOD(state, PLROOT1, (pls_code >> 8) & 0xff) < 0) in stv090x_set_pls()
3433 if (STV090x_WRITE_DEMOD(state, PLROOT2, 0x04 | (pls_code >> 16)) < 0) in stv090x_set_pls()
3435 return 0; in stv090x_set_pls()
3445 if (mis < 0 || mis > 255) { in stv090x_set_mis()
3448 STV090x_SETFIELD_Px(reg, FILTER_EN_FIELD, 0x00); in stv090x_set_mis()
3449 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_set_mis()
3454 STV090x_SETFIELD_Px(reg, FILTER_EN_FIELD, 0x01); in stv090x_set_mis()
3455 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_set_mis()
3457 if (STV090x_WRITE_DEMOD(state, ISIENTRY, mis) < 0) in stv090x_set_mis()
3459 if (STV090x_WRITE_DEMOD(state, ISIBITENA, 0xff) < 0) in stv090x_set_mis()
3462 return 0; in stv090x_set_mis()
3473 if (props->frequency == 0) in stv090x_search()
3523 *status = 0; in stv090x_read_status()
3533 case 0: /* searching */ in stv090x_read_status()
3566 return 0; in stv090x_read_status()
3600 count = (count_2 & 0xff) << 16; in stv090x_read_per()
3601 count |= (count_1 & 0xff) << 8; in stv090x_read_per()
3602 count |= count_0 & 0xff; in stv090x_read_per()
3606 if (count == 0) in stv090x_read_per()
3609 if (STV090x_WRITE_DEMOD(state, FBERCPT4, 0) < 0) in stv090x_read_per()
3611 if (STV090x_WRITE_DEMOD(state, ERRCTRL2, 0xc1) < 0) in stv090x_read_per()
3614 return 0; in stv090x_read_per()
3622 int res = 0; in stv090x_table_lookup()
3623 int min = 0, med; in stv090x_table_lookup()
3671 if (agc > stv090x_rf_tab[0].read) in stv090x_read_signal_strength()
3672 str = 0; in stv090x_read_signal_strength()
3675 *strength = (str + 100) * 0xFFFF / 100; in stv090x_read_signal_strength()
3677 return 0; in stv090x_read_signal_strength()
3684 s32 val_0, val_1, val = 0; in stv090x_read_cnr()
3695 for (i = 0; i < 16; i++) { in stv090x_read_cnr()
3708 if (val < 0) in stv090x_read_cnr()
3709 val = 0; in stv090x_read_cnr()
3710 *cnr = val * 0xFFFF / div; in stv090x_read_cnr()
3720 for (i = 0; i < 16; i++) { in stv090x_read_cnr()
3731 stv090x_s1cn_tab[0].real; in stv090x_read_cnr()
3733 *cnr = val * 0xFFFF / div; in stv090x_read_cnr()
3740 return 0; in stv090x_read_cnr()
3751 STV090x_SETFIELD_Px(reg, DISTX_MODE_FIELD, 0); in stv090x_set_tone()
3753 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_set_tone()
3755 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 0); in stv090x_set_tone()
3756 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_set_tone()
3761 STV090x_SETFIELD_Px(reg, DISTX_MODE_FIELD, 0); in stv090x_set_tone()
3763 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_set_tone()
3770 return 0; in stv090x_set_tone()
3785 u32 reg, idle = 0, fifo_full = 1; in stv090x_send_diseqc_msg()
3793 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3795 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 0); in stv090x_send_diseqc_msg()
3796 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3800 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3803 for (i = 0; i < cmd->msg_len; i++) { in stv090x_send_diseqc_msg()
3810 if (STV090x_WRITE_DEMOD(state, DISTXDATA, cmd->msg[i]) < 0) in stv090x_send_diseqc_msg()
3814 STV090x_SETFIELD_Px(reg, DIS_PRECHARGE_FIELD, 0); in stv090x_send_diseqc_msg()
3815 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3818 i = 0; in stv090x_send_diseqc_msg()
3827 return 0; in stv090x_send_diseqc_msg()
3837 u32 reg, idle = 0, fifo_full = 1; in stv090x_send_diseqc_burst()
3845 value = 0x00; in stv090x_send_diseqc_burst()
3848 value = 0xFF; in stv090x_send_diseqc_burst()
3853 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3855 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 0); in stv090x_send_diseqc_burst()
3856 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3860 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3868 if (STV090x_WRITE_DEMOD(state, DISTXDATA, value) < 0) in stv090x_send_diseqc_burst()
3872 STV090x_SETFIELD_Px(reg, DIS_PRECHARGE_FIELD, 0); in stv090x_send_diseqc_burst()
3873 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3876 i = 0; in stv090x_send_diseqc_burst()
3885 return 0; in stv090x_send_diseqc_burst()
3894 u32 reg = 0, i = 0, rx_end = 0; in stv090x_recv_slave_reply()
3905 for (i = 0; i < reply->msg_len; i++) in stv090x_recv_slave_reply()
3909 return 0; in stv090x_recv_slave_reply()
3916 u8 full_standby = 0; in stv090x_sleep()
3918 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_sleep()
3922 if (state->config->tuner_sleep(fe) < 0) in stv090x_sleep()
3926 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_sleep()
3939 STV090x_SETFIELD(reg, ADC1_PON_FIELD, 0); in stv090x_sleep()
3940 if (stv090x_write_reg(state, STV090x_TSTTNR1, reg) < 0) in stv090x_sleep()
3944 STV090x_SETFIELD(reg, DISEQC1_PON_FIELD, 0); in stv090x_sleep()
3945 if (stv090x_write_reg(state, STV090x_TSTTNR2, reg) < 0) in stv090x_sleep()
3951 if (STV090x_GETFIELD(reg, ADC2_PON_FIELD) == 0) in stv090x_sleep()
3964 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_sleep()
3975 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_sleep()
3982 STV090x_SETFIELD(reg, ADC2_PON_FIELD, 0); in stv090x_sleep()
3983 if (stv090x_write_reg(state, STV090x_TSTTNR3, reg) < 0) in stv090x_sleep()
3987 STV090x_SETFIELD(reg, DISEQC2_PON_FIELD, 0); in stv090x_sleep()
3988 if (stv090x_write_reg(state, STV090x_TSTTNR4, reg) < 0) in stv090x_sleep()
3994 if (STV090x_GETFIELD(reg, ADC1_PON_FIELD) == 0) in stv090x_sleep()
4007 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_sleep()
4018 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_sleep()
4030 STV090x_SETFIELD(reg, STANDBY_FIELD, 0x01); in stv090x_sleep()
4031 if (stv090x_write_reg(state, STV090x_SYNTCTRL, reg) < 0) in stv090x_sleep()
4036 return 0; in stv090x_sleep()
4039 stv090x_i2c_gate_ctrl(state, 0); in stv090x_sleep()
4061 STV090x_SETFIELD(reg, STANDBY_FIELD, 0x00); in stv090x_wakeup()
4062 if (stv090x_write_reg(state, STV090x_SYNTCTRL, reg) < 0) in stv090x_wakeup()
4070 if (stv090x_write_reg(state, STV090x_TSTTNR1, reg) < 0) in stv090x_wakeup()
4075 if (stv090x_write_reg(state, STV090x_TSTTNR2, reg) < 0) in stv090x_wakeup()
4081 STV090x_SETFIELD(reg, STOP_CLKPKDT1_FIELD, 0); in stv090x_wakeup()
4083 STV090x_SETFIELD(reg, STOP_CLKADCI1_FIELD, 0); in stv090x_wakeup()
4085 STV090x_SETFIELD(reg, STOP_CLKFEC_FIELD, 0); in stv090x_wakeup()
4086 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_wakeup()
4090 STV090x_SETFIELD(reg, STOP_CLKSAMP1_FIELD, 0); in stv090x_wakeup()
4092 STV090x_SETFIELD(reg, STOP_CLKVIT1_FIELD, 0); in stv090x_wakeup()
4094 STV090x_SETFIELD(reg, STOP_CLKTS_FIELD, 0); in stv090x_wakeup()
4095 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_wakeup()
4103 if (stv090x_write_reg(state, STV090x_TSTTNR3, reg) < 0) in stv090x_wakeup()
4108 if (stv090x_write_reg(state, STV090x_TSTTNR4, reg) < 0) in stv090x_wakeup()
4114 STV090x_SETFIELD(reg, STOP_CLKPKDT2_FIELD, 0); in stv090x_wakeup()
4116 STV090x_SETFIELD(reg, STOP_CLKADCI2_FIELD, 0); in stv090x_wakeup()
4118 STV090x_SETFIELD(reg, STOP_CLKFEC_FIELD, 0); in stv090x_wakeup()
4119 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_wakeup()
4123 STV090x_SETFIELD(reg, STOP_CLKSAMP2_FIELD, 0); in stv090x_wakeup()
4125 STV090x_SETFIELD(reg, STOP_CLKVIT2_FIELD, 0); in stv090x_wakeup()
4127 STV090x_SETFIELD(reg, STOP_CLKTS_FIELD, 0); in stv090x_wakeup()
4128 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_wakeup()
4138 return 0; in stv090x_wakeup()
4150 if (state->internal->num_used <= 0) { in stv090x_release()
4163 u32 reg = 0; in stv090x_ldpc_mode()
4172 if (stv090x_write_reg(state, STV090x_GENCFG, 0x1d) < 0) in stv090x_ldpc_mode()
4178 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x1); in stv090x_ldpc_mode()
4179 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4181 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x0); in stv090x_ldpc_mode()
4182 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4185 if (STV090x_WRITE_DEMOD(state, MODCODLST0, 0xff) < 0) in stv090x_ldpc_mode()
4187 if (STV090x_WRITE_DEMOD(state, MODCODLST1, 0xff) < 0) in stv090x_ldpc_mode()
4189 if (STV090x_WRITE_DEMOD(state, MODCODLST2, 0xff) < 0) in stv090x_ldpc_mode()
4191 if (STV090x_WRITE_DEMOD(state, MODCODLST3, 0xff) < 0) in stv090x_ldpc_mode()
4193 if (STV090x_WRITE_DEMOD(state, MODCODLST4, 0xff) < 0) in stv090x_ldpc_mode()
4195 if (STV090x_WRITE_DEMOD(state, MODCODLST5, 0xff) < 0) in stv090x_ldpc_mode()
4197 if (STV090x_WRITE_DEMOD(state, MODCODLST6, 0xff) < 0) in stv090x_ldpc_mode()
4200 if (STV090x_WRITE_DEMOD(state, MODCODLST7, 0xcc) < 0) in stv090x_ldpc_mode()
4202 if (STV090x_WRITE_DEMOD(state, MODCODLST8, 0xcc) < 0) in stv090x_ldpc_mode()
4204 if (STV090x_WRITE_DEMOD(state, MODCODLST9, 0xcc) < 0) in stv090x_ldpc_mode()
4206 if (STV090x_WRITE_DEMOD(state, MODCODLSTA, 0xcc) < 0) in stv090x_ldpc_mode()
4208 if (STV090x_WRITE_DEMOD(state, MODCODLSTB, 0xcc) < 0) in stv090x_ldpc_mode()
4210 if (STV090x_WRITE_DEMOD(state, MODCODLSTC, 0xcc) < 0) in stv090x_ldpc_mode()
4212 if (STV090x_WRITE_DEMOD(state, MODCODLSTD, 0xcc) < 0) in stv090x_ldpc_mode()
4215 if (STV090x_WRITE_DEMOD(state, MODCODLSTE, 0xff) < 0) in stv090x_ldpc_mode()
4217 if (STV090x_WRITE_DEMOD(state, MODCODLSTF, 0xcf) < 0) in stv090x_ldpc_mode()
4223 if (stv090x_stop_modcod(state) < 0) in stv090x_ldpc_mode()
4225 if (stv090x_activate_modcod_single(state) < 0) in stv090x_ldpc_mode()
4229 if (stv090x_write_reg(state, STV090x_GENCFG, 0x06) < 0) /* path 2 */ in stv090x_ldpc_mode()
4232 if (stv090x_write_reg(state, STV090x_GENCFG, 0x04) < 0) /* path 1 */ in stv090x_ldpc_mode()
4237 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x1); in stv090x_ldpc_mode()
4238 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4240 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x0); in stv090x_ldpc_mode()
4241 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4245 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0x01); in stv090x_ldpc_mode()
4246 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_ldpc_mode()
4248 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0x00); in stv090x_ldpc_mode()
4249 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_ldpc_mode()
4254 return 0; in stv090x_ldpc_mode()
4286 if (stv090x_write_reg(state, STV090x_NCOARSE, reg) < 0) in stv090x_set_mclk()
4293 if (STV090x_WRITE_DEMOD(state, F22TX, div) < 0) in stv090x_set_mclk()
4295 if (STV090x_WRITE_DEMOD(state, F22RX, div) < 0) in stv090x_set_mclk()
4298 return 0; in stv090x_set_mclk()
4308 if (state->internal->dev_ver >= 0x20) { in stv0900_set_tspath()
4316 stv090x_write_reg(state, STV090x_TSGENERAL, 0x00); in stv0900_set_tspath()
4321 if (stv090x_write_reg(state, STV090x_TSGENERAL, 0x06) < 0) /* Mux'd stream mode */ in stv0900_set_tspath()
4325 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4329 if (stv090x_write_reg(state, STV090x_P2_TSCFGM, reg) < 0) in stv0900_set_tspath()
4331 if (stv090x_write_reg(state, STV090x_P1_TSSPEED, 0x14) < 0) in stv0900_set_tspath()
4333 if (stv090x_write_reg(state, STV090x_P2_TSSPEED, 0x28) < 0) in stv0900_set_tspath()
4346 if (stv090x_write_reg(state, STV090x_TSGENERAL, 0x0c) < 0) in stv0900_set_tspath()
4352 if (stv090x_write_reg(state, STV090x_TSGENERAL, 0x0a) < 0) in stv0900_set_tspath()
4366 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x10); in stv0900_set_tspath()
4371 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x16); in stv0900_set_tspath()
4374 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4377 STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 0); in stv0900_set_tspath()
4378 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4380 if (stv090x_write_reg(state, STV090x_P1_TSSPEED, 0x14) < 0) in stv0900_set_tspath()
4382 if (stv090x_write_reg(state, STV090x_P2_TSSPEED, 0x28) < 0) in stv0900_set_tspath()
4395 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x14); in stv0900_set_tspath()
4400 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x12); in stv0900_set_tspath()
4411 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4412 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4413 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4420 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4421 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4422 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4429 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4430 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4431 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4438 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4439 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4440 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4452 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4453 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4454 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4461 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4462 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4463 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4470 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4471 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4472 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4479 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4480 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4481 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4489 if (state->config->ts1_clk > 0) { in stv0900_set_tspath()
4498 if (speed < 0x08) in stv0900_set_tspath()
4499 speed = 0x08; in stv0900_set_tspath()
4500 if (speed > 0xFF) in stv0900_set_tspath()
4501 speed = 0xFF; in stv0900_set_tspath()
4507 if (speed < 0x20) in stv0900_set_tspath()
4508 speed = 0x20; in stv0900_set_tspath()
4509 if (speed > 0xFF) in stv0900_set_tspath()
4510 speed = 0xFF; in stv0900_set_tspath()
4515 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4517 if (stv090x_write_reg(state, STV090x_P1_TSSPEED, speed) < 0) in stv0900_set_tspath()
4521 if (state->config->ts2_clk > 0) { in stv0900_set_tspath()
4530 if (speed < 0x08) in stv0900_set_tspath()
4531 speed = 0x08; in stv0900_set_tspath()
4532 if (speed > 0xFF) in stv0900_set_tspath()
4533 speed = 0xFF; in stv0900_set_tspath()
4539 if (speed < 0x20) in stv0900_set_tspath()
4540 speed = 0x20; in stv0900_set_tspath()
4541 if (speed > 0xFF) in stv0900_set_tspath()
4542 speed = 0xFF; in stv0900_set_tspath()
4547 if (stv090x_write_reg(state, STV090x_P2_TSCFGM, reg) < 0) in stv0900_set_tspath()
4549 if (stv090x_write_reg(state, STV090x_P2_TSSPEED, speed) < 0) in stv0900_set_tspath()
4554 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x01); in stv0900_set_tspath()
4555 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4557 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x00); in stv0900_set_tspath()
4558 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4562 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x01); in stv0900_set_tspath()
4563 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4565 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x00); in stv0900_set_tspath()
4566 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4569 return 0; in stv0900_set_tspath()
4579 if (state->internal->dev_ver >= 0x20) { in stv0903_set_tspath()
4583 stv090x_write_reg(state, STV090x_TSGENERAL, 0x00); in stv0903_set_tspath()
4589 stv090x_write_reg(state, STV090x_TSGENERAL, 0x0c); in stv0903_set_tspath()
4596 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x10); in stv0903_set_tspath()
4602 stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x14); in stv0903_set_tspath()
4610 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0903_set_tspath()
4611 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0903_set_tspath()
4612 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4618 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0903_set_tspath()
4619 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0903_set_tspath()
4620 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4626 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0903_set_tspath()
4627 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0903_set_tspath()
4628 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4634 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0903_set_tspath()
4635 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0903_set_tspath()
4636 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4644 if (state->config->ts1_clk > 0) { in stv0903_set_tspath()
4653 if (speed < 0x08) in stv0903_set_tspath()
4654 speed = 0x08; in stv0903_set_tspath()
4655 if (speed > 0xFF) in stv0903_set_tspath()
4656 speed = 0xFF; in stv0903_set_tspath()
4662 if (speed < 0x20) in stv0903_set_tspath()
4663 speed = 0x20; in stv0903_set_tspath()
4664 if (speed > 0xFF) in stv0903_set_tspath()
4665 speed = 0xFF; in stv0903_set_tspath()
4670 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0903_set_tspath()
4672 if (stv090x_write_reg(state, STV090x_P1_TSSPEED, speed) < 0) in stv0903_set_tspath()
4677 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x01); in stv0903_set_tspath()
4678 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4680 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x00); in stv0903_set_tspath()
4681 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4684 return 0; in stv0903_set_tspath()
4696 if (state->internal->mclk == 0) { in stv090x_init()
4700 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_init()
4704 if (config->tuner_init(fe) < 0) in stv090x_init()
4708 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_init()
4714 0x20 | config->clk_mode) < 0) in stv090x_init()
4719 if (stv090x_wakeup(fe) < 0) { in stv090x_init()
4724 if (stv090x_ldpc_mode(state, state->demod_mode) < 0) in stv090x_init()
4729 if (STV090x_WRITE_DEMOD(state, TNRCFG2, reg) < 0) in stv090x_init()
4733 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_init()
4736 if (stv090x_i2c_gate_ctrl(state, 1) < 0) in stv090x_init()
4740 if (config->tuner_set_mode(fe, TUNER_WAKE) < 0) in stv090x_init()
4745 if (config->tuner_init(fe) < 0) in stv090x_init()
4749 if (stv090x_i2c_gate_ctrl(state, 0) < 0) in stv090x_init()
4753 if (stv0900_set_tspath(state) < 0) in stv090x_init()
4756 if (stv0903_set_tspath(state) < 0) in stv090x_init()
4760 return 0; in stv090x_init()
4763 stv090x_i2c_gate_ctrl(state, 0); in stv090x_init()
4775 unsigned long t1_size = 0, t2_size = 0; in stv090x_setup()
4776 u32 reg = 0; in stv090x_setup()
4797 if (stv090x_write_reg(state, STV090x_P1_DMDISTATE, 0x5c) < 0) in stv090x_setup()
4800 if (stv090x_write_reg(state, STV090x_P2_DMDISTATE, 0x5c) < 0) in stv090x_setup()
4806 if (stv090x_write_reg(state, STV090x_P1_TNRCFG, 0x6c) < 0) in stv090x_setup()
4809 if (stv090x_write_reg(state, STV090x_P2_TNRCFG, 0x6c) < 0) in stv090x_setup()
4814 if (stv090x_write_reg(state, STV090x_P1_I2CRPT, reg) < 0) in stv090x_setup()
4817 if (stv090x_write_reg(state, STV090x_P2_I2CRPT, reg) < 0) in stv090x_setup()
4820 if (stv090x_write_reg(state, STV090x_NCOARSE, 0x13) < 0) /* set PLL divider */ in stv090x_setup()
4823 if (stv090x_write_reg(state, STV090x_I2CCFG, 0x08) < 0) /* 1/41 oversampling */ in stv090x_setup()
4825 if (stv090x_write_reg(state, STV090x_SYNTCTRL, 0x20 | config->clk_mode) < 0) /* enable PLL */ in stv090x_setup()
4831 for (i = 0; i < t1_size; i++) { in stv090x_setup()
4832 if (stv090x_write_reg(state, stv090x_initval[i].addr, stv090x_initval[i].data) < 0) in stv090x_setup()
4837 if (state->internal->dev_ver >= 0x20) { in stv090x_setup()
4838 if (stv090x_write_reg(state, STV090x_TSGENERAL, 0x0c) < 0) in stv090x_setup()
4843 for (i = 0; i < t2_size; i++) { in stv090x_setup()
4844 if (stv090x_write_reg(state, stv090x_cut20_val[i].addr, stv090x_cut20_val[i].data) < 0) in stv090x_setup()
4848 } else if (state->internal->dev_ver < 0x20) { in stv090x_setup()
4849 dprintk(FE_ERROR, 1, "ERROR: Unsupported Cut: 0x%02x!", in stv090x_setup()
4853 } else if (state->internal->dev_ver > 0x30) { in stv090x_setup()
4855 dprintk(FE_ERROR, 1, "INFO: Cut: 0x%02x probably incomplete support!", in stv090x_setup()
4862 (config->adc1_range == STV090x_ADC_1Vpp) ? 0 : 1); in stv090x_setup()
4863 if (stv090x_write_reg(state, STV090x_TSTTNR1, reg) < 0) in stv090x_setup()
4869 (config->adc2_range == STV090x_ADC_1Vpp) ? 0 : 1); in stv090x_setup()
4870 if (stv090x_write_reg(state, STV090x_TSTTNR3, reg) < 0) in stv090x_setup()
4873 if (stv090x_write_reg(state, STV090x_TSTRES0, 0x80) < 0) in stv090x_setup()
4875 if (stv090x_write_reg(state, STV090x_TSTRES0, 0x00) < 0) in stv090x_setup()
4878 return 0; in stv090x_setup()
4888 u8 reg = 0; in stv090x_set_gpio()
4918 state->internal->mclk = 0; in stv090x_setup_compound()
4919 state->internal->dev_ver = 0; in stv090x_setup_compound()
4927 if (stv090x_setup(&state->frontend) < 0) { in stv090x_setup_compound()
4933 if (state->internal->dev_ver >= 0x30) in stv090x_setup_compound()
4942 dprintk(FE_ERROR, 1, "Probing %s demodulator(%d) Cut=0x%02x", in stv090x_setup_compound()
4947 return 0; in stv090x_setup_compound()
5000 int ret = 0; in stv090x_probe()
5032 return 0; in stv090x_probe()
5050 int ret = 0; in stv090x_attach()