diff options
Diffstat (limited to 'drivers/media/dvb/frontends/nxt200x.c')
-rw-r--r-- | drivers/media/dvb/frontends/nxt200x.c | 58 |
1 files changed, 50 insertions, 8 deletions
diff --git a/drivers/media/dvb/frontends/nxt200x.c b/drivers/media/dvb/frontends/nxt200x.c index 78d2b93d35b9..9e3535394509 100644 --- a/drivers/media/dvb/frontends/nxt200x.c +++ b/drivers/media/dvb/frontends/nxt200x.c | |||
@@ -1,9 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * Support for NXT2002 and NXT2004 - VSB/QAM | 2 | * Support for NXT2002 and NXT2004 - VSB/QAM |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Kirk Lapray (kirk.lapray@gmail.com) | 4 | * Copyright (C) 2005 Kirk Lapray <kirk.lapray@gmail.com> |
5 | * Copyright (C) 2006 Michael Krufky <mkrufky@m1k.net> | ||
5 | * based on nxt2002 by Taylor Jacob <rtjacob@earthlink.net> | 6 | * based on nxt2002 by Taylor Jacob <rtjacob@earthlink.net> |
6 | * and nxt2004 by Jean-Francois Thibert (jeanfrancois@sagetv.com) | 7 | * and nxt2004 by Jean-Francois Thibert <jeanfrancois@sagetv.com> |
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 10 | * 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, | |||
614 | /* write sdm1 input */ | 615 | /* write sdm1 input */ |
615 | buf[0] = 0x10; | 616 | buf[0] = 0x10; |
616 | buf[1] = 0x00; | 617 | buf[1] = 0x00; |
617 | nxt200x_writebytes(state, 0x58, buf, 2); | 618 | switch (state->demod_chip) { |
619 | case NXT2002: | ||
620 | nxt200x_writereg_multibyte(state, 0x58, buf, 2); | ||
621 | break; | ||
622 | case NXT2004: | ||
623 | nxt200x_writebytes(state, 0x58, buf, 2); | ||
624 | break; | ||
625 | default: | ||
626 | return -EINVAL; | ||
627 | break; | ||
628 | } | ||
618 | 629 | ||
619 | /* write sdmx input */ | 630 | /* write sdmx input */ |
620 | switch (p->u.vsb.modulation) { | 631 | switch (p->u.vsb.modulation) { |
@@ -632,7 +643,17 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe, | |||
632 | break; | 643 | break; |
633 | } | 644 | } |
634 | buf[1] = 0x00; | 645 | buf[1] = 0x00; |
635 | nxt200x_writebytes(state, 0x5C, buf, 2); | 646 | switch (state->demod_chip) { |
647 | case NXT2002: | ||
648 | nxt200x_writereg_multibyte(state, 0x5C, buf, 2); | ||
649 | break; | ||
650 | case NXT2004: | ||
651 | nxt200x_writebytes(state, 0x5C, buf, 2); | ||
652 | break; | ||
653 | default: | ||
654 | return -EINVAL; | ||
655 | break; | ||
656 | } | ||
636 | 657 | ||
637 | /* write adc power lpf fc */ | 658 | /* write adc power lpf fc */ |
638 | buf[0] = 0x05; | 659 | buf[0] = 0x05; |
@@ -648,7 +669,17 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe, | |||
648 | /* write accumulator2 input */ | 669 | /* write accumulator2 input */ |
649 | buf[0] = 0x80; | 670 | buf[0] = 0x80; |
650 | buf[1] = 0x00; | 671 | buf[1] = 0x00; |
651 | nxt200x_writebytes(state, 0x4B, buf, 2); | 672 | switch (state->demod_chip) { |
673 | case NXT2002: | ||
674 | nxt200x_writereg_multibyte(state, 0x4B, buf, 2); | ||
675 | break; | ||
676 | case NXT2004: | ||
677 | nxt200x_writebytes(state, 0x4B, buf, 2); | ||
678 | break; | ||
679 | default: | ||
680 | return -EINVAL; | ||
681 | break; | ||
682 | } | ||
652 | 683 | ||
653 | /* write kg1 */ | 684 | /* write kg1 */ |
654 | buf[0] = 0x00; | 685 | buf[0] = 0x00; |
@@ -714,8 +745,19 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe, | |||
714 | /* write accumulator2 input */ | 745 | /* write accumulator2 input */ |
715 | buf[0] = 0x80; | 746 | buf[0] = 0x80; |
716 | buf[1] = 0x00; | 747 | buf[1] = 0x00; |
717 | nxt200x_writebytes(state, 0x49, buf,2); | 748 | switch (state->demod_chip) { |
718 | nxt200x_writebytes(state, 0x4B, buf,2); | 749 | case NXT2002: |
750 | nxt200x_writereg_multibyte(state, 0x49, buf, 2); | ||
751 | nxt200x_writereg_multibyte(state, 0x4B, buf, 2); | ||
752 | break; | ||
753 | case NXT2004: | ||
754 | nxt200x_writebytes(state, 0x49, buf, 2); | ||
755 | nxt200x_writebytes(state, 0x4B, buf, 2); | ||
756 | break; | ||
757 | default: | ||
758 | return -EINVAL; | ||
759 | break; | ||
760 | } | ||
719 | 761 | ||
720 | /* write agc control reg */ | 762 | /* write agc control reg */ |
721 | buf[0] = 0x04; | 763 | buf[0] = 0x04; |
@@ -1199,7 +1241,7 @@ module_param(debug, int, 0644); | |||
1199 | MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); | 1241 | MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); |
1200 | 1242 | ||
1201 | MODULE_DESCRIPTION("NXT200X (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver"); | 1243 | MODULE_DESCRIPTION("NXT200X (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver"); |
1202 | MODULE_AUTHOR("Kirk Lapray, Jean-Francois Thibert, and Taylor Jacob"); | 1244 | MODULE_AUTHOR("Kirk Lapray, Michael Krufky, Jean-Francois Thibert, and Taylor Jacob"); |
1203 | MODULE_LICENSE("GPL"); | 1245 | MODULE_LICENSE("GPL"); |
1204 | 1246 | ||
1205 | EXPORT_SYMBOL(nxt200x_attach); | 1247 | EXPORT_SYMBOL(nxt200x_attach); |