提交 f5ae4f6f 编写于 作者: M Manu Abraham 提交者: Mauro Carvalho Chehab

V4L/DVB (13809): Fix Checkpatch violations

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