[Spca50x-devs] autodetection of the sensors fails on freedata autodetection of the sensors fails on freedata WS-620E
- Date: Mon, 24 Jul 2006 22:40:10 +0200 (CEST)
- From: "Stefan Hartsuiker" <sahartsu@xxxxxxxxx>
- Subject: [Spca50x-devs] autodetection of the sensors fails on freedata autodetection of the sensors fails on freedata WS-620E
Hi,
Srivas may be on to something, because it solved my problem with the
autodetection of the sensor.
With kind regards,
Stefan Hartsuiker
-- Orignal Message --
Date: Mon, 24 Jul 2006 19:29:47 +0530
From: <srivas.ramgopal@xxxxxxxxx>
Subject: Re: [Spca50x-devs] Unable to see picture using Phillips
SPC200NC webcam
To: <spca5xx@xxxxxxxxxxxxxxx>
Cc: spca50x-devs@xxxxxxxxxxxxxxxxxxxxx
Message-ID:
<5DE86B4C624D4545B8A5CA1467DB936402FA0B17@xxxxxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"
Hi,
Thanks for your prompt response. The kernel version I'm using is
2.6.15.4. I have a different OHCI driver, because this is a PCMCIA
card. Hence I cannot use the standard OHCI dirver, which is PCI-based.
Now the only difference between these two drivers is that the one I am
using sends an interrupt earlier than the standard PCI-based driver i.e.
an interrupt is sent before 1ms in my case.
Due to this difference, I added a delay of 1 ms between two
spca5xxRegReads and between one spca5xxRegRead and spca5xxRegWrite in
the functions, zcxx_i2cRead and zcxx_i2cWrite. After making this
change, the spca5xx driver behaves properly, by detecting the correct
sensor and retrieving the correct capablities of the webcam, and I am
able to see the picture using spcaview. Following is the code snippet
of the same.
static __u16 zcxx_i2cRead(struct usb_device *dev, __u8 reg)
{
__u8 retbyte = 0;
__u8 retval[] = { 0, 0 };
spca5xxRegWrite(dev, 0xa0, reg, 0x92, NULL, 0);
spca5xxRegWrite(dev, 0xa0, 0x02, 0x90, NULL, 0); // <-read
command
wait_ms(1); // 1 ms delay added
spca5xxRegRead(dev, 0xa1, 0x01, 0x0091, &retbyte, 1); // read
status
wait_ms(1); // 1 ms delay added
spca5xxRegRead(dev, 0xa1, 0x01, 0x0095, &retval[0], 1); // read
Lowbyte
wait_ms(1); // 1 ms delay added
spca5xxRegRead(dev, 0xa1, 0x01, 0x0096, &retval[1], 1); // read
Hightbyte
return ((retval[1] << 8) | retval[0]);
}
static __u8 zcxx_i2cWrite(struct usb_device *dev, __u8 reg, __u8 valL,
__u8 valH)
{
__u8 retbyte = 0;
spca5xxRegWrite(dev, 0xa0, reg, 0x92, NULL, 0);
spca5xxRegWrite(dev, 0xa0, valL, 0x93, NULL, 0);
spca5xxRegWrite(dev, 0xa0, valH, 0x94, NULL, 0);
spca5xxRegWrite(dev, 0xa0, 0x01, 0x90, NULL, 0); // <-write
command
wait_ms(1); // 1 ms delay added
spca5xxRegRead(dev, 0xa1, 0x01, 0x0091, &retbyte, 1); // read
status
return (retbyte);
}
Does this webcam require some kind of delay for between register
read/write operations?
Regards,
-Srivas
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Spca50x-devs mailing list
Spca50x-devs@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/spca50x-devs