aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/dvb/frontends/nxt200x.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@m1k.net>2006-01-23 09:52:39 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-01-23 17:06:26 -0200
commit46365f3c15c93706df2cc19fa1a38902d8b29e85 (patch)
tree2f508abcb411a2bf86f2dee624bc9b37d71249d4 /drivers/media/dvb/frontends/nxt200x.c
parentde7e8d78fca428c205ec1f81c0083570ec479c4e (diff)
V4L/DVB (3413): Kill nxt2002 in favor of the nxt200x module
- Kill nxt2002 module in favor of nxt200x. - Repair broken nxt2002 support in the nxt200x module. - Make the flexcop driver use nxt200x instead of the nxt2002 module for the Air2PC 2nd generation PCI card. - Remove the nxt2002 module from cvs and kernel build. Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/nxt200x.c')
-rw-r--r--drivers/media/dvb/frontends/nxt200x.c58
1 files changed, 50 insertions, 8 deletions
diff --git a/drivers/media/dvb/frontends/nxt200x.c b/drivers/media/dvb/frontends/nxt200x.c
index 78d2b93d35b..9e353539450 100644
--- a/drivers/media/dvb/frontends/nxt200x.c
+++ b/drivers/media/dvb/frontends/nxt200x.c
@@ -1,9 +1,10 @@
/*
* Support for NXT2002 and NXT2004 - VSB/QAM
*
- * Copyright (C) 2005 Kirk Lapray (kirk.lapray@gmail.com)
+ * Copyright (C) 2005 Kirk Lapray <kirk.lapray@gmail.com>
+ * Copyright (C) 2006 Michael Krufky <mkrufky@m1k.net>
* based on nxt2002 by Taylor Jacob <rtjacob@earthlink.net>
- * and nxt2004 by Jean-Francois Thibert (jeanfrancois@sagetv.com)
+ * and nxt2004 by Jean-Francois Thibert <jeanfrancois@sagetv.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -614,7 +615,17 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
/* write sdm1 input */
buf[0] = 0x10;
buf[1] = 0x00;
- nxt200x_writebytes(state, 0x58, buf, 2);
+ switch (state->demod_chip) {
+ case NXT2002:
+ nxt200x_writereg_multibyte(state, 0x58, buf, 2);
+ break;
+ case NXT2004:
+ nxt200x_writebytes(state, 0x58, buf, 2);
+ break;
+ default:
+ return -EINVAL;
+ break;
+ }
/* write sdmx input */
switch (p->u.vsb.modulation) {
@@ -632,7 +643,17 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
break;
}
buf[1] = 0x00;
- nxt200x_writebytes(state, 0x5C, buf, 2);
+ switch (state->demod_chip) {
+ case NXT2002:
+ nxt200x_writereg_multibyte(state, 0x5C, buf, 2);
+ break;
+ case NXT2004:
+ nxt200x_writebytes(state, 0x5C, buf, 2);
+ break;
+ default:
+ return -EINVAL;
+ break;
+ }
/* write adc power lpf fc */
buf[0] = 0x05;
@@ -648,7 +669,17 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
/* write accumulator2 input */
buf[0] = 0x80;
buf[1] = 0x00;
- nxt200x_writebytes(state, 0x4B, buf, 2);
+ switch (state->demod_chip) {
+ case NXT2002:
+ nxt200x_writereg_multibyte(state, 0x4B, buf, 2);
+ break;
+ case NXT2004:
+ nxt200x_writebytes(state, 0x4B, buf, 2);
+ break;
+ default:
+ return -EINVAL;
+ break;
+ }
/* write kg1 */
buf[0] = 0x00;
@@ -714,8 +745,19 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
/* write accumulator2 input */
buf[0] = 0x80;
buf[1] = 0x00;
- nxt200x_writebytes(state, 0x49, buf,2);
- nxt200x_writebytes(state, 0x4B, buf,2);
+ switch (state->demod_chip) {
+ case NXT2002:
+ nxt200x_writereg_multibyte(state, 0x49, buf, 2);
+ nxt200x_writereg_multibyte(state, 0x4B, buf, 2);
+ break;
+ case NXT2004:
+ nxt200x_writebytes(state, 0x49, buf, 2);
+ nxt200x_writebytes(state, 0x4B, buf, 2);
+ break;
+ default:
+ return -EINVAL;
+ break;
+ }
/* write agc control reg */
buf[0] = 0x04;
@@ -1199,7 +1241,7 @@ module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
MODULE_DESCRIPTION("NXT200X (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver");
-MODULE_AUTHOR("Kirk Lapray, Jean-Francois Thibert, and Taylor Jacob");
+MODULE_AUTHOR("Kirk Lapray, Michael Krufky, Jean-Francois Thibert, and Taylor Jacob");
MODULE_LICENSE("GPL");
EXPORT_SYMBOL(nxt200x_attach);