diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2009-12-15 06:47:21 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-01-17 08:55:44 -0500 |
commit | f5ae4f6f482191c531ea9e50ac91d9bd2ffca171 (patch) | |
tree | a5a1c9553ae58fb19eddbb594f8f0596a3b33e20 /drivers/media/dvb/frontends | |
parent | 1e42dc78900e9d0ce89d77f3ba6aca00abd5f1b5 (diff) |
V4L/DVB (13809): Fix Checkpatch violations
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r-- | drivers/media/dvb/frontends/mb86a16.c | 109 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/mb86a16.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/mb86a16_priv.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/tda665x.c | 32 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/tda665x.h | 2 |
5 files changed, 77 insertions, 70 deletions
diff --git a/drivers/media/dvb/frontends/mb86a16.c b/drivers/media/dvb/frontends/mb86a16.c index 33387b78d85a..32f20c681442 100644 --- a/drivers/media/dvb/frontends/mb86a16.c +++ b/drivers/media/dvb/frontends/mb86a16.c | |||
@@ -37,11 +37,11 @@ struct mb86a16_state { | |||
37 | const struct mb86a16_config *config; | 37 | const struct mb86a16_config *config; |
38 | struct dvb_frontend frontend; | 38 | struct dvb_frontend frontend; |
39 | 39 | ||
40 | // tuning parameters | 40 | /* tuning parameters */ |
41 | int frequency; | 41 | int frequency; |
42 | int srate; | 42 | int srate; |
43 | 43 | ||
44 | // Internal stuff | 44 | /* Internal stuff */ |
45 | int master_clk; | 45 | int master_clk; |
46 | int deci; | 46 | int deci; |
47 | int csel; | 47 | int csel; |
@@ -105,7 +105,7 @@ static int mb86a16_read(struct mb86a16_state *state, u8 reg, u8 *val) | |||
105 | .flags = 0, | 105 | .flags = 0, |
106 | .buf = b0, | 106 | .buf = b0, |
107 | .len = 1 | 107 | .len = 1 |
108 | },{ | 108 | }, { |
109 | .addr = state->config->demod_address, | 109 | .addr = state->config->demod_address, |
110 | .flags = I2C_M_RD, | 110 | .flags = I2C_M_RD, |
111 | .buf = b1, | 111 | .buf = b1, |
@@ -435,7 +435,7 @@ static int signal_det(struct mb86a16_state *state, | |||
435 | wait_sym = 80000; | 435 | wait_sym = 80000; |
436 | } | 436 | } |
437 | for (i = 0; i < 3; i++) { | 437 | for (i = 0; i < 3; i++) { |
438 | if (i == 0 ) | 438 | if (i == 0) |
439 | smrtd = smrt * 98 / 100; | 439 | smrtd = smrt * 98 / 100; |
440 | else if (i == 1) | 440 | else if (i == 1) |
441 | smrtd = smrt; | 441 | smrtd = smrt; |
@@ -480,11 +480,11 @@ static int rf_val_set(struct mb86a16_state *state, | |||
480 | unsigned char rf_val[5]; | 480 | unsigned char rf_val[5]; |
481 | int ack = -1; | 481 | int ack = -1; |
482 | 482 | ||
483 | if (smrt > 37750 ) | 483 | if (smrt > 37750) |
484 | C = 1; | 484 | C = 1; |
485 | else if (smrt > 18875) | 485 | else if (smrt > 18875) |
486 | C = 2; | 486 | C = 2; |
487 | else if (smrt > 5500 ) | 487 | else if (smrt > 5500) |
488 | C = 3; | 488 | C = 3; |
489 | else | 489 | else |
490 | C = 4; | 490 | C = 4; |
@@ -526,7 +526,7 @@ static int rf_val_set(struct mb86a16_state *state, | |||
526 | rf_val[2] = (M & 0x00ff0) >> 4; | 526 | rf_val[2] = (M & 0x00ff0) >> 4; |
527 | rf_val[3] = ((M & 0x0000f) << 4) | B; | 527 | rf_val[3] = ((M & 0x0000f) << 4) | B; |
528 | 528 | ||
529 | // Frequency Set | 529 | /* Frequency Set */ |
530 | if (mb86a16_write(state, 0x21, rf_val[0]) < 0) | 530 | if (mb86a16_write(state, 0x21, rf_val[0]) < 0) |
531 | ack = 0; | 531 | ack = 0; |
532 | if (mb86a16_write(state, 0x22, rf_val[1]) < 0) | 532 | if (mb86a16_write(state, 0x22, rf_val[1]) < 0) |
@@ -655,8 +655,8 @@ static int freqerr_chk(struct mb86a16_state *state, | |||
655 | unsigned char CRM, AFCML, AFCMH; | 655 | unsigned char CRM, AFCML, AFCMH; |
656 | unsigned char temp1, temp2, temp3; | 656 | unsigned char temp1, temp2, temp3; |
657 | int crm, afcm, AFCM; | 657 | int crm, afcm, AFCM; |
658 | int crrerr, afcerr; // [kHz] | 658 | int crrerr, afcerr; /* kHz */ |
659 | int frqerr; // [MHz] | 659 | int frqerr; /* MHz */ |
660 | int afcen, afcexen = 0; | 660 | int afcen, afcexen = 0; |
661 | int R, M, fOSC, fOSC_OFS; | 661 | int R, M, fOSC, fOSC_OFS; |
662 | 662 | ||
@@ -718,12 +718,12 @@ static int freqerr_chk(struct mb86a16_state *state, | |||
718 | 718 | ||
719 | fOSC_OFS = fOSC - fTP; | 719 | fOSC_OFS = fOSC - fTP; |
720 | 720 | ||
721 | if (unit == 0) { //[MHz] | 721 | if (unit == 0) { /* MHz */ |
722 | if (crrerr + afcerr + fOSC_OFS * 1000 >= 0) | 722 | if (crrerr + afcerr + fOSC_OFS * 1000 >= 0) |
723 | frqerr = (crrerr + afcerr + fOSC_OFS * 1000 + 500) / 1000; | 723 | frqerr = (crrerr + afcerr + fOSC_OFS * 1000 + 500) / 1000; |
724 | else | 724 | else |
725 | frqerr = (crrerr + afcerr + fOSC_OFS * 1000 - 500) / 1000; | 725 | frqerr = (crrerr + afcerr + fOSC_OFS * 1000 - 500) / 1000; |
726 | } else { //[kHz] | 726 | } else { /* kHz */ |
727 | frqerr = crrerr + afcerr + fOSC_OFS * 1000; | 727 | frqerr = crrerr + afcerr + fOSC_OFS * 1000; |
728 | } | 728 | } |
729 | 729 | ||
@@ -760,13 +760,13 @@ static void swp_info_get(struct mb86a16_state *state, | |||
760 | 760 | ||
761 | crnt_swp_freq = fOSC_start * 1000 + v * swp_ofs; | 761 | crnt_swp_freq = fOSC_start * 1000 + v * swp_ofs; |
762 | 762 | ||
763 | if (R == 0 ) | 763 | if (R == 0) |
764 | *fOSC = (crnt_swp_freq + 1000) / 2000 * 2; | 764 | *fOSC = (crnt_swp_freq + 1000) / 2000 * 2; |
765 | else | 765 | else |
766 | *fOSC = (crnt_swp_freq + 500) / 1000; | 766 | *fOSC = (crnt_swp_freq + 500) / 1000; |
767 | 767 | ||
768 | if (*fOSC >= crnt_swp_freq) | 768 | if (*fOSC >= crnt_swp_freq) |
769 | *afcex_freq = *fOSC *1000 - crnt_swp_freq; | 769 | *afcex_freq = *fOSC * 1000 - crnt_swp_freq; |
770 | else | 770 | else |
771 | *afcex_freq = crnt_swp_freq - *fOSC * 1000; | 771 | *afcex_freq = crnt_swp_freq - *fOSC * 1000; |
772 | 772 | ||
@@ -782,7 +782,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V | |||
782 | int swp_freq ; | 782 | int swp_freq ; |
783 | 783 | ||
784 | if ((i % 2 == 1) && (v <= vmax)) { | 784 | if ((i % 2 == 1) && (v <= vmax)) { |
785 | // positive v (case 1) | 785 | /* positive v (case 1) */ |
786 | if ((v - 1 == vmin) && | 786 | if ((v - 1 == vmin) && |
787 | (*(V + 30 + v) >= 0) && | 787 | (*(V + 30 + v) >= 0) && |
788 | (*(V + 30 + v - 1) >= 0) && | 788 | (*(V + 30 + v - 1) >= 0) && |
@@ -796,7 +796,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V | |||
796 | (*(V + 30 + v - 1) >= 0) && | 796 | (*(V + 30 + v - 1) >= 0) && |
797 | (*(V + 30 + v) > *(V + 30 + v - 1)) && | 797 | (*(V + 30 + v) > *(V + 30 + v - 1)) && |
798 | (*(V + 30 + v) > SIGMIN)) { | 798 | (*(V + 30 + v) > SIGMIN)) { |
799 | // (case 2) | 799 | /* (case 2) */ |
800 | swp_freq = fOSC * 1000 + afcex_freq; | 800 | swp_freq = fOSC * 1000 + afcex_freq; |
801 | *SIG1 = *(V + 30 + v); | 801 | *SIG1 = *(V + 30 + v); |
802 | } else if ((*(V + 30 + v) > 0) && | 802 | } else if ((*(V + 30 + v) > 0) && |
@@ -807,7 +807,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V | |||
807 | (*(V + 30 + v - 2) > *(V + 30 + v - 3)) && | 807 | (*(V + 30 + v - 2) > *(V + 30 + v - 3)) && |
808 | ((*(V + 30 + v - 1) > SIGMIN) || | 808 | ((*(V + 30 + v - 1) > SIGMIN) || |
809 | (*(V + 30 + v - 2) > SIGMIN))) { | 809 | (*(V + 30 + v - 2) > SIGMIN))) { |
810 | // (case 3) | 810 | /* (case 3) */ |
811 | if (*(V + 30 + v - 1) >= *(V + 30 + v - 2)) { | 811 | if (*(V + 30 + v - 1) >= *(V + 30 + v - 2)) { |
812 | swp_freq = fOSC * 1000 + afcex_freq - swp_ofs; | 812 | swp_freq = fOSC * 1000 + afcex_freq - swp_ofs; |
813 | *SIG1 = *(V + 30 + v - 1); | 813 | *SIG1 = *(V + 30 + v - 1); |
@@ -823,7 +823,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V | |||
823 | (*(V + 30 + v - 1) > *(V + 30 + v - 2)) && | 823 | (*(V + 30 + v - 1) > *(V + 30 + v - 2)) && |
824 | ((*(V + 30 + v) > SIGMIN) || | 824 | ((*(V + 30 + v) > SIGMIN) || |
825 | (*(V + 30 + v - 1) > SIGMIN))) { | 825 | (*(V + 30 + v - 1) > SIGMIN))) { |
826 | // (case 4) | 826 | /* (case 4) */ |
827 | if (*(V + 30 + v) >= *(V + 30 + v - 1)) { | 827 | if (*(V + 30 + v) >= *(V + 30 + v - 1)) { |
828 | swp_freq = fOSC * 1000 + afcex_freq; | 828 | swp_freq = fOSC * 1000 + afcex_freq; |
829 | *SIG1 = *(V + 30 + v); | 829 | *SIG1 = *(V + 30 + v); |
@@ -835,7 +835,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V | |||
835 | swp_freq = -1 ; | 835 | swp_freq = -1 ; |
836 | } | 836 | } |
837 | } else if ((i % 2 == 0) && (v >= vmin)) { | 837 | } else if ((i % 2 == 0) && (v >= vmin)) { |
838 | // Negative v (case 1) | 838 | /* Negative v (case 1) */ |
839 | if ((*(V + 30 + v) > 0) && | 839 | if ((*(V + 30 + v) > 0) && |
840 | (*(V + 30 + v + 1) > 0) && | 840 | (*(V + 30 + v + 1) > 0) && |
841 | (*(V + 30 + v + 2) > 0) && | 841 | (*(V + 30 + v + 2) > 0) && |
@@ -850,7 +850,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V | |||
850 | (*(V + 30 + v + 1) >= 0) && | 850 | (*(V + 30 + v + 1) >= 0) && |
851 | (*(V + 30 + v + 1) > *(V + 30 + v)) && | 851 | (*(V + 30 + v + 1) > *(V + 30 + v)) && |
852 | (*(V + 30 + v + 1) > SIGMIN)) { | 852 | (*(V + 30 + v + 1) > SIGMIN)) { |
853 | // (case 2) | 853 | /* (case 2) */ |
854 | swp_freq = fOSC * 1000 + afcex_freq + swp_ofs; | 854 | swp_freq = fOSC * 1000 + afcex_freq + swp_ofs; |
855 | *SIG1 = *(V + 30 + v); | 855 | *SIG1 = *(V + 30 + v); |
856 | } else if ((v == vmin) && | 856 | } else if ((v == vmin) && |
@@ -860,18 +860,18 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V | |||
860 | (*(V + 30 + v) > *(V + 30 + v + 1)) && | 860 | (*(V + 30 + v) > *(V + 30 + v + 1)) && |
861 | (*(V + 30 + v) > *(V + 30 + v + 2)) && | 861 | (*(V + 30 + v) > *(V + 30 + v + 2)) && |
862 | (*(V + 30 + v) > SIGMIN)) { | 862 | (*(V + 30 + v) > SIGMIN)) { |
863 | // (case 3) | 863 | /* (case 3) */ |
864 | swp_freq = fOSC * 1000 + afcex_freq; | 864 | swp_freq = fOSC * 1000 + afcex_freq; |
865 | *SIG1 = *(V + 30 + v); | 865 | *SIG1 = *(V + 30 + v); |
866 | } else if ((*(V + 30 + v) >= 0) && | 866 | } else if ((*(V + 30 + v) >= 0) && |
867 | (*(V + 30 + v + 1) >= 0) && | 867 | (*(V + 30 + v + 1) >= 0) && |
868 | (*(V + 30 + v + 2) >= 0) && | 868 | (*(V + 30 + v + 2) >= 0) && |
869 | (*(V +30 + v + 3) >= 0) && | 869 | (*(V + 30 + v + 3) >= 0) && |
870 | (*(V + 30 + v + 1) > *(V + 30 + v)) && | 870 | (*(V + 30 + v + 1) > *(V + 30 + v)) && |
871 | (*(V + 30 + v + 2) > *(V + 30 + v + 3)) && | 871 | (*(V + 30 + v + 2) > *(V + 30 + v + 3)) && |
872 | ((*(V + 30 + v + 1) > SIGMIN) || | 872 | ((*(V + 30 + v + 1) > SIGMIN) || |
873 | (*(V + 30 + v + 2) > SIGMIN))) { | 873 | (*(V + 30 + v + 2) > SIGMIN))) { |
874 | // (case 4) | 874 | /* (case 4) */ |
875 | if (*(V + 30 + v + 1) >= *(V + 30 + v + 2)) { | 875 | if (*(V + 30 + v + 1) >= *(V + 30 + v + 2)) { |
876 | swp_freq = fOSC * 1000 + afcex_freq + swp_ofs; | 876 | swp_freq = fOSC * 1000 + afcex_freq + swp_ofs; |
877 | *SIG1 = *(V + 30 + v + 1); | 877 | *SIG1 = *(V + 30 + v + 1); |
@@ -889,7 +889,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V | |||
889 | (*(V + 30 + v + 1) > *(V + 30 + v + 3)) && | 889 | (*(V + 30 + v + 1) > *(V + 30 + v + 3)) && |
890 | ((*(V + 30 + v) > SIGMIN) || | 890 | ((*(V + 30 + v) > SIGMIN) || |
891 | (*(V + 30 + v + 1) > SIGMIN))) { | 891 | (*(V + 30 + v + 1) > SIGMIN))) { |
892 | // (case 5) | 892 | /* (case 5) */ |
893 | if (*(V + 30 + v) >= *(V + 30 + v + 1)) { | 893 | if (*(V + 30 + v) >= *(V + 30 + v + 1)) { |
894 | swp_freq = fOSC * 1000 + afcex_freq; | 894 | swp_freq = fOSC * 1000 + afcex_freq; |
895 | *SIG1 = *(V + 30 + v); | 895 | *SIG1 = *(V + 30 + v); |
@@ -905,7 +905,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V | |||
905 | (*(V + 30 + v + 2) > *(V + 30 + v)) && | 905 | (*(V + 30 + v + 2) > *(V + 30 + v)) && |
906 | ((*(V + 30 + v + 1) > SIGMIN) || | 906 | ((*(V + 30 + v + 1) > SIGMIN) || |
907 | (*(V + 30 + v + 2) > SIGMIN))) { | 907 | (*(V + 30 + v + 2) > SIGMIN))) { |
908 | // (case 6) | 908 | /* (case 6) */ |
909 | if (*(V + 30 + v + 1) >= *(V + 30 + v + 2)) { | 909 | if (*(V + 30 + v + 1) >= *(V + 30 + v + 2)) { |
910 | swp_freq = fOSC * 1000 + afcex_freq + swp_ofs; | 910 | swp_freq = fOSC * 1000 + afcex_freq + swp_ofs; |
911 | *SIG1 = *(V + 30 + v + 1); | 911 | *SIG1 = *(V + 30 + v + 1); |
@@ -916,8 +916,10 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V | |||
916 | } else if ((vmax == 0) && (vmin == 0) && (*(V + 30 + v) > SIGMIN)) { | 916 | } else if ((vmax == 0) && (vmin == 0) && (*(V + 30 + v) > SIGMIN)) { |
917 | swp_freq = fOSC * 1000; | 917 | swp_freq = fOSC * 1000; |
918 | *SIG1 = *(V + 30 + v); | 918 | *SIG1 = *(V + 30 + v); |
919 | } else swp_freq = -1; | 919 | } else |
920 | } else swp_freq = -1; | 920 | swp_freq = -1; |
921 | } else | ||
922 | swp_freq = -1; | ||
921 | 923 | ||
922 | return swp_freq; | 924 | return swp_freq; |
923 | } | 925 | } |
@@ -962,7 +964,7 @@ static void afcex_info_get(struct mb86a16_state *state, | |||
962 | 964 | ||
963 | static int SEQ_set(struct mb86a16_state *state, unsigned char loop) | 965 | static int SEQ_set(struct mb86a16_state *state, unsigned char loop) |
964 | { | 966 | { |
965 | // SLOCK0 = 0 | 967 | /* SLOCK0 = 0 */ |
966 | if (mb86a16_write(state, 0x32, 0x02 | (loop << 2)) < 0) { | 968 | if (mb86a16_write(state, 0x32, 0x02 | (loop << 2)) < 0) { |
967 | dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); | 969 | dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); |
968 | return -EREMOTEIO; | 970 | return -EREMOTEIO; |
@@ -973,7 +975,7 @@ static int SEQ_set(struct mb86a16_state *state, unsigned char loop) | |||
973 | 975 | ||
974 | static int iq_vt_set(struct mb86a16_state *state, unsigned char IQINV) | 976 | static int iq_vt_set(struct mb86a16_state *state, unsigned char IQINV) |
975 | { | 977 | { |
976 | // Viterbi Rate, IQ Settings | 978 | /* Viterbi Rate, IQ Settings */ |
977 | if (mb86a16_write(state, 0x06, 0xdf | (IQINV << 5)) < 0) { | 979 | if (mb86a16_write(state, 0x06, 0xdf | (IQINV << 5)) < 0) { |
978 | dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); | 980 | dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); |
979 | return -EREMOTEIO; | 981 | return -EREMOTEIO; |
@@ -1031,7 +1033,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) | |||
1031 | unsigned char TIMINT1, TIMINT2, TIMEXT; | 1033 | unsigned char TIMINT1, TIMINT2, TIMEXT; |
1032 | unsigned char S0T, S1T; | 1034 | unsigned char S0T, S1T; |
1033 | unsigned char S2T; | 1035 | unsigned char S2T; |
1034 | // unsigned char S2T, S3T; | 1036 | /* unsigned char S2T, S3T; */ |
1035 | unsigned char S4T, S5T; | 1037 | unsigned char S4T, S5T; |
1036 | unsigned char AFCEX_L, AFCEX_H; | 1038 | unsigned char AFCEX_L, AFCEX_H; |
1037 | unsigned char R; | 1039 | unsigned char R; |
@@ -1052,7 +1054,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) | |||
1052 | int temp_freq, delta_freq; | 1054 | int temp_freq, delta_freq; |
1053 | int dagcm[4]; | 1055 | int dagcm[4]; |
1054 | int smrt_d; | 1056 | int smrt_d; |
1055 | // int freq_err; | 1057 | /* int freq_err; */ |
1056 | int n; | 1058 | int n; |
1057 | int ret = -1; | 1059 | int ret = -1; |
1058 | int sync; | 1060 | int sync; |
@@ -1093,19 +1095,19 @@ static int mb86a16_set_fe(struct mb86a16_state *state) | |||
1093 | } | 1095 | } |
1094 | if (EN_set(state, CREN, AFCEN) < 0) { | 1096 | if (EN_set(state, CREN, AFCEN) < 0) { |
1095 | dprintk(verbose, MB86A16_ERROR, 1, "EN set error"); | 1097 | dprintk(verbose, MB86A16_ERROR, 1, "EN set error"); |
1096 | return -1; // (0, 0) | 1098 | return -1; /* (0, 0) */ |
1097 | } | 1099 | } |
1098 | if (AFCEXEN_set(state, AFCEXEN, state->srate) < 0) { | 1100 | if (AFCEXEN_set(state, AFCEXEN, state->srate) < 0) { |
1099 | dprintk(verbose, MB86A16_ERROR, 1, "AFCEXEN set error"); | 1101 | dprintk(verbose, MB86A16_ERROR, 1, "AFCEXEN set error"); |
1100 | return -1; // (1, smrt) = (1, symbolrate) | 1102 | return -1; /* (1, smrt) = (1, symbolrate) */ |
1101 | } | 1103 | } |
1102 | if (CNTM_set(state, TIMINT1, TIMINT2, TIMEXT) < 0) { | 1104 | if (CNTM_set(state, TIMINT1, TIMINT2, TIMEXT) < 0) { |
1103 | dprintk(verbose, MB86A16_ERROR, 1, "CNTM set error"); | 1105 | dprintk(verbose, MB86A16_ERROR, 1, "CNTM set error"); |
1104 | return -1; // (0, 1, 2) | 1106 | return -1; /* (0, 1, 2) */ |
1105 | } | 1107 | } |
1106 | if (S01T_set(state, S1T, S0T) < 0) { | 1108 | if (S01T_set(state, S1T, S0T) < 0) { |
1107 | dprintk(verbose, MB86A16_ERROR, 1, "S01T set error"); | 1109 | dprintk(verbose, MB86A16_ERROR, 1, "S01T set error"); |
1108 | return -1; // (0, 0) | 1110 | return -1; /* (0, 0) */ |
1109 | } | 1111 | } |
1110 | smrt_info_get(state, state->srate); | 1112 | smrt_info_get(state, state->srate); |
1111 | if (smrt_set(state, state->srate) < 0) { | 1113 | if (smrt_set(state, state->srate) < 0) { |
@@ -1133,13 +1135,15 @@ static int mb86a16_set_fe(struct mb86a16_state *state) | |||
1133 | ftemp = ftemp + swp_ofs; | 1135 | ftemp = ftemp + swp_ofs; |
1134 | vmax++; | 1136 | vmax++; |
1135 | 1137 | ||
1136 | // Upper bound | 1138 | /* Upper bound */ |
1137 | if (ftemp > 2150000) { | 1139 | if (ftemp > 2150000) { |
1138 | loop = 0; | 1140 | loop = 0; |
1139 | vmax--; | 1141 | vmax--; |
1142 | } else { | ||
1143 | if ((ftemp == 2150000) || | ||
1144 | (ftemp - state->frequency * 1000 >= fcp + state->srate / 4)) | ||
1145 | loop = 0; | ||
1140 | } | 1146 | } |
1141 | else if ((ftemp == 2150000) || (ftemp - state->frequency * 1000 >= fcp + state->srate / 4)) | ||
1142 | loop = 0; | ||
1143 | } | 1147 | } |
1144 | 1148 | ||
1145 | loop = 1; | 1149 | loop = 1; |
@@ -1149,13 +1153,15 @@ static int mb86a16_set_fe(struct mb86a16_state *state) | |||
1149 | ftemp = ftemp - swp_ofs; | 1153 | ftemp = ftemp - swp_ofs; |
1150 | vmin--; | 1154 | vmin--; |
1151 | 1155 | ||
1152 | // Lower bound | 1156 | /* Lower bound */ |
1153 | if (ftemp < 950000) { | 1157 | if (ftemp < 950000) { |
1154 | loop = 0; | 1158 | loop = 0; |
1155 | vmin++; | 1159 | vmin++; |
1160 | } else { | ||
1161 | if ((ftemp == 950000) || | ||
1162 | (state->frequency * 1000 - ftemp >= fcp + state->srate / 4)) | ||
1163 | loop = 0; | ||
1156 | } | 1164 | } |
1157 | else if ((ftemp == 950000) || (state->frequency * 1000 - ftemp >= fcp + state->srate / 4)) | ||
1158 | loop = 0; | ||
1159 | } | 1165 | } |
1160 | 1166 | ||
1161 | wait_t = (8000 + state->srate / 2) / state->srate; | 1167 | wait_t = (8000 + state->srate / 2) / state->srate; |
@@ -1199,7 +1205,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) | |||
1199 | V[30 + v] = SIG1 ; | 1205 | V[30 + v] = SIG1 ; |
1200 | swp_freq = swp_freq_calcuation(state, i, v, V, vmax, vmin, | 1206 | swp_freq = swp_freq_calcuation(state, i, v, V, vmax, vmin, |
1201 | SIG1MIN, fOSC, afcex_freq, | 1207 | SIG1MIN, fOSC, afcex_freq, |
1202 | swp_ofs, &SIG1); //changed | 1208 | swp_ofs, &SIG1); /* changed */ |
1203 | 1209 | ||
1204 | signal_dupl = 0; | 1210 | signal_dupl = 0; |
1205 | for (j = 0; j < prev_freq_num; j++) { | 1211 | for (j = 0; j < prev_freq_num; j++) { |
@@ -1291,7 +1297,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) | |||
1291 | dprintk(verbose, MB86A16_ERROR, 1, "srst error"); | 1297 | dprintk(verbose, MB86A16_ERROR, 1, "srst error"); |
1292 | return -1; | 1298 | return -1; |
1293 | } | 1299 | } |
1294 | // delay 4~200 | 1300 | /* delay 4~200 */ |
1295 | wait_t = 200000 / state->master_clk + 200000 / state->srate; | 1301 | wait_t = 200000 / state->master_clk + 200000 / state->srate; |
1296 | msleep(wait_t); | 1302 | msleep(wait_t); |
1297 | afcerr = afcerr_chk(state); | 1303 | afcerr = afcerr_chk(state); |
@@ -1452,7 +1458,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) | |||
1452 | S2T = 7; S4T = 2; S5T = 8; ETH = 7; VIA = 2; | 1458 | S2T = 7; S4T = 2; S5T = 8; ETH = 7; VIA = 2; |
1453 | wait_t = 7 + (2097152 + state->srate / 2) / state->srate; | 1459 | wait_t = 7 + (2097152 + state->srate / 2) / state->srate; |
1454 | } | 1460 | } |
1455 | wait_t *= 2; /* FOS */ | 1461 | wait_t *= 2; /* FOS */ |
1456 | S2T_set(state, S2T); | 1462 | S2T_set(state, S2T); |
1457 | S45T_set(state, S4T, S5T); | 1463 | S45T_set(state, S4T, S5T); |
1458 | Vi_set(state, ETH, VIA); | 1464 | Vi_set(state, ETH, VIA); |
@@ -1461,13 +1467,14 @@ static int mb86a16_set_fe(struct mb86a16_state *state) | |||
1461 | sync = sync_chk(state, &VIRM); | 1467 | sync = sync_chk(state, &VIRM); |
1462 | dprintk(verbose, MB86A16_INFO, 1, "-------- Viterbi=[%d] SYNC=[%d] ---------", VIRM, sync); | 1468 | dprintk(verbose, MB86A16_INFO, 1, "-------- Viterbi=[%d] SYNC=[%d] ---------", VIRM, sync); |
1463 | if (VIRM) { | 1469 | if (VIRM) { |
1464 | if (VIRM == 4) { // 5/6 | 1470 | if (VIRM == 4) { |
1471 | /* 5/6 */ | ||
1465 | if (SIG1 > 110) | 1472 | if (SIG1 > 110) |
1466 | wait_t = ( 786432 + state->srate / 2) / state->srate; | 1473 | wait_t = (786432 + state->srate / 2) / state->srate; |
1467 | else | 1474 | else |
1468 | wait_t = (1572864 + state->srate / 2) / state->srate; | 1475 | wait_t = (1572864 + state->srate / 2) / state->srate; |
1469 | if (state->srate < 5000) | 1476 | if (state->srate < 5000) |
1470 | // FIXME ! , should be a long wait ! | 1477 | /* FIXME ! , should be a long wait ! */ |
1471 | msleep_interruptible(wait_t); | 1478 | msleep_interruptible(wait_t); |
1472 | else | 1479 | else |
1473 | msleep_interruptible(wait_t); | 1480 | msleep_interruptible(wait_t); |
@@ -1477,9 +1484,9 @@ static int mb86a16_set_fe(struct mb86a16_state *state) | |||
1477 | FEC_srst(state); | 1484 | FEC_srst(state); |
1478 | } | 1485 | } |
1479 | } | 1486 | } |
1480 | // 1/2, 2/3, 3/4, 7/8 | 1487 | /* 1/2, 2/3, 3/4, 7/8 */ |
1481 | if (SIG1 > 110) | 1488 | if (SIG1 > 110) |
1482 | wait_t = ( 786432 + state->srate / 2) / state->srate; | 1489 | wait_t = (786432 + state->srate / 2) / state->srate; |
1483 | else | 1490 | else |
1484 | wait_t = (1572864 + state->srate / 2) / state->srate; | 1491 | wait_t = (1572864 + state->srate / 2) / state->srate; |
1485 | msleep_interruptible(wait_t); | 1492 | msleep_interruptible(wait_t); |
@@ -1491,7 +1498,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) | |||
1491 | } | 1498 | } |
1492 | } | 1499 | } |
1493 | } else { | 1500 | } else { |
1494 | dprintk (verbose, MB86A16_INFO, 1, "NO -- SIGNAL"); | 1501 | dprintk(verbose, MB86A16_INFO, 1, "NO -- SIGNAL"); |
1495 | ret = -1; | 1502 | ret = -1; |
1496 | } | 1503 | } |
1497 | 1504 | ||
@@ -1846,7 +1853,7 @@ struct dvb_frontend *mb86a16_attach(const struct mb86a16_config *config, | |||
1846 | u8 dev_id = 0; | 1853 | u8 dev_id = 0; |
1847 | struct mb86a16_state *state = NULL; | 1854 | struct mb86a16_state *state = NULL; |
1848 | 1855 | ||
1849 | state = kmalloc(sizeof (struct mb86a16_state), GFP_KERNEL); | 1856 | state = kmalloc(sizeof(struct mb86a16_state), GFP_KERNEL); |
1850 | if (state == NULL) | 1857 | if (state == NULL) |
1851 | goto error; | 1858 | goto error; |
1852 | 1859 | ||
@@ -1857,7 +1864,7 @@ struct dvb_frontend *mb86a16_attach(const struct mb86a16_config *config, | |||
1857 | if (dev_id != 0xfe) | 1864 | if (dev_id != 0xfe) |
1858 | goto error; | 1865 | goto error; |
1859 | 1866 | ||
1860 | memcpy(&state->frontend.ops, &mb86a16_ops, sizeof (struct dvb_frontend_ops)); | 1867 | memcpy(&state->frontend.ops, &mb86a16_ops, sizeof(struct dvb_frontend_ops)); |
1861 | state->frontend.demodulator_priv = state; | 1868 | state->frontend.demodulator_priv = state; |
1862 | state->frontend.ops.set_voltage = state->config->set_voltage; | 1869 | state->frontend.ops.set_voltage = state->config->set_voltage; |
1863 | 1870 | ||
diff --git a/drivers/media/dvb/frontends/mb86a16.h b/drivers/media/dvb/frontends/mb86a16.h index b7545d0343f1..68f25a640173 100644 --- a/drivers/media/dvb/frontends/mb86a16.h +++ b/drivers/media/dvb/frontends/mb86a16.h | |||
@@ -35,4 +35,4 @@ extern struct dvb_frontend *mb86a16_attach(const struct mb86a16_config *config, | |||
35 | struct i2c_adapter *i2c_adap); | 35 | struct i2c_adapter *i2c_adap); |
36 | 36 | ||
37 | 37 | ||
38 | #endif //__MB86A16_H | 38 | #endif /* __MB86A16_H */ |
diff --git a/drivers/media/dvb/frontends/mb86a16_priv.h b/drivers/media/dvb/frontends/mb86a16_priv.h index 5de570068060..d8757fafcf1f 100644 --- a/drivers/media/dvb/frontends/mb86a16_priv.h +++ b/drivers/media/dvb/frontends/mb86a16_priv.h | |||
@@ -148,4 +148,4 @@ | |||
148 | #define MB86A16_DISTMON 0x52 | 148 | #define MB86A16_DISTMON 0x52 |
149 | #define MB86A16_VERSION 0x7f | 149 | #define MB86A16_VERSION 0x7f |
150 | 150 | ||
151 | #endif //__MB86A16_PRIV_H | 151 | #endif /* __MB86A16_PRIV_H */ |
diff --git a/drivers/media/dvb/frontends/tda665x.c b/drivers/media/dvb/frontends/tda665x.c index 0732a2d38e10..87d52739c828 100644 --- a/drivers/media/dvb/frontends/tda665x.c +++ b/drivers/media/dvb/frontends/tda665x.c | |||
@@ -45,7 +45,7 @@ static int tda665x_read(struct tda665x_state *state, u8 *buf) | |||
45 | 45 | ||
46 | return err; | 46 | return err; |
47 | exit: | 47 | exit: |
48 | printk("%s: I/O Error err=<%d>\n", __func__, err); | 48 | printk(KERN_ERR "%s: I/O Error err=<%d>\n", __func__, err); |
49 | return err; | 49 | return err; |
50 | } | 50 | } |
51 | 51 | ||
@@ -61,7 +61,7 @@ static int tda665x_write(struct tda665x_state *state, u8 *buf, u8 length) | |||
61 | 61 | ||
62 | return err; | 62 | return err; |
63 | exit: | 63 | exit: |
64 | printk("%s: I/O Error err=<%d>\n", __func__, err); | 64 | printk(KERN_ERR "%s: I/O Error err=<%d>\n", __func__, err); |
65 | return err; | 65 | return err; |
66 | } | 66 | } |
67 | 67 | ||
@@ -79,7 +79,7 @@ static int tda665x_get_state(struct dvb_frontend *fe, | |||
79 | case DVBFE_TUNER_BANDWIDTH: | 79 | case DVBFE_TUNER_BANDWIDTH: |
80 | break; | 80 | break; |
81 | default: | 81 | default: |
82 | printk("%s: Unknown parameter (param=%d)\n", __func__, param); | 82 | printk(KERN_ERR "%s: Unknown parameter (param=%d)\n", __func__, param); |
83 | err = -EINVAL; | 83 | err = -EINVAL; |
84 | break; | 84 | break; |
85 | } | 85 | } |
@@ -100,13 +100,13 @@ static int tda665x_get_status(struct dvb_frontend *fe, u32 *status) | |||
100 | goto exit; | 100 | goto exit; |
101 | 101 | ||
102 | if ((result >> 6) & 0x01) { | 102 | if ((result >> 6) & 0x01) { |
103 | printk("%s: Tuner Phase Locked\n", __func__); | 103 | printk(KERN_DEBUG "%s: Tuner Phase Locked\n", __func__); |
104 | *status = 1; | 104 | *status = 1; |
105 | } | 105 | } |
106 | 106 | ||
107 | return err; | 107 | return err; |
108 | exit: | 108 | exit: |
109 | printk("%s: I/O Error\n", __func__); | 109 | printk(KERN_ERR "%s: I/O Error\n", __func__); |
110 | return err; | 110 | return err; |
111 | } | 111 | } |
112 | 112 | ||
@@ -124,7 +124,7 @@ static int tda665x_set_state(struct dvb_frontend *fe, | |||
124 | 124 | ||
125 | frequency = tstate->frequency; | 125 | frequency = tstate->frequency; |
126 | if ((frequency < config->frequency_max) || (frequency > config->frequency_min)) { | 126 | if ((frequency < config->frequency_max) || (frequency > config->frequency_min)) { |
127 | printk("%s: Frequency beyond limits, frequency=%d\n", __func__, frequency); | 127 | printk(KERN_ERR "%s: Frequency beyond limits, frequency=%d\n", __func__, frequency); |
128 | return -EINVAL; | 128 | return -EINVAL; |
129 | } | 129 | } |
130 | 130 | ||
@@ -133,8 +133,8 @@ static int tda665x_set_state(struct dvb_frontend *fe, | |||
133 | frequency += config->ref_divider >> 1; | 133 | frequency += config->ref_divider >> 1; |
134 | frequency /= config->ref_divider; | 134 | frequency /= config->ref_divider; |
135 | 135 | ||
136 | buf[0] = (u8 ) (frequency & 0x7f00) >> 8; | 136 | buf[0] = (u8) (frequency & 0x7f00) >> 8; |
137 | buf[1] = (u8 ) (frequency & 0x00ff) >> 0; | 137 | buf[1] = (u8) (frequency & 0x00ff) >> 0; |
138 | buf[2] = 0x80 | 0x40 | 0x02; | 138 | buf[2] = 0x80 | 0x40 | 0x02; |
139 | buf[3] = 0x00; | 139 | buf[3] = 0x00; |
140 | 140 | ||
@@ -178,7 +178,7 @@ static int tda665x_set_state(struct dvb_frontend *fe, | |||
178 | goto exit; | 178 | goto exit; |
179 | 179 | ||
180 | /* sleep for some time */ | 180 | /* sleep for some time */ |
181 | printk("%s: Waiting to Phase LOCK\n", __func__); | 181 | printk(KERN_DEBUG "%s: Waiting to Phase LOCK\n", __func__); |
182 | msleep(20); | 182 | msleep(20); |
183 | /* check status */ | 183 | /* check status */ |
184 | err = tda665x_get_status(fe, &status); | 184 | err = tda665x_get_status(fe, &status); |
@@ -186,19 +186,19 @@ static int tda665x_set_state(struct dvb_frontend *fe, | |||
186 | goto exit; | 186 | goto exit; |
187 | 187 | ||
188 | if (status == 1) { | 188 | if (status == 1) { |
189 | printk("%s: Tuner Phase locked: status=%d\n", __func__, status); | 189 | printk(KERN_DEBUG "%s: Tuner Phase locked: status=%d\n", __func__, status); |
190 | state->frequency = frequency; /* cache successful state */ | 190 | state->frequency = frequency; /* cache successful state */ |
191 | } else { | 191 | } else { |
192 | printk("%s: No Phase lock: status=%d\n", __func__, status); | 192 | printk(KERN_ERR "%s: No Phase lock: status=%d\n", __func__, status); |
193 | } | 193 | } |
194 | } else { | 194 | } else { |
195 | printk("%s: Unknown parameter (param=%d)\n", __func__, param); | 195 | printk(KERN_ERR "%s: Unknown parameter (param=%d)\n", __func__, param); |
196 | return -EINVAL; | 196 | return -EINVAL; |
197 | } | 197 | } |
198 | 198 | ||
199 | return 0; | 199 | return 0; |
200 | exit: | 200 | exit: |
201 | printk("%s: I/O Error\n", __func__); | 201 | printk(KERN_ERR "%s: I/O Error\n", __func__); |
202 | return err; | 202 | return err; |
203 | } | 203 | } |
204 | 204 | ||
@@ -226,7 +226,7 @@ struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, | |||
226 | struct tda665x_state *state = NULL; | 226 | struct tda665x_state *state = NULL; |
227 | struct dvb_tuner_info *info; | 227 | struct dvb_tuner_info *info; |
228 | 228 | ||
229 | state = kzalloc(sizeof (struct tda665x_state), GFP_KERNEL); | 229 | state = kzalloc(sizeof(struct tda665x_state), GFP_KERNEL); |
230 | if (state == NULL) | 230 | if (state == NULL) |
231 | goto exit; | 231 | goto exit; |
232 | 232 | ||
@@ -237,12 +237,12 @@ struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, | |||
237 | fe->ops.tuner_ops = tda665x_ops; | 237 | fe->ops.tuner_ops = tda665x_ops; |
238 | info = &fe->ops.tuner_ops.info; | 238 | info = &fe->ops.tuner_ops.info; |
239 | 239 | ||
240 | memcpy(info->name, config->name, sizeof (config->name)); | 240 | memcpy(info->name, config->name, sizeof(config->name)); |
241 | info->frequency_min = config->frequency_min; | 241 | info->frequency_min = config->frequency_min; |
242 | info->frequency_max = config->frequency_max; | 242 | info->frequency_max = config->frequency_max; |
243 | info->frequency_step = config->frequency_offst; | 243 | info->frequency_step = config->frequency_offst; |
244 | 244 | ||
245 | printk("%s: Attaching TDA665x (%s) tuner\n", __func__, info->name); | 245 | printk(KERN_DEBUG "%s: Attaching TDA665x (%s) tuner\n", __func__, info->name); |
246 | 246 | ||
247 | return fe; | 247 | return fe; |
248 | 248 | ||
diff --git a/drivers/media/dvb/frontends/tda665x.h b/drivers/media/dvb/frontends/tda665x.h index c0b544d8ef57..ec7927aa75ae 100644 --- a/drivers/media/dvb/frontends/tda665x.h +++ b/drivers/media/dvb/frontends/tda665x.h | |||
@@ -40,7 +40,7 @@ extern struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, | |||
40 | #else | 40 | #else |
41 | 41 | ||
42 | static inline struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, | 42 | static inline struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, |
43 | const struct tda665x_config *config, | 43 | const struct tda665x_config *config, |
44 | struct i2c_adapter *i2c) | 44 | struct i2c_adapter *i2c) |
45 | { | 45 | { |
46 | printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__); | 46 | printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__); |