Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: AVerMedia 771 problems [everything solved]
Christopher Pascoe wrote:
>> I tested it again, it doesn't work with the sleep. But less head
>> sounds good. Does it sleep when I unload the driver again? I could
>> only load it when needed.
>
> The problem isn't the sleep itself, the problem is that in the CVS code
> (at least), the FE_GET_TUNE_SETTINGS internal IOCTL falls through and puts
> the module to sleep when the frontend queries these parameters (which it
> always does). The attached patch to the CVS version of mt352.c fixes
> this.
This also works for me and the sleep problem is gone. But I still need
other parts of the diff I sent here before. Patch attached.
Dischi
60c60
< .frequency_stepsize = 83333,
---
> .frequency_stepsize = 166667,
95c95
< };
---
> };
124,125c124,125
< static u8 mt352_agc_cfg_av771 [] = { 0x67, 0x10, 0x23, 0x00, 0xFF, 0xFF,
< 0x00, 0xFF, 0x00, 0x40, 0x40 };
---
> static u8 mt352_agc_cfg_av771 [] = { 0x67, 0x10, 0x23, 0x00, 0xFF, 0xFF,
> 0x00, 0xFF, 0x00, 0x40, 0x40 };
174c174
< tps = (1 << 7);
---
> tps |= (1 << 7);
177c177
< tps = (2 << 7);
---
> tps |= (2 << 7);
180c180
< tps = (3 << 7);
---
> tps |= (3 << 7);
183c183
< tps = (4 << 7);
---
> tps |= (4 << 7);
185d184
< case FEC_1_2:
189c188
< return -EINVAL;
---
> ;
205d203
< case FEC_1_2:
209c207
< return -EINVAL;
---
> ;
213,215d210
< case QPSK:
< break;
< case QAM_AUTO:
223c218
< return -EINVAL;
---
> ;
227,229d221
< case TRANSMISSION_MODE_2K:
< case TRANSMISSION_MODE_AUTO:
< break;
234c226
< return -EINVAL;
---
> ;
238,240d229
< case GUARD_INTERVAL_1_32:
< case GUARD_INTERVAL_AUTO:
< break;
251c240
< return -EINVAL;
---
> ;
253c242
<
---
>
255,257d243
< case HIERARCHY_AUTO:
< case HIERARCHY_NONE:
< break;
268c254
< return -EINVAL;
---
> ;
277c263,264
< buf[3] = 0x50;
---
> // buf[3] = 0xf3; /* ACQ_CTL, force parameters, automatic spectral inv */
> buf[3] = 0x50; /* ACQ_CTL, fully automatic parameter search */
303c290
< tmp = (3 * freq) / 500 + IF_FREQUENCYx6;
---
> tmp = (6 * freq) / 1000 + IF_FREQUENCYx6;
307,309d293
< buf[6] = 0x31; /* INPUT_FREQ_(1|0), 20.48MHz clock, 36.166667MHz IF */
< buf[7] = 0x05; /* see MT352 Design Manual page 32 for details */
<
311a296,299
> printk(KERN_DEBUG "setting parameters for 771\n");
> buf[6] = 0xF1;
> buf[7] = 0x06;
>
359a348,349
> buf[6] = 0x31; /* INPUT_FREQ_(1|0), 20.48MHz clock, 36.166667MHz IF */
> buf[7] = 0x05; /* see MT352 Design Manual page 32 for details */
521,524c511,513
< u8 r,snr;
< fe_status_t *status;
< u16 signal;
< struct dvb_frontend_tune_settings *fe_tune_settings;
---
> #ifdef FE_GET_TUNE_SETTINGS
> struct dvb_frontend_tune_settings* fe_tune_settings;
> #endif
532c521,523
< status = arg;
---
> {
> u8 r;
> fe_status_t *status = arg;
534c525,528
< r = mt352_read_register (i2c, 0x00);
---
>
> r = mt352_read_register (i2c, 0x0);
> if (r & (1 << 5))
> *status |= FE_HAS_LOCK;
536c530
< *status = FE_HAS_CARRIER;
---
> *status |= FE_HAS_CARRIER;
539,540d532
< if (r & (1 << 5))
< *status |= FE_HAS_LOCK;
545c537
<
---
>
550a543
> }
553,555c546,550
< *((u32 *) arg) = (mt352_read_register (i2c, 0x0D) << 16) |
< (mt352_read_register (i2c, 0x0E) << 8) |
< (mt352_read_register (i2c, 0x0F));
---
> {
> u32 *ber = (u32 *) arg;
> *ber = (mt352_read_register (i2c, 0xA) << 16) |
> (mt352_read_register (i2c, 0xB) << 8) |
> (mt352_read_register (i2c, 0xC));
556a552
> }
559c555,556
< signal = (mt352_read_register (i2c, 0x12) << 8) |
---
> {
> u16 signal = (mt352_read_register (i2c, 0x12) << 8) |
562a560
> }
565,566c563,565
< snr = mt352_read_register (i2c, 0x09);
< *((u16*) arg) = (snr << 8) | snr;
---
> {
> u8 snr = mt352_read_register (i2c, 0x9);
> *(u16*) arg = (snr << 8) | snr;
567a567
> }
590c590
< return mt352_sleep(i2c);
---
> return mt352_sleep(i2c);
--
Unix: because daemons should serve men, not the other way around.
Home |
Main Index |
Thread Index