Web lists-archives.org

Re: [Spca50x-devs] Query about delays of 2ms in spca5xx-20060402 driver




Le Vendredi 11 Août 2006 11:52, srivas.ramgopal@xxxxxxxxx a écrit :
> Hi,
>
> I am using a Phillips SPC200NC webcam on a PCMCIA-card.  I am facing a
> very peculiar problem.  Following are the steps I performed.
>
> 1. I connect the webcam to my card, without the spca5xx client driver
> loaded.
> 2. I loaded the spca5xx driver.
> 3. Started streaming using spcaview.  Streaming is successful.
> 4. I unloaded the driver and reloaded the driver.
> 5. Started streaming using spcaview.  Streaming doesn't happen.
>
> On investigation of the spca5xx driver code, I found the following:
>
> 1. When the driver is loaded, the function "zcxx_probeSensor" is
> called, and there are several register read and write operations
> performed.
>
> 2. In the above-mentioned function, there were three 2ms
> delay statements, which were commented.
>
> 3. When I uncommented these delay statements, this problem was resolved.
>
> Following is the code snippett of the function zc3xx_probeSensor:
>
> static int zcxx_probeSensor(struct usb_spca50x *spca50x)
> {
>     int i, j;
>     __u8 retbyte = 0;
>     __u16 checkword = 0;
>    __u16 checkid = 0xffff;
> /* check i2c */
> /* check SIF */
>     for (i = 0; i < SIFTOT; i++) {
> 	spca5xxRegWrite(spca50x->dev, 0xa0, 0x01, 0x0000, NULL, 0);
> 	spca5xxRegWrite(spca50x->dev, 0xa0,
> zcxxi2cSensorSIF[i][SensorId],
> 			0x0010, NULL, 0);
> 	spca5xxRegWrite(spca50x->dev, 0xa0, 0x01, 0x0001, NULL, 0);
> 	spca5xxRegWrite(spca50x->dev, 0xa0, 0x03, 0x0012, NULL, 0);
> 	spca5xxRegWrite(spca50x->dev, 0xa0, 0x01, 0x0012, NULL, 0);
> 	//wait_ms(2);
> 	if (zcxxi2cSensorSIF[i][reg8d] == 0x8d)
> 	    spca5xxRegWrite(spca50x->dev, 0xa0,
> zcxxi2cSensorSIF[i][val8d],
> 			    0x008d, NULL, 0);
> 	wait_ms(150);
> 	retbyte =
> 	    zcxx_i2cWrite(spca50x->dev, zcxxi2cSensorSIF[i][SensorReg1],
> 			  zcxxi2cSensorSIF[i][valSreg1L],
> 			  zcxxi2cSensorSIF[i][valSreg1H]);
> 	//wait_ms(2);
> 	retbyte =
> 	    (zcxx_i2cRead(spca50x->dev,
> zcxxi2cSensorSIF[i][SensorReg1])) &
> 	    0xff;
> 	//wait_ms(2);
>
> Can someone explain the significance of these delay statements and why
> they were commented?
>
> Regards,
> Srivas
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Spca50x-devs mailing list
> Spca50x-devs@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/spca50x-devs
On some hardware these delays seem need, otherwhise not. Thanks for your 
feedback, we know now it is necessarry:)
regards
-- 
Michel Xhaard
http://mxhaard.free.fr

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Spca50x-devs mailing list
Spca50x-devs@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/spca50x-devs