aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/s5h1409.c
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2007-12-12 20:14:00 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-12-13 14:58:06 -0500
commit2300317f30770abd625fb051b0e5d373ce55a6ad (patch)
tree00de65993cf08841e4ac560573cb7fd30d3e456d /drivers/media/dvb/frontends/s5h1409.c
parent4b5ae10c815941fab8e0e3b3801b4cb60ee2383a (diff)
V4L/DVB (6820): s5h1409: QAM SNR related fixes
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/s5h1409.c')
-rw-r--r--drivers/media/dvb/frontends/s5h1409.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c
index 8dee7ec9456a..562d9208857a 100644
--- a/drivers/media/dvb/frontends/s5h1409.c
+++ b/drivers/media/dvb/frontends/s5h1409.c
@@ -107,7 +107,7 @@ static struct vsb_snr_tab {
107 u16 val; 107 u16 val;
108 u16 data; 108 u16 data;
109} vsb_snr_tab[] = { 109} vsb_snr_tab[] = {
110 { 1023, 770, }, 110 { 924, 300, },
111 { 923, 300, }, 111 { 923, 300, },
112 { 918, 295, }, 112 { 918, 295, },
113 { 915, 290, }, 113 { 915, 290, },
@@ -154,6 +154,7 @@ static struct qam64_snr_tab {
154 u16 val; 154 u16 val;
155 u16 data; 155 u16 data;
156} qam64_snr_tab[] = { 156} qam64_snr_tab[] = {
157 { 1, 0, },
157 { 12, 300, }, 158 { 12, 300, },
158 { 15, 290, }, 159 { 15, 290, },
159 { 18, 280, }, 160 { 18, 280, },
@@ -217,6 +218,7 @@ static struct qam64_snr_tab {
217 { 95, 202, }, 218 { 95, 202, },
218 { 96, 201, }, 219 { 96, 201, },
219 { 104, 200, }, 220 { 104, 200, },
221 { 255, 0, },
220}; 222};
221 223
222/* QAM256 SNR lookup table */ 224/* QAM256 SNR lookup table */
@@ -224,6 +226,7 @@ static struct qam256_snr_tab {
224 u16 val; 226 u16 val;
225 u16 data; 227 u16 data;
226} qam256_snr_tab[] = { 228} qam256_snr_tab[] = {
229 { 1, 0, },
227 { 12, 400, }, 230 { 12, 400, },
228 { 13, 390, }, 231 { 13, 390, },
229 { 15, 380, }, 232 { 15, 380, },
@@ -292,6 +295,7 @@ static struct qam256_snr_tab {
292 { 105, 262, }, 295 { 105, 262, },
293 { 106, 261, }, 296 { 106, 261, },
294 { 110, 260, }, 297 { 110, 260, },
298 { 255, 0, },
295}; 299};
296 300
297/* 8 bit registers, 16 bit values */ 301/* 8 bit registers, 16 bit values */
@@ -670,14 +674,15 @@ static int s5h1409_read_snr(struct dvb_frontend* fe, u16* snr)
670 u16 reg; 674 u16 reg;
671 dprintk("%s()\n", __FUNCTION__); 675 dprintk("%s()\n", __FUNCTION__);
672 676
673 reg = s5h1409_readreg(state, 0xf1) & 0x1ff;
674
675 switch(state->current_modulation) { 677 switch(state->current_modulation) {
676 case QAM_64: 678 case QAM_64:
679 reg = s5h1409_readreg(state, 0xf0) & 0xff;
677 return s5h1409_qam64_lookup_snr(fe, snr, reg); 680 return s5h1409_qam64_lookup_snr(fe, snr, reg);
678 case QAM_256: 681 case QAM_256:
682 reg = s5h1409_readreg(state, 0xf0) & 0xff;
679 return s5h1409_qam256_lookup_snr(fe, snr, reg); 683 return s5h1409_qam256_lookup_snr(fe, snr, reg);
680 case VSB_8: 684 case VSB_8:
685 reg = s5h1409_readreg(state, 0xf1) & 0x3ff;
681 return s5h1409_vsb_lookup_snr(fe, snr, reg); 686 return s5h1409_vsb_lookup_snr(fe, snr, reg);
682 default: 687 default:
683 break; 688 break;