From: <ad...@us...> - 2003-04-07 07:01:05
|
Update of /cvsroot/bdadev/NovaTDriver In directory sc8-pr-cvs1:/tmp/cvs-serv3145 Modified Files: device.cpp driver.cpp l64781.cpp saa7146.cpp tuner.cpp Log Message: Synced to linux driver Index: device.cpp =================================================================== RCS file: /cvsroot/bdadev/NovaTDriver/device.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** device.cpp 17 Mar 2003 21:21:53 -0000 1.9 --- device.cpp 7 Apr 2003 07:00:47 -0000 1.10 *************** *** 243,247 **** // the demod parameters based on a newly received TPS block // we could also check for errors and possibly AFC here as well ! TimeOut.QuadPart = 5000; result=KeWaitForSingleObject(&GETCONTEXT(device)->monitorThreadKill, Executive, KernelMode, FALSE, &TimeOut); if(result==STATUS_TIMEOUT) { --- 243,247 ---- // the demod parameters based on a newly received TPS block // we could also check for errors and possibly AFC here as well ! TimeOut.QuadPart = -5000000; result=KeWaitForSingleObject(&GETCONTEXT(device)->monitorThreadKill, Executive, KernelMode, FALSE, &TimeOut); if(result==STATUS_TIMEOUT) { *************** *** 270,274 **** HANDLE hThread; KeClearEvent(&GETCONTEXT(device)->monitorThreadKill); ! result = PsCreateSystemThread(&hThread, THREAD_ALL_ACCESS, NULL, NULL, NULL, (PKSTART_ROUTINE)MonitorThreadProc, device); if (!NT_SUCCESS(result)) { --- 270,274 ---- HANDLE hThread; KeClearEvent(&GETCONTEXT(device)->monitorThreadKill); ! result = PsCreateSystemThread(&hThread, 0L, NULL, NULL, NULL, (PKSTART_ROUTINE)MonitorThreadProc, device); if (!NT_SUCCESS(result)) { *************** *** 316,321 **** //StartMonitoringThread((PKSDEVICE)Pin->Context); } ! if((ToState==KSSTATE_STOP)&&(FromState!=KSSTATE_STOP)) { //StopMonitoringThread((PKSDEVICE)Pin->Context); SAA7146_StopStream((PKSDEVICE)Pin->Context); } --- 316,330 ---- //StartMonitoringThread((PKSDEVICE)Pin->Context); } ! ! if((ToState==KSSTATE_RUN)&&(FromState==KSSTATE_PAUSE)) { //StopMonitoringThread((PKSDEVICE)Pin->Context); + } + + if((ToState==KSSTATE_PAUSE)&&(FromState==KSSTATE_RUN)) { + //StartMonitoringThread((PKSDEVICE)Pin->Context); + //L64781_UpdateParameters((PKSDEVICE)Pin->Context); + } + + if((ToState==KSSTATE_STOP)&&(FromState!=KSSTATE_STOP)) { SAA7146_StopStream((PKSDEVICE)Pin->Context); } *************** *** 327,330 **** --- 336,342 ---- /*****************************************************************************\ * $Log$ + * Revision 1.10 2003/04/07 07:00:47 adcockj + * Synced to linux driver + * * Revision 1.9 2003/03/17 21:21:53 adcockj * Fixes for new streaming code Index: driver.cpp =================================================================== RCS file: /cvsroot/bdadev/NovaTDriver/driver.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** driver.cpp 17 Mar 2003 21:21:53 -0000 1.8 --- driver.cpp 7 Apr 2003 07:00:49 -0000 1.9 *************** *** 314,318 **** /* Reset */ NULL, /* SetDataFormat */ NULL, ! /* SetDeviceState */ OutputSetDeviceState, // This is meant to say output /* Connect */ NULL, /* Disconnect */ NULL, --- 314,318 ---- /* Reset */ NULL, /* SetDataFormat */ NULL, ! /* SetDeviceState */ AntennaSetDeviceState, // This is meant to say antenna /* Connect */ NULL, /* Disconnect */ NULL, *************** *** 325,329 **** /* Reset */ NULL, /* SetDataFormat */ NULL, ! /* SetDeviceState */ AntennaSetDeviceState, // This is meant to say antenna /* Connect */ NULL, /* Disconnect */ NULL, --- 325,329 ---- /* Reset */ NULL, /* SetDataFormat */ NULL, ! /* SetDeviceState */ OutputSetDeviceState, // This is meant to say output /* Connect */ NULL, /* Disconnect */ NULL, *************** *** 537,540 **** --- 537,543 ---- /*****************************************************************************\ * $Log$ + * Revision 1.9 2003/04/07 07:00:49 adcockj + * Synced to linux driver + * * Revision 1.8 2003/03/17 21:21:53 adcockj * Fixes for new streaming code Index: l64781.cpp =================================================================== RCS file: /cvsroot/bdadev/NovaTDriver/l64781.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** l64781.cpp 17 Mar 2003 18:03:47 -0000 1.9 --- l64781.cpp 7 Apr 2003 07:00:49 -0000 1.10 *************** *** 67,73 **** void L64781_Apply_TPS(PKSDEVICE device) { L64781_WriteRegister(device,0x2a,0x01); - L64781_WriteRegister(device,0x2a,0x0a); L64781_WriteRegister(device,0x2a,0x02); } --- 67,74 ---- void L64781_Apply_TPS(PKSDEVICE device) { + L64781_WriteRegister(device,0x2a,0x00); L64781_WriteRegister(device,0x2a,0x01); L64781_WriteRegister(device,0x2a,0x02); + //L64781_WriteRegister(device,0x2a,0x00); } *************** *** 108,112 **** _DbgPrintF(DEBUGLVL_TERSE, ("L64781 initialise")); // Initialise tuner structures to default ! data->tuner.frequency=570000; data->tuner.freq_mult=1000; data->tuner.bandwidth=8; --- 109,113 ---- _DbgPrintF(DEBUGLVL_TERSE, ("L64781 initialise")); // Initialise tuner structures to default ! data->tuner.frequency=481833; data->tuner.freq_mult=1000; data->tuner.bandwidth=8; *************** *** 132,136 **** L64781_WriteRegister(device,0x0B,0x81); // Use internal ADC L64781_WriteRegister(device,0x0C,0x84); // AGC loop gain, and polarity is positive ! L64781_WriteRegister(device,0x0D,0x8E); // Internal ADC outpus two's complement // L64781_WriteRegister(device,0x19,0x92); L64781_WriteRegister(device,0x1E,0x09); // Everything is two's complement, soft bit and CSI_OUT --- 133,137 ---- L64781_WriteRegister(device,0x0B,0x81); // Use internal ADC L64781_WriteRegister(device,0x0C,0x84); // AGC loop gain, and polarity is positive ! L64781_WriteRegister(device,0x0D,0x8C); // Internal ADC outpus two's complement // L64781_WriteRegister(device,0x19,0x92); L64781_WriteRegister(device,0x1E,0x09); // Everything is two's complement, soft bit and CSI_OUT *************** *** 340,348 **** L64781_WriteRegister(device,0x15,data->demodulator.transmit_mode==BDA_XMIT_MODE_2K?1:3); - ddfs_offset_fixed=0x4000-(ppm<<16)/p_bandwidth/1000000; - - L64781_WriteRegister(device,0x22,ddfs_offset_fixed&0xFF); - L64781_WriteRegister(device,0x23,(ddfs_offset_fixed>>8)&0x3F); - unsigned __int64 qwInitFreq=(unsigned __int64)((8-p_bandwidth)*1000000 + 8*ppm); qwInitFreq*=(unsigned __int64)(1<<25); --- 341,344 ---- *************** *** 361,364 **** --- 357,365 ---- L64781_UpdateSPIBias(device,p_bandwidth,p_constellation,p_transmissionmode,p_hp_coderate,p_guardinterval,p_inverted); + ddfs_offset_fixed=0x4000-(ppm<<16)/p_bandwidth/1000000; + + L64781_WriteRegister(device,0x22,ddfs_offset_fixed&0xFF); + L64781_WriteRegister(device,0x23,(ddfs_offset_fixed>>8)&0x3F); + L64781_ReadRegister(device,0x00); // Clear interrupt register L64781_ReadRegister(device,0x01); // DTO *************** *** 414,417 **** --- 415,421 ---- /*****************************************************************************\ * $Log$ + * Revision 1.10 2003/04/07 07:00:49 adcockj + * Synced to linux driver + * * Revision 1.9 2003/03/17 18:03:47 adcockj * Updated stream handling Index: saa7146.cpp =================================================================== RCS file: /cvsroot/bdadev/NovaTDriver/saa7146.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** saa7146.cpp 17 Mar 2003 21:21:53 -0000 1.8 --- saa7146.cpp 7 Apr 2003 07:00:50 -0000 1.9 *************** *** 143,149 **** // get the framework to call our output pin's process ! // function but not asynchronously as we need to clear out the ! // data before the next batch overwrites it ! KsPinAttemptProcessing(GETCONTEXT(device)->pin_out, TRUE); return; --- 143,148 ---- // get the framework to call our output pin's process ! // function asynchronously ! KsPinAttemptProcessing(GETCONTEXT(device)->pin_out, FALSE); return; *************** *** 253,256 **** --- 252,256 ---- GETCONTEXT(device)->counter++; } + //_DbgPrintF(DEBUGLVL_TERSE, ("SAA7146 Got some data")); return STATUS_PENDING; } *************** *** 413,416 **** --- 413,419 ---- /*****************************************************************************\ * $Log$ + * Revision 1.9 2003/04/07 07:00:50 adcockj + * Synced to linux driver + * * Revision 1.8 2003/03/17 21:21:53 adcockj * Fixes for new streaming code Index: tuner.cpp =================================================================== RCS file: /cvsroot/bdadev/NovaTDriver/tuner.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tuner.cpp 4 Mar 2003 08:02:22 -0000 1.5 --- tuner.cpp 7 Apr 2003 07:00:51 -0000 1.6 *************** *** 101,112 **** unsigned char buffer[4]; I2C_INSTRUCTIONS i2c; bob=GETCONTEXT(device)->tuner.frequency*GETCONTEXT(device)->tuner.freq_mult; _DbgPrintF(DEBUGLVL_TERSE, ("Setting tuner frequency to %uHz (%u*%u)",(unsigned int)bob,GETCONTEXT(device)->tuner.frequency,GETCONTEXT(device)->tuner.freq_mult)); ! div=(unsigned __int32)(unsigned __int64)((36000000+bob)/166666); ! buffer[0]=(div>>8)&0x7F; ! buffer[1]=div&0xFF; ! buffer[2]=((div>>10)&0x60)|0x88; ! buffer[3]=0xC0; i2c.address=GETCONTEXT(device)->tuner_address; i2c.bRead=FALSE; --- 101,123 ---- unsigned char buffer[4]; I2C_INSTRUCTIONS i2c; + unsigned char cfg, cpump, band_select; bob=GETCONTEXT(device)->tuner.frequency*GETCONTEXT(device)->tuner.freq_mult; _DbgPrintF(DEBUGLVL_TERSE, ("Setting tuner frequency to %uHz (%u*%u)",(unsigned int)bob,GETCONTEXT(device)->tuner.frequency,GETCONTEXT(device)->tuner.freq_mult)); ! ! div = (unsigned __int32)(unsigned __int64)(36125000 + bob) / 166666; ! cfg = 0x88; ! ! cpump = div < 175000 ? 2 : div < 390000 ? 1 : ! div < 470000 ? 2 : div < 750000 ? 1 : 3; ! ! band_select = div < 175000 ? 0x0e : div < 470000 ? 0x05 : 0x03; ! ! buffer[0] = (div >> 8) & 0x7f; ! buffer[1] = div & 0xff; ! buffer[2] = ((div >> 10) & 0x60) | cfg; ! buffer[3] = cpump | band_select; ! ! i2c.address=GETCONTEXT(device)->tuner_address; i2c.bRead=FALSE; *************** *** 122,125 **** --- 133,139 ---- /*****************************************************************************\ * $Log$ + * Revision 1.6 2003/04/07 07:00:51 adcockj + * Synced to linux driver + * * Revision 1.5 2003/03/04 08:02:22 adcockj * Interim Checkin |