summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2007-12-12 20:14:00 -0500
committerSteven Toth <stoth@hauppauge.com>2007-12-12 20:14:00 -0500
commit359077037af7b20f69cde8ff021e4f5f89e4922f (patch)
treec75fc9e61b94522330e91b05c0f0bb194d376e65
parentb2a759d38e59944cf3c0789068025f0c42b85529 (diff)
downloadmediapointer-dvb-s2-359077037af7b20f69cde8ff021e4f5f89e4922f.tar.gz
mediapointer-dvb-s2-359077037af7b20f69cde8ff021e4f5f89e4922f.tar.bz2
s5h1409: QAM SNR related fixes
From: Steven Toth <stoth@hauppauge.com> QAM SNR values were incorrect when the cable was disconnected. This patch extends the lookup tables to ensure correct values are being returned. Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
-rw-r--r--linux/drivers/media/dvb/frontends/s5h1409.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/linux/drivers/media/dvb/frontends/s5h1409.c b/linux/drivers/media/dvb/frontends/s5h1409.c
index 188bcb247..b8679cf7a 100644
--- a/linux/drivers/media/dvb/frontends/s5h1409.c
+++ b/linux/drivers/media/dvb/frontends/s5h1409.c
@@ -107,7 +107,7 @@ static struct vsb_snr_tab {
u16 val;
u16 data;
} vsb_snr_tab[] = {
- { 1023, 770, },
+ { 924, 300, },
{ 923, 300, },
{ 918, 295, },
{ 915, 290, },
@@ -154,6 +154,7 @@ static struct qam64_snr_tab {
u16 val;
u16 data;
} qam64_snr_tab[] = {
+ { 1, 0, },
{ 12, 300, },
{ 15, 290, },
{ 18, 280, },
@@ -217,6 +218,7 @@ static struct qam64_snr_tab {
{ 95, 202, },
{ 96, 201, },
{ 104, 200, },
+ { 255, 0, },
};
/* QAM256 SNR lookup table */
@@ -224,6 +226,7 @@ static struct qam256_snr_tab {
u16 val;
u16 data;
} qam256_snr_tab[] = {
+ { 1, 0, },
{ 12, 400, },
{ 13, 390, },
{ 15, 380, },
@@ -292,6 +295,7 @@ static struct qam256_snr_tab {
{ 105, 262, },
{ 106, 261, },
{ 110, 260, },
+ { 255, 0, },
};
/* 8 bit registers, 16 bit values */
@@ -670,14 +674,15 @@ static int s5h1409_read_snr(struct dvb_frontend* fe, u16* snr)
u16 reg;
dprintk("%s()\n", __FUNCTION__);
- reg = s5h1409_readreg(state, 0xf1) & 0x1ff;
-
switch(state->current_modulation) {
case QAM_64:
+ reg = s5h1409_readreg(state, 0xf0) & 0xff;
return s5h1409_qam64_lookup_snr(fe, snr, reg);
case QAM_256:
+ reg = s5h1409_readreg(state, 0xf0) & 0xff;
return s5h1409_qam256_lookup_snr(fe, snr, reg);
case VSB_8:
+ reg = s5h1409_readreg(state, 0xf1) & 0x3ff;
return s5h1409_vsb_lookup_snr(fe, snr, reg);
default:
break;