Commit f5ae4f6f authored by Manu Abraham's avatar Manu Abraham Committed by Mauro Carvalho Chehab

V4L/DVB (13809): Fix Checkpatch violations

Signed-off-by: default avatarManu Abraham <manu@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 1e42dc78
...@@ -37,11 +37,11 @@ struct mb86a16_state { ...@@ -37,11 +37,11 @@ struct mb86a16_state {
const struct mb86a16_config *config; const struct mb86a16_config *config;
struct dvb_frontend frontend; struct dvb_frontend frontend;
// tuning parameters /* tuning parameters */
int frequency; int frequency;
int srate; int srate;
// Internal stuff /* Internal stuff */
int master_clk; int master_clk;
int deci; int deci;
int csel; int csel;
...@@ -105,7 +105,7 @@ static int mb86a16_read(struct mb86a16_state *state, u8 reg, u8 *val) ...@@ -105,7 +105,7 @@ static int mb86a16_read(struct mb86a16_state *state, u8 reg, u8 *val)
.flags = 0, .flags = 0,
.buf = b0, .buf = b0,
.len = 1 .len = 1
},{ }, {
.addr = state->config->demod_address, .addr = state->config->demod_address,
.flags = I2C_M_RD, .flags = I2C_M_RD,
.buf = b1, .buf = b1,
...@@ -435,7 +435,7 @@ static int signal_det(struct mb86a16_state *state, ...@@ -435,7 +435,7 @@ static int signal_det(struct mb86a16_state *state,
wait_sym = 80000; wait_sym = 80000;
} }
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (i == 0 ) if (i == 0)
smrtd = smrt * 98 / 100; smrtd = smrt * 98 / 100;
else if (i == 1) else if (i == 1)
smrtd = smrt; smrtd = smrt;
...@@ -480,11 +480,11 @@ static int rf_val_set(struct mb86a16_state *state, ...@@ -480,11 +480,11 @@ static int rf_val_set(struct mb86a16_state *state,
unsigned char rf_val[5]; unsigned char rf_val[5];
int ack = -1; int ack = -1;
if (smrt > 37750 ) if (smrt > 37750)
C = 1; C = 1;
else if (smrt > 18875) else if (smrt > 18875)
C = 2; C = 2;
else if (smrt > 5500 ) else if (smrt > 5500)
C = 3; C = 3;
else else
C = 4; C = 4;
...@@ -526,7 +526,7 @@ static int rf_val_set(struct mb86a16_state *state, ...@@ -526,7 +526,7 @@ static int rf_val_set(struct mb86a16_state *state,
rf_val[2] = (M & 0x00ff0) >> 4; rf_val[2] = (M & 0x00ff0) >> 4;
rf_val[3] = ((M & 0x0000f) << 4) | B; rf_val[3] = ((M & 0x0000f) << 4) | B;
// Frequency Set /* Frequency Set */
if (mb86a16_write(state, 0x21, rf_val[0]) < 0) if (mb86a16_write(state, 0x21, rf_val[0]) < 0)
ack = 0; ack = 0;
if (mb86a16_write(state, 0x22, rf_val[1]) < 0) if (mb86a16_write(state, 0x22, rf_val[1]) < 0)
...@@ -655,8 +655,8 @@ static int freqerr_chk(struct mb86a16_state *state, ...@@ -655,8 +655,8 @@ static int freqerr_chk(struct mb86a16_state *state,
unsigned char CRM, AFCML, AFCMH; unsigned char CRM, AFCML, AFCMH;
unsigned char temp1, temp2, temp3; unsigned char temp1, temp2, temp3;
int crm, afcm, AFCM; int crm, afcm, AFCM;
int crrerr, afcerr; // [kHz] int crrerr, afcerr; /* kHz */
int frqerr; // [MHz] int frqerr; /* MHz */
int afcen, afcexen = 0; int afcen, afcexen = 0;
int R, M, fOSC, fOSC_OFS; int R, M, fOSC, fOSC_OFS;
...@@ -718,12 +718,12 @@ static int freqerr_chk(struct mb86a16_state *state, ...@@ -718,12 +718,12 @@ static int freqerr_chk(struct mb86a16_state *state,
fOSC_OFS = fOSC - fTP; fOSC_OFS = fOSC - fTP;
if (unit == 0) { //[MHz] if (unit == 0) { /* MHz */
if (crrerr + afcerr + fOSC_OFS * 1000 >= 0) if (crrerr + afcerr + fOSC_OFS * 1000 >= 0)
frqerr = (crrerr + afcerr + fOSC_OFS * 1000 + 500) / 1000; frqerr = (crrerr + afcerr + fOSC_OFS * 1000 + 500) / 1000;
else else
frqerr = (crrerr + afcerr + fOSC_OFS * 1000 - 500) / 1000; frqerr = (crrerr + afcerr + fOSC_OFS * 1000 - 500) / 1000;
} else { //[kHz] } else { /* kHz */
frqerr = crrerr + afcerr + fOSC_OFS * 1000; frqerr = crrerr + afcerr + fOSC_OFS * 1000;
} }
...@@ -760,13 +760,13 @@ static void swp_info_get(struct mb86a16_state *state, ...@@ -760,13 +760,13 @@ static void swp_info_get(struct mb86a16_state *state,
crnt_swp_freq = fOSC_start * 1000 + v * swp_ofs; crnt_swp_freq = fOSC_start * 1000 + v * swp_ofs;
if (R == 0 ) if (R == 0)
*fOSC = (crnt_swp_freq + 1000) / 2000 * 2; *fOSC = (crnt_swp_freq + 1000) / 2000 * 2;
else else
*fOSC = (crnt_swp_freq + 500) / 1000; *fOSC = (crnt_swp_freq + 500) / 1000;
if (*fOSC >= crnt_swp_freq) if (*fOSC >= crnt_swp_freq)
*afcex_freq = *fOSC *1000 - crnt_swp_freq; *afcex_freq = *fOSC * 1000 - crnt_swp_freq;
else else
*afcex_freq = crnt_swp_freq - *fOSC * 1000; *afcex_freq = crnt_swp_freq - *fOSC * 1000;
...@@ -782,7 +782,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V ...@@ -782,7 +782,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V
int swp_freq ; int swp_freq ;
if ((i % 2 == 1) && (v <= vmax)) { if ((i % 2 == 1) && (v <= vmax)) {
// positive v (case 1) /* positive v (case 1) */
if ((v - 1 == vmin) && if ((v - 1 == vmin) &&
(*(V + 30 + v) >= 0) && (*(V + 30 + v) >= 0) &&
(*(V + 30 + v - 1) >= 0) && (*(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,7 +796,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V
(*(V + 30 + v - 1) >= 0) && (*(V + 30 + v - 1) >= 0) &&
(*(V + 30 + v) > *(V + 30 + v - 1)) && (*(V + 30 + v) > *(V + 30 + v - 1)) &&
(*(V + 30 + v) > SIGMIN)) { (*(V + 30 + v) > SIGMIN)) {
// (case 2) /* (case 2) */
swp_freq = fOSC * 1000 + afcex_freq; swp_freq = fOSC * 1000 + afcex_freq;
*SIG1 = *(V + 30 + v); *SIG1 = *(V + 30 + v);
} else if ((*(V + 30 + v) > 0) && } 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,7 +807,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V
(*(V + 30 + v - 2) > *(V + 30 + v - 3)) && (*(V + 30 + v - 2) > *(V + 30 + v - 3)) &&
((*(V + 30 + v - 1) > SIGMIN) || ((*(V + 30 + v - 1) > SIGMIN) ||
(*(V + 30 + v - 2) > SIGMIN))) { (*(V + 30 + v - 2) > SIGMIN))) {
// (case 3) /* (case 3) */
if (*(V + 30 + v - 1) >= *(V + 30 + v - 2)) { if (*(V + 30 + v - 1) >= *(V + 30 + v - 2)) {
swp_freq = fOSC * 1000 + afcex_freq - swp_ofs; swp_freq = fOSC * 1000 + afcex_freq - swp_ofs;
*SIG1 = *(V + 30 + v - 1); *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,7 +823,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V
(*(V + 30 + v - 1) > *(V + 30 + v - 2)) && (*(V + 30 + v - 1) > *(V + 30 + v - 2)) &&
((*(V + 30 + v) > SIGMIN) || ((*(V + 30 + v) > SIGMIN) ||
(*(V + 30 + v - 1) > SIGMIN))) { (*(V + 30 + v - 1) > SIGMIN))) {
// (case 4) /* (case 4) */
if (*(V + 30 + v) >= *(V + 30 + v - 1)) { if (*(V + 30 + v) >= *(V + 30 + v - 1)) {
swp_freq = fOSC * 1000 + afcex_freq; swp_freq = fOSC * 1000 + afcex_freq;
*SIG1 = *(V + 30 + v); *SIG1 = *(V + 30 + v);
...@@ -835,7 +835,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V ...@@ -835,7 +835,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V
swp_freq = -1 ; swp_freq = -1 ;
} }
} else if ((i % 2 == 0) && (v >= vmin)) { } else if ((i % 2 == 0) && (v >= vmin)) {
// Negative v (case 1) /* Negative v (case 1) */
if ((*(V + 30 + v) > 0) && if ((*(V + 30 + v) > 0) &&
(*(V + 30 + v + 1) > 0) && (*(V + 30 + v + 1) > 0) &&
(*(V + 30 + v + 2) > 0) && (*(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,7 +850,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V
(*(V + 30 + v + 1) >= 0) && (*(V + 30 + v + 1) >= 0) &&
(*(V + 30 + v + 1) > *(V + 30 + v)) && (*(V + 30 + v + 1) > *(V + 30 + v)) &&
(*(V + 30 + v + 1) > SIGMIN)) { (*(V + 30 + v + 1) > SIGMIN)) {
// (case 2) /* (case 2) */
swp_freq = fOSC * 1000 + afcex_freq + swp_ofs; swp_freq = fOSC * 1000 + afcex_freq + swp_ofs;
*SIG1 = *(V + 30 + v); *SIG1 = *(V + 30 + v);
} else if ((v == vmin) && } else if ((v == vmin) &&
...@@ -860,18 +860,18 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V ...@@ -860,18 +860,18 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V
(*(V + 30 + v) > *(V + 30 + v + 1)) && (*(V + 30 + v) > *(V + 30 + v + 1)) &&
(*(V + 30 + v) > *(V + 30 + v + 2)) && (*(V + 30 + v) > *(V + 30 + v + 2)) &&
(*(V + 30 + v) > SIGMIN)) { (*(V + 30 + v) > SIGMIN)) {
// (case 3) /* (case 3) */
swp_freq = fOSC * 1000 + afcex_freq; swp_freq = fOSC * 1000 + afcex_freq;
*SIG1 = *(V + 30 + v); *SIG1 = *(V + 30 + v);
} else if ((*(V + 30 + v) >= 0) && } else if ((*(V + 30 + v) >= 0) &&
(*(V + 30 + v + 1) >= 0) && (*(V + 30 + v + 1) >= 0) &&
(*(V + 30 + v + 2) >= 0) && (*(V + 30 + v + 2) >= 0) &&
(*(V +30 + v + 3) >= 0) && (*(V + 30 + v + 3) >= 0) &&
(*(V + 30 + v + 1) > *(V + 30 + v)) && (*(V + 30 + v + 1) > *(V + 30 + v)) &&
(*(V + 30 + v + 2) > *(V + 30 + v + 3)) && (*(V + 30 + v + 2) > *(V + 30 + v + 3)) &&
((*(V + 30 + v + 1) > SIGMIN) || ((*(V + 30 + v + 1) > SIGMIN) ||
(*(V + 30 + v + 2) > SIGMIN))) { (*(V + 30 + v + 2) > SIGMIN))) {
// (case 4) /* (case 4) */
if (*(V + 30 + v + 1) >= *(V + 30 + v + 2)) { if (*(V + 30 + v + 1) >= *(V + 30 + v + 2)) {
swp_freq = fOSC * 1000 + afcex_freq + swp_ofs; swp_freq = fOSC * 1000 + afcex_freq + swp_ofs;
*SIG1 = *(V + 30 + v + 1); *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,7 +889,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V
(*(V + 30 + v + 1) > *(V + 30 + v + 3)) && (*(V + 30 + v + 1) > *(V + 30 + v + 3)) &&
((*(V + 30 + v) > SIGMIN) || ((*(V + 30 + v) > SIGMIN) ||
(*(V + 30 + v + 1) > SIGMIN))) { (*(V + 30 + v + 1) > SIGMIN))) {
// (case 5) /* (case 5) */
if (*(V + 30 + v) >= *(V + 30 + v + 1)) { if (*(V + 30 + v) >= *(V + 30 + v + 1)) {
swp_freq = fOSC * 1000 + afcex_freq; swp_freq = fOSC * 1000 + afcex_freq;
*SIG1 = *(V + 30 + v); *SIG1 = *(V + 30 + v);
...@@ -905,7 +905,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V ...@@ -905,7 +905,7 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V
(*(V + 30 + v + 2) > *(V + 30 + v)) && (*(V + 30 + v + 2) > *(V + 30 + v)) &&
((*(V + 30 + v + 1) > SIGMIN) || ((*(V + 30 + v + 1) > SIGMIN) ||
(*(V + 30 + v + 2) > SIGMIN))) { (*(V + 30 + v + 2) > SIGMIN))) {
// (case 6) /* (case 6) */
if (*(V + 30 + v + 1) >= *(V + 30 + v + 2)) { if (*(V + 30 + v + 1) >= *(V + 30 + v + 2)) {
swp_freq = fOSC * 1000 + afcex_freq + swp_ofs; swp_freq = fOSC * 1000 + afcex_freq + swp_ofs;
*SIG1 = *(V + 30 + v + 1); *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,8 +916,10 @@ static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V
} else if ((vmax == 0) && (vmin == 0) && (*(V + 30 + v) > SIGMIN)) { } else if ((vmax == 0) && (vmin == 0) && (*(V + 30 + v) > SIGMIN)) {
swp_freq = fOSC * 1000; swp_freq = fOSC * 1000;
*SIG1 = *(V + 30 + v); *SIG1 = *(V + 30 + v);
} else swp_freq = -1; } else
} else swp_freq = -1; swp_freq = -1;
} else
swp_freq = -1;
return swp_freq; return swp_freq;
} }
...@@ -962,7 +964,7 @@ static void afcex_info_get(struct mb86a16_state *state, ...@@ -962,7 +964,7 @@ static void afcex_info_get(struct mb86a16_state *state,
static int SEQ_set(struct mb86a16_state *state, unsigned char loop) static int SEQ_set(struct mb86a16_state *state, unsigned char loop)
{ {
// SLOCK0 = 0 /* SLOCK0 = 0 */
if (mb86a16_write(state, 0x32, 0x02 | (loop << 2)) < 0) { if (mb86a16_write(state, 0x32, 0x02 | (loop << 2)) < 0) {
dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error");
return -EREMOTEIO; return -EREMOTEIO;
...@@ -973,7 +975,7 @@ static int SEQ_set(struct mb86a16_state *state, unsigned char loop) ...@@ -973,7 +975,7 @@ static int SEQ_set(struct mb86a16_state *state, unsigned char loop)
static int iq_vt_set(struct mb86a16_state *state, unsigned char IQINV) static int iq_vt_set(struct mb86a16_state *state, unsigned char IQINV)
{ {
// Viterbi Rate, IQ Settings /* Viterbi Rate, IQ Settings */
if (mb86a16_write(state, 0x06, 0xdf | (IQINV << 5)) < 0) { if (mb86a16_write(state, 0x06, 0xdf | (IQINV << 5)) < 0) {
dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error");
return -EREMOTEIO; return -EREMOTEIO;
...@@ -1031,7 +1033,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) ...@@ -1031,7 +1033,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
unsigned char TIMINT1, TIMINT2, TIMEXT; unsigned char TIMINT1, TIMINT2, TIMEXT;
unsigned char S0T, S1T; unsigned char S0T, S1T;
unsigned char S2T; unsigned char S2T;
// unsigned char S2T, S3T; /* unsigned char S2T, S3T; */
unsigned char S4T, S5T; unsigned char S4T, S5T;
unsigned char AFCEX_L, AFCEX_H; unsigned char AFCEX_L, AFCEX_H;
unsigned char R; unsigned char R;
...@@ -1052,7 +1054,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) ...@@ -1052,7 +1054,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
int temp_freq, delta_freq; int temp_freq, delta_freq;
int dagcm[4]; int dagcm[4];
int smrt_d; int smrt_d;
// int freq_err; /* int freq_err; */
int n; int n;
int ret = -1; int ret = -1;
int sync; int sync;
...@@ -1093,19 +1095,19 @@ static int mb86a16_set_fe(struct mb86a16_state *state) ...@@ -1093,19 +1095,19 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
} }
if (EN_set(state, CREN, AFCEN) < 0) { if (EN_set(state, CREN, AFCEN) < 0) {
dprintk(verbose, MB86A16_ERROR, 1, "EN set error"); dprintk(verbose, MB86A16_ERROR, 1, "EN set error");
return -1; // (0, 0) return -1; /* (0, 0) */
} }
if (AFCEXEN_set(state, AFCEXEN, state->srate) < 0) { if (AFCEXEN_set(state, AFCEXEN, state->srate) < 0) {
dprintk(verbose, MB86A16_ERROR, 1, "AFCEXEN set error"); dprintk(verbose, MB86A16_ERROR, 1, "AFCEXEN set error");
return -1; // (1, smrt) = (1, symbolrate) return -1; /* (1, smrt) = (1, symbolrate) */
} }
if (CNTM_set(state, TIMINT1, TIMINT2, TIMEXT) < 0) { if (CNTM_set(state, TIMINT1, TIMINT2, TIMEXT) < 0) {
dprintk(verbose, MB86A16_ERROR, 1, "CNTM set error"); dprintk(verbose, MB86A16_ERROR, 1, "CNTM set error");
return -1; // (0, 1, 2) return -1; /* (0, 1, 2) */
} }
if (S01T_set(state, S1T, S0T) < 0) { if (S01T_set(state, S1T, S0T) < 0) {
dprintk(verbose, MB86A16_ERROR, 1, "S01T set error"); dprintk(verbose, MB86A16_ERROR, 1, "S01T set error");
return -1; // (0, 0) return -1; /* (0, 0) */
} }
smrt_info_get(state, state->srate); smrt_info_get(state, state->srate);
if (smrt_set(state, state->srate) < 0) { if (smrt_set(state, state->srate) < 0) {
...@@ -1133,13 +1135,15 @@ static int mb86a16_set_fe(struct mb86a16_state *state) ...@@ -1133,13 +1135,15 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
ftemp = ftemp + swp_ofs; ftemp = ftemp + swp_ofs;
vmax++; vmax++;
// Upper bound /* Upper bound */
if (ftemp > 2150000) { if (ftemp > 2150000) {
loop = 0; loop = 0;
vmax--; vmax--;
} else {
if ((ftemp == 2150000) ||
(ftemp - state->frequency * 1000 >= fcp + state->srate / 4))
loop = 0;
} }
else if ((ftemp == 2150000) || (ftemp - state->frequency * 1000 >= fcp + state->srate / 4))
loop = 0;
} }
loop = 1; loop = 1;
...@@ -1149,13 +1153,15 @@ static int mb86a16_set_fe(struct mb86a16_state *state) ...@@ -1149,13 +1153,15 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
ftemp = ftemp - swp_ofs; ftemp = ftemp - swp_ofs;
vmin--; vmin--;
// Lower bound /* Lower bound */
if (ftemp < 950000) { if (ftemp < 950000) {
loop = 0; loop = 0;
vmin++; vmin++;
} else {
if ((ftemp == 950000) ||
(state->frequency * 1000 - ftemp >= fcp + state->srate / 4))
loop = 0;
} }
else if ((ftemp == 950000) || (state->frequency * 1000 - ftemp >= fcp + state->srate / 4))
loop = 0;
} }
wait_t = (8000 + state->srate / 2) / state->srate; wait_t = (8000 + state->srate / 2) / state->srate;
...@@ -1199,7 +1205,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) ...@@ -1199,7 +1205,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
V[30 + v] = SIG1 ; V[30 + v] = SIG1 ;
swp_freq = swp_freq_calcuation(state, i, v, V, vmax, vmin, swp_freq = swp_freq_calcuation(state, i, v, V, vmax, vmin,
SIG1MIN, fOSC, afcex_freq, SIG1MIN, fOSC, afcex_freq,
swp_ofs, &SIG1); //changed swp_ofs, &SIG1); /* changed */
signal_dupl = 0; signal_dupl = 0;
for (j = 0; j < prev_freq_num; j++) { for (j = 0; j < prev_freq_num; j++) {
...@@ -1291,7 +1297,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) ...@@ -1291,7 +1297,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
dprintk(verbose, MB86A16_ERROR, 1, "srst error"); dprintk(verbose, MB86A16_ERROR, 1, "srst error");
return -1; return -1;
} }
// delay 4~200 /* delay 4~200 */
wait_t = 200000 / state->master_clk + 200000 / state->srate; wait_t = 200000 / state->master_clk + 200000 / state->srate;
msleep(wait_t); msleep(wait_t);
afcerr = afcerr_chk(state); afcerr = afcerr_chk(state);
...@@ -1452,7 +1458,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) ...@@ -1452,7 +1458,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
S2T = 7; S4T = 2; S5T = 8; ETH = 7; VIA = 2; S2T = 7; S4T = 2; S5T = 8; ETH = 7; VIA = 2;
wait_t = 7 + (2097152 + state->srate / 2) / state->srate; wait_t = 7 + (2097152 + state->srate / 2) / state->srate;
} }
wait_t *= 2; /* FOS */ wait_t *= 2; /* FOS */
S2T_set(state, S2T); S2T_set(state, S2T);
S45T_set(state, S4T, S5T); S45T_set(state, S4T, S5T);
Vi_set(state, ETH, VIA); Vi_set(state, ETH, VIA);
...@@ -1461,13 +1467,14 @@ static int mb86a16_set_fe(struct mb86a16_state *state) ...@@ -1461,13 +1467,14 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
sync = sync_chk(state, &VIRM); sync = sync_chk(state, &VIRM);
dprintk(verbose, MB86A16_INFO, 1, "-------- Viterbi=[%d] SYNC=[%d] ---------", VIRM, sync); dprintk(verbose, MB86A16_INFO, 1, "-------- Viterbi=[%d] SYNC=[%d] ---------", VIRM, sync);
if (VIRM) { if (VIRM) {
if (VIRM == 4) { // 5/6 if (VIRM == 4) {
/* 5/6 */
if (SIG1 > 110) if (SIG1 > 110)
wait_t = ( 786432 + state->srate / 2) / state->srate; wait_t = (786432 + state->srate / 2) / state->srate;
else else
wait_t = (1572864 + state->srate / 2) / state->srate; wait_t = (1572864 + state->srate / 2) / state->srate;
if (state->srate < 5000) if (state->srate < 5000)
// FIXME ! , should be a long wait ! /* FIXME ! , should be a long wait ! */
msleep_interruptible(wait_t); msleep_interruptible(wait_t);
else else
msleep_interruptible(wait_t); msleep_interruptible(wait_t);
...@@ -1477,9 +1484,9 @@ static int mb86a16_set_fe(struct mb86a16_state *state) ...@@ -1477,9 +1484,9 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
FEC_srst(state); FEC_srst(state);
} }
} }
// 1/2, 2/3, 3/4, 7/8 /* 1/2, 2/3, 3/4, 7/8 */
if (SIG1 > 110) if (SIG1 > 110)
wait_t = ( 786432 + state->srate / 2) / state->srate; wait_t = (786432 + state->srate / 2) / state->srate;
else else
wait_t = (1572864 + state->srate / 2) / state->srate; wait_t = (1572864 + state->srate / 2) / state->srate;
msleep_interruptible(wait_t); msleep_interruptible(wait_t);
...@@ -1491,7 +1498,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state) ...@@ -1491,7 +1498,7 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
} }
} }
} else { } else {
dprintk (verbose, MB86A16_INFO, 1, "NO -- SIGNAL"); dprintk(verbose, MB86A16_INFO, 1, "NO -- SIGNAL");
ret = -1; ret = -1;
} }
...@@ -1846,7 +1853,7 @@ struct dvb_frontend *mb86a16_attach(const struct mb86a16_config *config, ...@@ -1846,7 +1853,7 @@ struct dvb_frontend *mb86a16_attach(const struct mb86a16_config *config,
u8 dev_id = 0; u8 dev_id = 0;
struct mb86a16_state *state = NULL; struct mb86a16_state *state = NULL;
state = kmalloc(sizeof (struct mb86a16_state), GFP_KERNEL); state = kmalloc(sizeof(struct mb86a16_state), GFP_KERNEL);
if (state == NULL) if (state == NULL)
goto error; goto error;
...@@ -1857,7 +1864,7 @@ struct dvb_frontend *mb86a16_attach(const struct mb86a16_config *config, ...@@ -1857,7 +1864,7 @@ struct dvb_frontend *mb86a16_attach(const struct mb86a16_config *config,
if (dev_id != 0xfe) if (dev_id != 0xfe)
goto error; goto error;
memcpy(&state->frontend.ops, &mb86a16_ops, sizeof (struct dvb_frontend_ops)); memcpy(&state->frontend.ops, &mb86a16_ops, sizeof(struct dvb_frontend_ops));
state->frontend.demodulator_priv = state; state->frontend.demodulator_priv = state;
state->frontend.ops.set_voltage = state->config->set_voltage; state->frontend.ops.set_voltage = state->config->set_voltage;
......
...@@ -35,4 +35,4 @@ extern struct dvb_frontend *mb86a16_attach(const struct mb86a16_config *config, ...@@ -35,4 +35,4 @@ extern struct dvb_frontend *mb86a16_attach(const struct mb86a16_config *config,
struct i2c_adapter *i2c_adap); struct i2c_adapter *i2c_adap);
#endif //__MB86A16_H #endif /* __MB86A16_H */
...@@ -148,4 +148,4 @@ ...@@ -148,4 +148,4 @@
#define MB86A16_DISTMON 0x52 #define MB86A16_DISTMON 0x52
#define MB86A16_VERSION 0x7f #define MB86A16_VERSION 0x7f
#endif //__MB86A16_PRIV_H #endif /* __MB86A16_PRIV_H */
...@@ -45,7 +45,7 @@ static int tda665x_read(struct tda665x_state *state, u8 *buf) ...@@ -45,7 +45,7 @@ static int tda665x_read(struct tda665x_state *state, u8 *buf)
return err; return err;
exit: exit:
printk("%s: I/O Error err=<%d>\n", __func__, err); printk(KERN_ERR "%s: I/O Error err=<%d>\n", __func__, err);
return err; return err;
} }
...@@ -61,7 +61,7 @@ static int tda665x_write(struct tda665x_state *state, u8 *buf, u8 length) ...@@ -61,7 +61,7 @@ static int tda665x_write(struct tda665x_state *state, u8 *buf, u8 length)
return err; return err;
exit: exit:
printk("%s: I/O Error err=<%d>\n", __func__, err); printk(KERN_ERR "%s: I/O Error err=<%d>\n", __func__, err);
return err; return err;
} }
...@@ -79,7 +79,7 @@ static int tda665x_get_state(struct dvb_frontend *fe, ...@@ -79,7 +79,7 @@ static int tda665x_get_state(struct dvb_frontend *fe,
case DVBFE_TUNER_BANDWIDTH: case DVBFE_TUNER_BANDWIDTH:
break; break;
default: default:
printk("%s: Unknown parameter (param=%d)\n", __func__, param); printk(KERN_ERR "%s: Unknown parameter (param=%d)\n", __func__, param);
err = -EINVAL; err = -EINVAL;
break; break;
} }
...@@ -100,13 +100,13 @@ static int tda665x_get_status(struct dvb_frontend *fe, u32 *status) ...@@ -100,13 +100,13 @@ static int tda665x_get_status(struct dvb_frontend *fe, u32 *status)
goto exit; goto exit;
if ((result >> 6) & 0x01) { if ((result >> 6) & 0x01) {
printk("%s: Tuner Phase Locked\n", __func__); printk(KERN_DEBUG "%s: Tuner Phase Locked\n", __func__);
*status = 1; *status = 1;
} }
return err; return err;
exit: exit:
printk("%s: I/O Error\n", __func__); printk(KERN_ERR "%s: I/O Error\n", __func__);
return err; return err;
} }
...@@ -124,7 +124,7 @@ static int tda665x_set_state(struct dvb_frontend *fe, ...@@ -124,7 +124,7 @@ static int tda665x_set_state(struct dvb_frontend *fe,
frequency = tstate->frequency; frequency = tstate->frequency;
if ((frequency < config->frequency_max) || (frequency > config->frequency_min)) { if ((frequency < config->frequency_max) || (frequency > config->frequency_min)) {
printk("%s: Frequency beyond limits, frequency=%d\n", __func__, frequency); printk(KERN_ERR "%s: Frequency beyond limits, frequency=%d\n", __func__, frequency);
return -EINVAL; return -EINVAL;
} }
...@@ -133,8 +133,8 @@ static int tda665x_set_state(struct dvb_frontend *fe, ...@@ -133,8 +133,8 @@ static int tda665x_set_state(struct dvb_frontend *fe,
frequency += config->ref_divider >> 1; frequency += config->ref_divider >> 1;
frequency /= config->ref_divider; frequency /= config->ref_divider;
buf[0] = (u8 ) (frequency & 0x7f00) >> 8; buf[0] = (u8) (frequency & 0x7f00) >> 8;
buf[1] = (u8 ) (frequency & 0x00ff) >> 0; buf[1] = (u8) (frequency & 0x00ff) >> 0;
buf[2] = 0x80 | 0x40 | 0x02; buf[2] = 0x80 | 0x40 | 0x02;
buf[3] = 0x00; buf[3] = 0x00;
...@@ -178,7 +178,7 @@ static int tda665x_set_state(struct dvb_frontend *fe, ...@@ -178,7 +178,7 @@ static int tda665x_set_state(struct dvb_frontend *fe,
goto exit; goto exit;
/* sleep for some time */ /* sleep for some time */
printk("%s: Waiting to Phase LOCK\n", __func__); printk(KERN_DEBUG "%s: Waiting to Phase LOCK\n", __func__);
msleep(20); msleep(20);
/* check status */ /* check status */
err = tda665x_get_status(fe, &status); err = tda665x_get_status(fe, &status);
...@@ -186,19 +186,19 @@ static int tda665x_set_state(struct dvb_frontend *fe, ...@@ -186,19 +186,19 @@ static int tda665x_set_state(struct dvb_frontend *fe,
goto exit; goto exit;
if (status == 1) { if (status == 1) {
printk("%s: Tuner Phase locked: status=%d\n", __func__, status); printk(KERN_DEBUG "%s: Tuner Phase locked: status=%d\n", __func__, status);
state->frequency = frequency; /* cache successful state */ state->frequency = frequency; /* cache successful state */
} else { } else {
printk("%s: No Phase lock: status=%d\n", __func__, status); printk(KERN_ERR "%s: No Phase lock: status=%d\n", __func__, status);
} }
} else { } else {
printk("%s: Unknown parameter (param=%d)\n", __func__, param); printk(KERN_ERR "%s: Unknown parameter (param=%d)\n", __func__, param);
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
exit: exit:
printk("%s: I/O Error\n", __func__); printk(KERN_ERR "%s: I/O Error\n", __func__);
return err; return err;
} }
...@@ -226,7 +226,7 @@ struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, ...@@ -226,7 +226,7 @@ struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe,
struct tda665x_state *state = NULL; struct tda665x_state *state = NULL;
struct dvb_tuner_info *info; struct dvb_tuner_info *info;
state = kzalloc(sizeof (struct tda665x_state), GFP_KERNEL); state = kzalloc(sizeof(struct tda665x_state), GFP_KERNEL);
if (state == NULL) if (state == NULL)
goto exit; goto exit;
...@@ -237,12 +237,12 @@ struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, ...@@ -237,12 +237,12 @@ struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe,
fe->ops.tuner_ops = tda665x_ops; fe->ops.tuner_ops = tda665x_ops;
info = &fe->ops.tuner_ops.info; info = &fe->ops.tuner_ops.info;
memcpy(info->name, config->name, sizeof (config->name)); memcpy(info->name, config->name, sizeof(config->name));
info->frequency_min = config->frequency_min; info->frequency_min = config->frequency_min;
info->frequency_max = config->frequency_max; info->frequency_max = config->frequency_max;
info->frequency_step = config->frequency_offst; info->frequency_step = config->frequency_offst;
printk("%s: Attaching TDA665x (%s) tuner\n", __func__, info->name); printk(KERN_DEBUG "%s: Attaching TDA665x (%s) tuner\n", __func__, info->name);
return fe; return fe;
......
...@@ -40,7 +40,7 @@ extern struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, ...@@ -40,7 +40,7 @@ extern struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe,
#else #else
static inline struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, static inline struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe,
const struct tda665x_config *config, const struct tda665x_config *config,
struct i2c_adapter *i2c) struct i2c_adapter *i2c)
{ {
printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__); printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__);
......
...@@ -137,7 +137,7 @@ static int __devinit hopper_pci_probe(struct pci_dev *pdev, const struct pci_dev ...@@ -137,7 +137,7 @@ static int __devinit hopper_pci_probe(struct pci_dev *pdev, const struct pci_dev
struct mantis_hwconfig *config; struct mantis_hwconfig *config;
int err = 0; int err = 0;
mantis = kzalloc(sizeof (struct mantis_pci), GFP_KERNEL); mantis = kzalloc(sizeof(struct mantis_pci), GFP_KERNEL);
if (mantis == NULL) { if (mantis == NULL) {
printk(KERN_ERR "%s ERROR: Out of memory\n", __func__); printk(KERN_ERR "%s ERROR: Out of memory\n", __func__);
err = -ENOMEM; err = -ENOMEM;
......
...@@ -119,7 +119,7 @@ static int mantis_ts_control(struct dvb_ca_en50221 *en50221, int slot) ...@@ -119,7 +119,7 @@ static int mantis_ts_control(struct dvb_ca_en50221 *en50221, int slot)
struct mantis_pci *mantis = ca->ca_priv; struct mantis_pci *mantis = ca->ca_priv;
dprintk(MANTIS_DEBUG, 1, "Slot(%d): TS control", slot); dprintk(MANTIS_DEBUG, 1, "Slot(%d): TS control", slot);
// mantis_set_direction(mantis, 1); /* Enable TS through CAM */ /* mantis_set_direction(mantis, 1); */ /* Enable TS through CAM */
return 0; return 0;
} }
...@@ -148,7 +148,7 @@ int mantis_ca_init(struct mantis_pci *mantis) ...@@ -148,7 +148,7 @@ int mantis_ca_init(struct mantis_pci *mantis)
int ca_flags = 0, result; int ca_flags = 0, result;
dprintk(MANTIS_DEBUG, 1, "Initializing Mantis CA"); dprintk(MANTIS_DEBUG, 1, "Initializing Mantis CA");
ca = kzalloc(sizeof (struct mantis_ca), GFP_KERNEL); ca = kzalloc(sizeof(struct mantis_ca), GFP_KERNEL);
if (!ca) { if (!ca) {
dprintk(MANTIS_ERROR, 1, "Out of memory!, exiting .."); dprintk(MANTIS_ERROR, 1, "Out of memory!, exiting ..");
result = -ENOMEM; result = -ENOMEM;
......
...@@ -145,7 +145,7 @@ static int __devinit mantis_pci_probe(struct pci_dev *pdev, const struct pci_dev ...@@ -145,7 +145,7 @@ static int __devinit mantis_pci_probe(struct pci_dev *pdev, const struct pci_dev
struct mantis_hwconfig *config; struct mantis_hwconfig *config;
int err = 0; int err = 0;
mantis = kzalloc(sizeof (struct mantis_pci), GFP_KERNEL); mantis = kzalloc(sizeof(struct mantis_pci), GFP_KERNEL);
if (mantis == NULL) { if (mantis == NULL) {
printk(KERN_ERR "%s ERROR: Out of memory\n", __func__); printk(KERN_ERR "%s ERROR: Out of memory\n", __func__);
err = -ENOMEM; err = -ENOMEM;
......
...@@ -36,14 +36,16 @@ static int read_eeprom_byte(struct mantis_pci *mantis, u8 *data, u8 length) ...@@ -36,14 +36,16 @@ static int read_eeprom_byte(struct mantis_pci *mantis, u8 *data, u8 length)
.flags = 0, .flags = 0,
.buf = data, .buf = data,
.len = 1 .len = 1
},{ }, {
.addr = 0x50, .addr = 0x50,
.flags = I2C_M_RD, .flags = I2C_M_RD,
.buf = data, .buf = data,
.len = length .len = length
}, },
}; };
if ((err = i2c_transfer(&mantis->adapter, msg, 2)) < 0) {
err = i2c_transfer(&mantis->adapter, msg, 2);
if (err < 0) {
dprintk(verbose, MANTIS_ERROR, 1, dprintk(verbose, MANTIS_ERROR, 1,
"ERROR: i2c read: < err=%i d0=0x%02x d1=0x%02x >", "ERROR: i2c read: < err=%i d0=0x%02x d1=0x%02x >",
err, data[0], data[1]); err, data[0], data[1]);
...@@ -65,7 +67,8 @@ static int write_eeprom_byte(struct mantis_pci *mantis, u8 *data, u8 length) ...@@ -65,7 +67,8 @@ static int write_eeprom_byte(struct mantis_pci *mantis, u8 *data, u8 length)
.len = length .len = length
}; };
if ((err = i2c_transfer(&mantis->adapter, &msg, 1)) < 0) { err = i2c_transfer(&mantis->adapter, &msg, 1);
if (err < 0) {
dprintk(verbose, MANTIS_ERROR, 1, dprintk(verbose, MANTIS_ERROR, 1,
"ERROR: i2c write: < err=%i length=0x%02x d0=0x%02x, d1=0x%02x >", "ERROR: i2c write: < err=%i length=0x%02x d0=0x%02x, d1=0x%02x >",
err, length, data[0], data[1]); err, length, data[0], data[1]);
...@@ -81,7 +84,8 @@ static int get_mac_address(struct mantis_pci *mantis) ...@@ -81,7 +84,8 @@ static int get_mac_address(struct mantis_pci *mantis)
int err; int err;
mantis->mac_address[0] = 0x08; mantis->mac_address[0] = 0x08;
if ((err = read_eeprom_byte(mantis, &mantis->mac_address[0], 6)) < 0) { err = read_eeprom_byte(mantis, &mantis->mac_address[0], 6);
if (err < 0) {
dprintk(verbose, MANTIS_ERROR, 1, "Mantis EEPROM read error"); dprintk(verbose, MANTIS_ERROR, 1, "Mantis EEPROM read error");
return err; return err;
...@@ -106,25 +110,25 @@ struct mantis_hwconfig unknown_device = { ...@@ -106,25 +110,25 @@ struct mantis_hwconfig unknown_device = {
static void mantis_load_config(struct mantis_pci *mantis) static void mantis_load_config(struct mantis_pci *mantis)
{ {
switch (mantis->subsystem_device) { switch (mantis->subsystem_device) {
case MANTIS_VP_1033_DVB_S: // VP-1033 case MANTIS_VP_1033_DVB_S: /* VP-1033 */
mantis->hwconfig = &vp1033_mantis_config; mantis->hwconfig = &vp1033_mantis_config;
break; break;
case MANTIS_VP_1034_DVB_S: // VP-1034 case MANTIS_VP_1034_DVB_S: /* VP-1034 */
mantis->hwconfig = &vp1034_mantis_config; mantis->hwconfig = &vp1034_mantis_config;
break; break;
case MANTIS_VP_1041_DVB_S2: // VP-1041 case MANTIS_VP_1041_DVB_S2: /* VP-1041 */
case TECHNISAT_SKYSTAR_HD2: case TECHNISAT_SKYSTAR_HD2:
mantis->hwconfig = &vp1041_mantis_config; mantis->hwconfig = &vp1041_mantis_config;
break; break;
case MANTIS_VP_2033_DVB_C: // VP-2033 case MANTIS_VP_2033_DVB_C: /* VP-2033 */
mantis->hwconfig = &vp2033_mantis_config; mantis->hwconfig = &vp2033_mantis_config;
break; break;
case MANTIS_VP_2040_DVB_C: // VP-2040 case MANTIS_VP_2040_DVB_C: /* VP-2040 */
case TERRATEC_CINERGY_C_PCI: // VP-2040 clone case TERRATEC_CINERGY_C_PCI: /* VP-2040 clone */
case TECHNISAT_CABLESTAR_HD2: case TECHNISAT_CABLESTAR_HD2:
mantis->hwconfig = &vp2040_mantis_config; mantis->hwconfig = &vp2040_mantis_config;
break; break;
case MANTIS_VP_3030_DVB_T: // VP-3030 case MANTIS_VP_3030_DVB_T: /* VP-3030 */
mantis->hwconfig = &vp3030_mantis_config; mantis->hwconfig = &vp3030_mantis_config;
break; break;
default: default:
...@@ -149,23 +153,28 @@ int mantis_core_init(struct mantis_pci *mantis) ...@@ -149,23 +153,28 @@ int mantis_core_init(struct mantis_pci *mantis)
mantis->pdev->irq, mantis->latency, mantis->pdev->irq, mantis->latency,
mantis->mantis_addr, mantis->mantis_mmio); mantis->mantis_addr, mantis->mantis_mmio);
if ((err = mantis_i2c_init(mantis)) < 0) { err = mantis_i2c_init(mantis);
if (err < 0) {
dprintk(verbose, MANTIS_ERROR, 1, "Mantis I2C init failed"); dprintk(verbose, MANTIS_ERROR, 1, "Mantis I2C init failed");
return err; return err;
} }
if ((err = get_mac_address(mantis)) < 0) { err = get_mac_address(mantis);
if (err < 0) {
dprintk(verbose, MANTIS_ERROR, 1, "get MAC address failed"); dprintk(verbose, MANTIS_ERROR, 1, "get MAC address failed");
return err; return err;
} }
if ((err = mantis_dma_init(mantis)) < 0) { err = mantis_dma_init(mantis);
if (err < 0) {
dprintk(verbose, MANTIS_ERROR, 1, "Mantis DMA init failed"); dprintk(verbose, MANTIS_ERROR, 1, "Mantis DMA init failed");
return err; return err;
} }
if ((err = mantis_dvb_init(mantis)) < 0) { err = mantis_dvb_init(mantis);
if (err < 0) {
dprintk(verbose, MANTIS_DEBUG, 1, "Mantis DVB init failed"); dprintk(verbose, MANTIS_DEBUG, 1, "Mantis DVB init failed");
return err; return err;
} }
if ((err = mantis_uart_init(mantis)) < 0) { err = mantis_uart_init(mantis);
if (err < 0) {
dprintk(verbose, MANTIS_DEBUG, 1, "Mantis UART init failed"); dprintk(verbose, MANTIS_DEBUG, 1, "Mantis UART init failed");
return err; return err;
} }
...@@ -191,7 +200,7 @@ int mantis_core_exit(struct mantis_pci *mantis) ...@@ -191,7 +200,7 @@ int mantis_core_exit(struct mantis_pci *mantis)
return 0; return 0;
} }
// Turn the given bit on or off. /* Turn the given bit on or off. */
void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value) void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value)
{ {
u32 cur; u32 cur;
...@@ -207,14 +216,15 @@ void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value) ...@@ -207,14 +216,15 @@ void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value)
udelay(100); udelay(100);
} }
//direction = 0 , no CI passthrough ; 1 , CI passthrough /* direction = 0 , no CI passthrough ; 1 , CI passthrough */
void mantis_set_direction(struct mantis_pci *mantis, int direction) void mantis_set_direction(struct mantis_pci *mantis, int direction)
{ {
u32 reg; u32 reg;
reg = mmread(0x28); reg = mmread(0x28);
dprintk(verbose, MANTIS_DEBUG, 1, "TS direction setup"); dprintk(verbose, MANTIS_DEBUG, 1, "TS direction setup");
if (direction == 0x01) { //to CI if (direction == 0x01) {
/* to CI */
reg |= 0x04; reg |= 0x04;
mmwrite(reg, 0x28); mmwrite(reg, 0x28);
reg &= 0xff - 0x04; reg &= 0xff - 0x04;
......
...@@ -33,15 +33,15 @@ ...@@ -33,15 +33,15 @@
struct vendorname { struct vendorname {
__u8 *sub_vendor_name; u8 *sub_vendor_name;
__u32 sub_vendor_id; u32 sub_vendor_id;
}; };
struct devicetype { struct devicetype {
__u8 *sub_device_name; u8 *sub_device_name;
__u32 sub_device_id; u32 sub_device_id;
__u8 device_type; u8 device_type;
__u32 type_flags; u32 type_flags;
}; };
...@@ -54,4 +54,4 @@ extern int mantis_i2c_exit(struct mantis_pci *mantis); ...@@ -54,4 +54,4 @@ extern int mantis_i2c_exit(struct mantis_pci *mantis);
extern int mantis_core_init(struct mantis_pci *mantis); extern int mantis_core_init(struct mantis_pci *mantis);
extern int mantis_core_exit(struct mantis_pci *mantis); extern int mantis_core_exit(struct mantis_pci *mantis);
#endif //__MANTIS_CORE_H #endif /* __MANTIS_CORE_H */
...@@ -43,10 +43,10 @@ ...@@ -43,10 +43,10 @@
#define RISC_IRQ (0x01 << 24) #define RISC_IRQ (0x01 << 24)
#define RISC_STATUS(status) ((((~status) & 0x0f) << 20) | ((status & 0x0f) << 16)) #define RISC_STATUS(status) ((((~status) & 0x0f) << 20) | ((status & 0x0f) << 16))
#define RISC_FLUSH() mantis->risc_pos = 0 #define RISC_FLUSH() (mantis->risc_pos = 0)
#define RISC_INSTR(opcode) mantis->risc_cpu[mantis->risc_pos++] = cpu_to_le32(opcode) #define RISC_INSTR(opcode) (mantis->risc_cpu[mantis->risc_pos++] = cpu_to_le32(opcode))
#define MANTIS_BUF_SIZE 64 * 1024 #define MANTIS_BUF_SIZE (64 * 1024)
#define MANTIS_BLOCK_BYTES (MANTIS_BUF_SIZE >> 4) #define MANTIS_BLOCK_BYTES (MANTIS_BUF_SIZE >> 4)
#define MANTIS_BLOCK_COUNT (1 << 4) #define MANTIS_BLOCK_COUNT (1 << 4)
#define MANTIS_RISC_SIZE PAGE_SIZE #define MANTIS_RISC_SIZE PAGE_SIZE
...@@ -158,7 +158,8 @@ int mantis_dma_init(struct mantis_pci *mantis) ...@@ -158,7 +158,8 @@ int mantis_dma_init(struct mantis_pci *mantis)
goto err; goto err;
} }
if ((err = mantis_calc_lines(mantis)) < 0) { err = mantis_calc_lines(mantis);
if (err < 0) {
dprintk(MANTIS_ERROR, 1, "Mantis calc lines failed"); dprintk(MANTIS_ERROR, 1, "Mantis calc lines failed");
goto err; goto err;
...@@ -248,7 +249,7 @@ void mantis_dma_xfer(unsigned long data) ...@@ -248,7 +249,7 @@ void mantis_dma_xfer(unsigned long data)
dprintk(MANTIS_DEBUG, 1, "last block=[%d] finished block=[%d]", dprintk(MANTIS_DEBUG, 1, "last block=[%d] finished block=[%d]",
mantis->last_block, mantis->finished_block); mantis->last_block, mantis->finished_block);
(config->ts_size ? dvb_dmx_swfilter_204: dvb_dmx_swfilter) (config->ts_size ? dvb_dmx_swfilter_204 : dvb_dmx_swfilter)
(&mantis->demux, &mantis->buf_cpu[mantis->last_block * MANTIS_BLOCK_BYTES], MANTIS_BLOCK_BYTES); (&mantis->demux, &mantis->buf_cpu[mantis->last_block * MANTIS_BLOCK_BYTES], MANTIS_BLOCK_BYTES);
mantis->last_block = (mantis->last_block + 1) % MANTIS_BLOCK_COUNT; mantis->last_block = (mantis->last_block + 1) % MANTIS_BLOCK_COUNT;
} }
......
...@@ -116,7 +116,6 @@ static int mantis_dvb_start_feed(struct dvb_demux_feed *dvbdmxfeed) ...@@ -116,7 +116,6 @@ static int mantis_dvb_start_feed(struct dvb_demux_feed *dvbdmxfeed)
if (mantis->feeds == 1) { if (mantis->feeds == 1) {
dprintk(MANTIS_DEBUG, 1, "mantis start feed & dma"); dprintk(MANTIS_DEBUG, 1, "mantis start feed & dma");
printk("mantis start feed & dma\n");
mantis_dma_start(mantis); mantis_dma_start(mantis);
} }
...@@ -137,7 +136,6 @@ static int mantis_dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) ...@@ -137,7 +136,6 @@ static int mantis_dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
mantis->feeds--; mantis->feeds--;
if (mantis->feeds == 0) { if (mantis->feeds == 0) {
dprintk(MANTIS_DEBUG, 1, "mantis stop feed and dma"); dprintk(MANTIS_DEBUG, 1, "mantis stop feed and dma");
printk("mantis stop feed and dma\n");
mantis_dma_stop(mantis); mantis_dma_stop(mantis);
} }
...@@ -204,9 +202,9 @@ int __devinit mantis_dvb_init(struct mantis_pci *mantis) ...@@ -204,9 +202,9 @@ int __devinit mantis_dvb_init(struct mantis_pci *mantis)
} }
mantis->fe_mem.source = DMX_MEMORY_FE; mantis->fe_mem.source = DMX_MEMORY_FE;
result = mantis->demux.dmx.add_frontend(&mantis->demux.dmx,&mantis->fe_mem); result = mantis->demux.dmx.add_frontend(&mantis->demux.dmx, &mantis->fe_mem);
if (result < 0) { if (result < 0) {
dprintk(MANTIS_ERROR, 1,"dvb_dmx_init failed, ERROR=%d", result); dprintk(MANTIS_ERROR, 1, "dvb_dmx_init failed, ERROR=%d", result);
goto err3; goto err3;
} }
...@@ -224,10 +222,6 @@ int __devinit mantis_dvb_init(struct mantis_pci *mantis) ...@@ -224,10 +222,6 @@ int __devinit mantis_dvb_init(struct mantis_pci *mantis)
dprintk(MANTIS_ERROR, 1, "!!! NO Frontends found !!!"); dprintk(MANTIS_ERROR, 1, "!!! NO Frontends found !!!");
goto err5; goto err5;
} else { } else {
// if (mantis->dvb_adapter == NULL) {
// dprintk(MANTIS_ERROR, 1, "DVB adapter <NULL>");
// goto err5;
// }
if (mantis->fe == NULL) { if (mantis->fe == NULL) {
dprintk(MANTIS_ERROR, 1, "FE <NULL>"); dprintk(MANTIS_ERROR, 1, "FE <NULL>");
goto err5; goto err5;
...@@ -277,7 +271,7 @@ int __devexit mantis_dvb_exit(struct mantis_pci *mantis) ...@@ -277,7 +271,7 @@ int __devexit mantis_dvb_exit(struct mantis_pci *mantis)
int err; int err;
if (mantis->fe) { if (mantis->fe) {
// mantis_ca_exit(mantis); /* mantis_ca_exit(mantis); */
err = mantis_frontend_shutdown(mantis); err = mantis_frontend_shutdown(mantis);
if (err != 0) if (err != 0)
dprintk(MANTIS_ERROR, 1, "Frontend exit while POWER ON! <%d>", err); dprintk(MANTIS_ERROR, 1, "Frontend exit while POWER ON! <%d>", err);
......
...@@ -225,7 +225,7 @@ int __devinit mantis_i2c_init(struct mantis_pci *mantis) ...@@ -225,7 +225,7 @@ int __devinit mantis_i2c_init(struct mantis_pci *mantis)
init_waitqueue_head(&mantis->i2c_wq); init_waitqueue_head(&mantis->i2c_wq);
mutex_init(&mantis->i2c_lock); mutex_init(&mantis->i2c_lock);
strncpy(i2c_adapter->name, "Mantis I2C", sizeof (i2c_adapter->name)); strncpy(i2c_adapter->name, "Mantis I2C", sizeof(i2c_adapter->name));
i2c_set_adapdata(i2c_adapter, mantis); i2c_set_adapdata(i2c_adapter, mantis);
i2c_adapter->owner = THIS_MODULE; i2c_adapter->owner = THIS_MODULE;
......
...@@ -36,9 +36,9 @@ static struct ir_scancode mantis_ir_table[] = { ...@@ -36,9 +36,9 @@ static struct ir_scancode mantis_ir_table[] = {
{ 0x29, KEY_POWER }, { 0x29, KEY_POWER },
{ 0x28, KEY_FAVORITES }, { 0x28, KEY_FAVORITES },
{ 0x30, KEY_TEXT }, { 0x30, KEY_TEXT },
{ 0x17, KEY_INFO }, // Preview { 0x17, KEY_INFO }, /* Preview */
{ 0x23, KEY_EPG }, { 0x23, KEY_EPG },
{ 0x3b, KEY_F22 },// Record List { 0x3b, KEY_F22 }, /* Record List */
{ 0x3c, KEY_1 }, { 0x3c, KEY_1 },
{ 0x3e, KEY_2 }, { 0x3e, KEY_2 },
{ 0x39, KEY_3 }, { 0x39, KEY_3 },
...@@ -71,22 +71,22 @@ static struct ir_scancode mantis_ir_table[] = { ...@@ -71,22 +71,22 @@ static struct ir_scancode mantis_ir_table[] = {
{ 0x1f, KEY_REWIND }, { 0x1f, KEY_REWIND },
{ 0x2d, KEY_FASTFORWARD }, { 0x2d, KEY_FASTFORWARD },
{ 0x1e, KEY_PREVIOUS }, // Replay |< { 0x1e, KEY_PREVIOUS }, /* Replay |< */
{ 0x1d, KEY_NEXT }, // Skip >| { 0x1d, KEY_NEXT }, /* Skip >| */
{ 0x0b, KEY_CAMERA }, // Capture { 0x0b, KEY_CAMERA }, /* Capture */
{ 0x0f, KEY_LANGUAGE }, // SAP { 0x0f, KEY_LANGUAGE }, /* SAP */
{ 0x18, KEY_MODE }, // PIP { 0x18, KEY_MODE }, /* PIP */
{ 0x12, KEY_ZOOM }, // Full screen, { 0x12, KEY_ZOOM }, /* Full screen */
{ 0x1c, KEY_SUBTITLE }, { 0x1c, KEY_SUBTITLE },
{ 0x2f, KEY_MUTE }, { 0x2f, KEY_MUTE },
{ 0x16, KEY_F20 }, // L/R, { 0x16, KEY_F20 }, /* L/R */
{ 0x38, KEY_F21 }, // Hibernate, { 0x38, KEY_F21 }, /* Hibernate */
{ 0x37, KEY_SWITCHVIDEOMODE }, // A/V { 0x37, KEY_SWITCHVIDEOMODE }, /* A/V */
{ 0x31, KEY_AGAIN }, // Recall, { 0x31, KEY_AGAIN }, /* Recall */
{ 0x1a, KEY_KPPLUS }, // Zoom+, { 0x1a, KEY_KPPLUS }, /* Zoom+ */
{ 0x19, KEY_KPMINUS }, // Zoom-, { 0x19, KEY_KPMINUS }, /* Zoom- */
{ 0x27, KEY_RED }, { 0x27, KEY_RED },
{ 0x0C, KEY_GREEN }, { 0x0C, KEY_GREEN },
{ 0x01, KEY_YELLOW }, { 0x01, KEY_YELLOW },
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#define MANTIS_INT_RISCEN (0x01 << 27) #define MANTIS_INT_RISCEN (0x01 << 27)
#define MANTIS_INT_I2CRACK (0x01 << 26) #define MANTIS_INT_I2CRACK (0x01 << 26)
//#define MANTIS_INT_GPIF (0xff << 12) /* #define MANTIS_INT_GPIF (0xff << 12) */
#define MANTIS_INT_PCMCIA7 (0x01 << 19) #define MANTIS_INT_PCMCIA7 (0x01 << 19)
#define MANTIS_INT_PCMCIA6 (0x01 << 18) #define MANTIS_INT_PCMCIA6 (0x01 << 18)
......
...@@ -93,7 +93,7 @@ int lgtdqcs001f_tuner_set(struct dvb_frontend *fe, ...@@ -93,7 +93,7 @@ int lgtdqcs001f_tuner_set(struct dvb_frontend *fe,
u32 div; u32 div;
struct i2c_msg msg = {.addr = 0x61, .flags = 0, .buf = buf, .len = sizeof (buf) }; struct i2c_msg msg = {.addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf)};
div = params->frequency / 250; div = params->frequency / 250;
...@@ -140,12 +140,12 @@ int lgtdqcs001f_set_symbol_rate(struct dvb_frontend *fe, ...@@ -140,12 +140,12 @@ int lgtdqcs001f_set_symbol_rate(struct dvb_frontend *fe,
aclk = 0xb4; aclk = 0xb4;
bclk = 0x51; bclk = 0x51;
} }
stv0299_writereg (fe, 0x13, aclk); stv0299_writereg(fe, 0x13, aclk);
stv0299_writereg (fe, 0x14, bclk); stv0299_writereg(fe, 0x14, bclk);
stv0299_writereg (fe, 0x1f, (ratio >> 16) & 0xff); stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
stv0299_writereg (fe, 0x20, (ratio >> 8) & 0xff); stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff);
stv0299_writereg (fe, 0x21, (ratio ) & 0xf0); stv0299_writereg(fe, 0x21, ratio & 0xf0);
return 0; return 0;
} }
......
...@@ -62,7 +62,7 @@ int vp1034_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) ...@@ -62,7 +62,7 @@ int vp1034_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
dprintk(MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN"); dprintk(MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN");
break; break;
default: default:
dprintk(MANTIS_ERROR, 1, "Invalid = (%d)", (u32 ) voltage); dprintk(MANTIS_ERROR, 1, "Invalid = (%d)", (u32) voltage);
return -EINVAL; return -EINVAL;
} }
mmwrite(0x00, MANTIS_GPIF_DOUT); mmwrite(0x00, MANTIS_GPIF_DOUT);
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
static const struct stb0899_s1_reg vp1041_stb0899_s1_init_1[] = { static const struct stb0899_s1_reg vp1041_stb0899_s1_init_1[] = {
// 0x0000000b , /* SYSREG */ /* 0x0000000b, *//* SYSREG */
{ STB0899_DEV_ID , 0x30 }, { STB0899_DEV_ID , 0x30 },
{ STB0899_DISCNTRL1 , 0x32 }, { STB0899_DISCNTRL1 , 0x32 },
{ STB0899_DISCNTRL2 , 0x80 }, { STB0899_DISCNTRL2 , 0x80 },
...@@ -55,7 +55,7 @@ static const struct stb0899_s1_reg vp1041_stb0899_s1_init_1[] = { ...@@ -55,7 +55,7 @@ static const struct stb0899_s1_reg vp1041_stb0899_s1_init_1[] = {
{ STB0899_DISSTATUS , 0x20 }, { STB0899_DISSTATUS , 0x20 },
{ STB0899_DISF22 , 0x99 }, { STB0899_DISF22 , 0x99 },
{ STB0899_DISF22RX , 0xa8 }, { STB0899_DISF22RX , 0xa8 },
//SYSREG ? /* SYSREG ? */
{ STB0899_ACRPRESC , 0x11 }, { STB0899_ACRPRESC , 0x11 },
{ STB0899_ACRDIV1 , 0x0a }, { STB0899_ACRDIV1 , 0x0a },
{ STB0899_ACRDIV2 , 0x05 }, { STB0899_ACRDIV2 , 0x05 },
...@@ -323,9 +323,8 @@ static int vp1041_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * ...@@ -323,9 +323,8 @@ static int vp1041_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
vp1041_stb0899_config.demod_address); vp1041_stb0899_config.demod_address);
if (stb6100_attach(mantis->fe, &vp1041_stb6100_config, adapter)) { if (stb6100_attach(mantis->fe, &vp1041_stb6100_config, adapter)) {
if (!lnbp21_attach(mantis->fe, adapter, 0, 0)) { if (!lnbp21_attach(mantis->fe, adapter, 0, 0))
printk("%s: No LNBP21 found!\n", __func__); dprintk(MANTIS_ERROR, 1, "No LNBP21 found!");
}
} }
} else { } else {
return -EREMOTEIO; return -EREMOTEIO;
......
...@@ -71,7 +71,7 @@ static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe, struct dvb_fronten ...@@ -71,7 +71,7 @@ static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe, struct dvb_fronten
struct i2c_adapter *adapter = &mantis->adapter; struct i2c_adapter *adapter = &mantis->adapter;
u8 buf[6]; u8 buf[6];
struct i2c_msg msg = {.addr = 0x60, .flags = 0, .buf = buf, .len = sizeof (buf) }; struct i2c_msg msg = {.addr = 0x60, .flags = 0, .buf = buf, .len = sizeof(buf)};
int i; int i;
#define CU1216_IF 36125000 #define CU1216_IF 36125000
......
...@@ -53,7 +53,7 @@ static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe, struct dvb_fronten ...@@ -53,7 +53,7 @@ static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe, struct dvb_fronten
struct i2c_adapter *adapter = &mantis->adapter; struct i2c_adapter *adapter = &mantis->adapter;
u8 buf[6]; u8 buf[6];
struct i2c_msg msg = {.addr = 0x60,.flags = 0,.buf = buf,.len = sizeof (buf) }; struct i2c_msg msg = {.addr = 0x60, .flags = 0, .buf = buf, .len = sizeof(buf)};
int i; int i;
#define CU1216_IF 36125000 #define CU1216_IF 36125000
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment