aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorIgor M. Liplianin <liplianin@netup.ru>2009-03-15 06:28:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:23 -0400
commit11a84143b27303095b035931350e9233b538c4e3 (patch)
treeb4805a679b7972f618f54fd328315a3de5d3251a /drivers/media/dvb
parentb8ced13462cdb0e407831683b8e2c989b13db3ac (diff)
V4L/DVB (11054): Shorten some lines in stv0900 to less then 81 characters
Signed-off-by: Igor M. Liplianin <liplianin@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/frontends/stv0900_core.c41
1 files changed, 28 insertions, 13 deletions
diff --git a/drivers/media/dvb/frontends/stv0900_core.c b/drivers/media/dvb/frontends/stv0900_core.c
index 3cc6626fe633..5c8835ed7338 100644
--- a/drivers/media/dvb/frontends/stv0900_core.c
+++ b/drivers/media/dvb/frontends/stv0900_core.c
@@ -656,13 +656,18 @@ static s32 stv0900_carr_get_quality(struct dvb_frontend *fe,
656 656
657 dprintk(KERN_INFO "%s\n", __func__); 657 dprintk(KERN_INFO "%s\n", __func__);
658 658
659 dmd_reg(lock_flag_field, F0900_P1_LOCK_DEFINITIF, F0900_P2_LOCK_DEFINITIF); 659 dmd_reg(lock_flag_field, F0900_P1_LOCK_DEFINITIF,
660 F0900_P2_LOCK_DEFINITIF);
660 if (stv0900_get_standard(fe, demod) == STV0900_DVBS2_STANDARD) { 661 if (stv0900_get_standard(fe, demod) == STV0900_DVBS2_STANDARD) {
661 dmd_reg(noise_field1, F0900_P1_NOSPLHT_NORMED1, F0900_P2_NOSPLHT_NORMED1); 662 dmd_reg(noise_field1, F0900_P1_NOSPLHT_NORMED1,
662 dmd_reg(noise_field0, F0900_P1_NOSPLHT_NORMED0, F0900_P2_NOSPLHT_NORMED0); 663 F0900_P2_NOSPLHT_NORMED1);
664 dmd_reg(noise_field0, F0900_P1_NOSPLHT_NORMED0,
665 F0900_P2_NOSPLHT_NORMED0);
663 } else { 666 } else {
664 dmd_reg(noise_field1, F0900_P1_NOSDATAT_NORMED1, F0900_P2_NOSDATAT_NORMED1); 667 dmd_reg(noise_field1, F0900_P1_NOSDATAT_NORMED1,
665 dmd_reg(noise_field0, F0900_P1_NOSDATAT_NORMED0, F0900_P1_NOSDATAT_NORMED0); 668 F0900_P2_NOSDATAT_NORMED1);
669 dmd_reg(noise_field0, F0900_P1_NOSDATAT_NORMED0,
670 F0900_P1_NOSDATAT_NORMED0);
666 } 671 }
667 672
668 if (stv0900_get_bits(i_params, lock_flag_field)) { 673 if (stv0900_get_bits(i_params, lock_flag_field)) {
@@ -670,27 +675,34 @@ static s32 stv0900_carr_get_quality(struct dvb_frontend *fe,
670 regval = 0; 675 regval = 0;
671 msleep(5); 676 msleep(5);
672 for (i = 0; i < 16; i++) { 677 for (i = 0; i < 16; i++) {
673 regval += MAKEWORD(stv0900_get_bits(i_params, noise_field1), 678 regval += MAKEWORD(stv0900_get_bits(i_params,
674 stv0900_get_bits(i_params, noise_field0)); 679 noise_field1),
680 stv0900_get_bits(i_params,
681 noise_field0));
675 msleep(1); 682 msleep(1);
676 } 683 }
677 684
678 regval /= 16; 685 regval /= 16;
679 imin = 0; 686 imin = 0;
680 imax = lookup->size - 1; 687 imax = lookup->size - 1;
681 if (INRANGE(lookup->table[imin].regval, regval, lookup->table[imax].regval)) { 688 if (INRANGE(lookup->table[imin].regval,
689 regval,
690 lookup->table[imax].regval)) {
682 while ((imax - imin) > 1) { 691 while ((imax - imin) > 1) {
683 i = (imax + imin) >> 1; 692 i = (imax + imin) >> 1;
684 693 if (INRANGE(lookup->table[imin].regval,
685 if (INRANGE(lookup->table[imin].regval, regval, lookup->table[i].regval)) 694 regval,
695 lookup->table[i].regval))
686 imax = i; 696 imax = i;
687 else 697 else
688 imin = i; 698 imin = i;
689 } 699 }
690 700
691 c_n = ((regval - lookup->table[imin].regval) 701 c_n = ((regval - lookup->table[imin].regval)
692 * (lookup->table[imax].realval - lookup->table[imin].realval) 702 * (lookup->table[imax].realval
693 / (lookup->table[imax].regval - lookup->table[imin].regval)) 703 - lookup->table[imin].realval)
704 / (lookup->table[imax].regval
705 - lookup->table[imin].regval))
694 + lookup->table[imin].realval; 706 + lookup->table[imin].realval;
695 } else if (regval < lookup->table[imin].regval) 707 } else if (regval < lookup->table[imin].regval)
696 c_n = 1000; 708 c_n = 1000;
@@ -702,7 +714,10 @@ static s32 stv0900_carr_get_quality(struct dvb_frontend *fe,
702 714
703static int stv0900_read_snr(struct dvb_frontend *fe, u16 *snr) 715static int stv0900_read_snr(struct dvb_frontend *fe, u16 *snr)
704{ 716{
705 *snr = (16383 / 1030) * (30 + stv0900_carr_get_quality(fe, (const struct stv0900_table *)&stv0900_s2_cn)); 717 *snr = stv0900_carr_get_quality(fe,
718 (const struct stv0900_table *)&stv0900_s2_cn);
719 *snr += 30;
720 *snr *= (16383 / 1030);
706 721
707 return 0; 722 return 0;
708} 723}