Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] STV0299 incorrect standby setting issues register 02 (MCR)

Issues with Register 02 causing spurious channel locking from standby.
Should have always bits 4 & 5 written to 1.
Lower nibble not used in any current driver. Usage if necessary can be
applied through initab to mcr_reg. stv0299 not out of standby before
writing inittab.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Acked-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Malcolm Priestley and committed by
Mauro Carvalho Chehab
24fb0604 2f970006

+8 -2
+8 -2
drivers/media/dvb/frontends/stv0299.c
··· 64 64 fe_code_rate_t fec_inner; 65 65 int errmode; 66 66 u32 ucblocks; 67 + u8 mcr_reg; 67 68 }; 68 69 69 70 #define STATUS_BER 0 ··· 458 457 459 458 dprintk("stv0299: init chip\n"); 460 459 460 + stv0299_writeregI(state, 0x02, 0x30 | state->mcr_reg); 461 + msleep(50); 462 + 461 463 for (i = 0; ; i += 2) { 462 464 reg = state->config->inittab[i]; 463 465 val = state->config->inittab[i+1]; ··· 468 464 break; 469 465 if (reg == 0x0c && state->config->op0_off) 470 466 val &= ~0x10; 467 + if (reg == 0x2) 468 + state->mcr_reg = val & 0xf; 471 469 stv0299_writeregI(state, reg, val); 472 470 } 473 471 ··· 624 618 { 625 619 struct stv0299_state* state = fe->demodulator_priv; 626 620 627 - stv0299_writeregI(state, 0x02, 0x80); 621 + stv0299_writeregI(state, 0x02, 0xb0 | state->mcr_reg); 628 622 state->initialised = 0; 629 623 630 624 return 0; ··· 686 680 state->errmode = STATUS_BER; 687 681 688 682 /* check if the demod is there */ 689 - stv0299_writeregI(state, 0x02, 0x34); /* standby off */ 683 + stv0299_writeregI(state, 0x02, 0x30); /* standby off */ 690 684 msleep(200); 691 685 id = stv0299_readreg(state, 0x00); 692 686