tda10048: clear the uncorrected packet registers when saturated
authorSteven Toth <stoth@kernellabs.com>
Sat May 08 14:52:52 2010 -0400 (2 years ago)
changeset 14625fbf5788dc990
parent 146245669d93c35ce
child 1462688112752eea9
tda10048: clear the uncorrected packet registers when saturated

From: Guillaume Audirac <guillaume.audirac@webag.fr>

Use the register CLUNC to reset the CPTU registers (LSB & MSB) when they
saturate at 0xFFFF. Fixes as well a few register typos.

Priority: normal

Signed-off-by: Guillaume Audirac <guillaume.audirac@webag.fr>
Signed-off-by: Steven Toth <stoth@kernellabs.com>
linux/drivers/media/dvb/frontends/tda10048.c
       1 --- a/linux/drivers/media/dvb/frontends/tda10048.c	Sat May 08 14:51:27 2010 -0400
       2 +++ b/linux/drivers/media/dvb/frontends/tda10048.c	Sat May 08 14:52:52 2010 -0400
       3 @@ -50,8 +50,8 @@
       4  #define TDA10048_CONF_C4_1         0x1E
       5  #define TDA10048_CONF_C4_2         0x1F
       6  #define TDA10048_CODE_IN_RAM       0x20
       7 -#define TDA10048_CHANNEL_INFO_1_R  0x22
       8 -#define TDA10048_CHANNEL_INFO_2_R  0x23
       9 +#define TDA10048_CHANNEL_INFO1_R   0x22
      10 +#define TDA10048_CHANNEL_INFO2_R   0x23
      11  #define TDA10048_CHANNEL_INFO1     0x24
      12  #define TDA10048_CHANNEL_INFO2     0x25
      13  #define TDA10048_TIME_ERROR_R      0x26
      14 @@ -64,8 +64,8 @@
      15  #define TDA10048_IT_STAT           0x32
      16  #define TDA10048_DSP_AD_LSB        0x3C
      17  #define TDA10048_DSP_AD_MSB        0x3D
      18 -#define TDA10048_DSP_REF_LSB       0x3E
      19 -#define TDA10048_DSP_REF_MSB       0x3F
      20 +#define TDA10048_DSP_REG_LSB       0x3E
      21 +#define TDA10048_DSP_REG_MSB       0x3F
      22  #define TDA10048_CONF_TRISTATE1    0x44
      23  #define TDA10048_CONF_TRISTATE2    0x45
      24  #define TDA10048_CONF_POLARITY     0x46
      25 @@ -1039,6 +1039,9 @@
      26  
      27  	*ucblocks = tda10048_readreg(state, TDA10048_UNCOR_CPT_MSB) << 8 |
      28  		tda10048_readreg(state, TDA10048_UNCOR_CPT_LSB);
      29 +	/* clear the uncorrected TS packets counter when saturated */
      30 +	if (*ucblocks == 0xFFFF)
      31 +		tda10048_writereg(state, TDA10048_UNCOR_CTRL, 0x80);
      32  
      33  	return 0;
      34  }