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;
.flags = 0,
.buf = b0,
.len = 1
- },{
+ }, {
.addr = state->config->demod_address,
.flags = I2C_M_RD,
.buf = b1,
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;
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;
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)
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;
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;
}
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;
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) &&
(*(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) &&
(*(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);
(*(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);
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) &&
(*(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) &&
(*(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);
(*(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);
(*(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);
} 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;
}
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;
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;
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;
int temp_freq, delta_freq;
int dagcm[4];
int smrt_d;
-// int freq_err;
+/* int freq_err; */
int n;
int ret = -1;
int sync;
}
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) {
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;
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;
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++) {
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);
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);
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);
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);
}
}
} else {
- dprintk (verbose, MB86A16_INFO, 1, "NO -- SIGNAL");
+ dprintk(verbose, MB86A16_INFO, 1, "NO -- SIGNAL");
ret = -1;
}
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;
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;
struct i2c_adapter *i2c_adap);
-#endif //__MB86A16_H
+#endif /* __MB86A16_H */
#define MB86A16_DISTMON 0x52
#define MB86A16_VERSION 0x7f
-#endif //__MB86A16_PRIV_H
+#endif /* __MB86A16_PRIV_H */
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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);
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;
}
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;
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;
#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__);
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;
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;
}
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;
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;
.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]);
.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]);
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;
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:
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;
}
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;
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;
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;
};
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 */
#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
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;
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;
}
if (mantis->feeds == 1) {
dprintk(MANTIS_DEBUG, 1, "mantis start feed & dma");
- printk("mantis start feed & dma\n");
mantis_dma_start(mantis);
}
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);
}
}
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;
}
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;
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);
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;
{ 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 },
{ 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 },
#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)
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;
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;
}
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);
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 },
{ STB0899_DISSTATUS , 0x20 },
{ STB0899_DISF22 , 0x99 },
{ STB0899_DISF22RX , 0xa8 },
- //SYSREG ?
+ /* SYSREG ? */
{ STB0899_ACRPRESC , 0x11 },
{ STB0899_ACRDIV1 , 0x0a },
{ STB0899_ACRDIV2 , 0x05 },
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;
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
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