Hi Claudio:

Your driver works for me except for one minor change.  I think the clock
divisor value is actually algorithmic by the following formula:

clock_div_reg = floor(width * height * bytes_per_pixel) / 66000;

I think that the 76X0 scans every pixel no matter what the mode.  Depending
how many of those pixels you actually deliver to USB, you need to slow it
down.  The 66000 number is approximate.

Here is the patch:

--- ov511.c.orig        Thu May 25 10:19:54 2000
+++ ov511.c     Thu May 25 14:01:00 2000
@@ -925,7 +925,7 @@
        }

        for (i = 0; mlist[i].width; i++) {
-               int lncnt, pxcnt;
+               int lncnt, pxcnt, clock;

                if (width != mlist[i].width || height != mlist[i].height)
                        continue;
@@ -951,7 +951,10 @@
                 ov511_reg_write(dev, 0x1c, mlist[i].pxdv);
                 ov511_reg_write(dev, 0x1d, mlist[i].lndv);

-               ov511_i2c_write(dev, 0x11, mlist[i].clock); /* check */
+               /* Calculate and set the clock divisor */
+               clock = ((sub_flag ? (ov511->subw * ov511->subh) : (width * height)) *
+                        (mlist[i].color ? 3 : 2) / 2) / 66000;
+               ov511_i2c_write(dev, 0x11, clock);

                ov511_i2c_write(dev, 0x12, mlist[i].common_A);
                ov511_i2c_write(dev, 0x14, mlist[i].common_C);
@@ -1403,6 +1406,12 @@

                /* Frame end */
                if (cdata[8] & 0x80) {
+#if 1
+                       struct timeval *ts;
+
+                       ts = (struct timeval *)(frame->data + MAX_FRAME_SIZE);
+                       do_gettimeofday (ts);
+#endif
                        PDEBUG(4, "Frame end, curframe = %d, packnum=%d, hw=%d, vw=%d",
                                ov511->curframe, (int)(cdata[ov511->packet_size - 1]),
                                (int)(cdata[9]), (int)(cdata[10]));


The last patch is putting my timeval stuff back in.  If you could leave it,
that would greatly help me out.

Also, if you accept this patch, then the clock entry in the table is not
needed.

Thanks,
Bret



> -----Original Message-----
> From: Claudio Matsuoka [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 24, 2000 4:16 PM
> To: [EMAIL PROTECTED]
> Cc: 'Mark McClelland'; [EMAIL PROTECTED]
> Subject: RE: [linux-usb] [patch]ov511 1.15
>
>
>
> On Wed, 24 May 2000, Bret Wallach wrote:
>
> > That's how it is in older versions of the driver and that's
> what my set up
> > needs to work in monochrome.  Has somebody else found that
> it should be WDIV
> > instead of 8 to work????
>
> Hmm. I think It was my fault. No wonder why grayscale images
> are broken :(
> Thanks for pointing that out.
>
>
> > I see you've added lots of modes.  These modes seem to just
> use however many
> > pixels from the upper left corner of the image.  It seems
> to me that the
> > optics would be better if the center of the image were used.
>
> Yes, I'm currently fixing it. The extra modes were added to
> make certain
> applications that require fixed image sizes happier.
>
>
> > Also, there
> > are 4 mode_list entries for snapshots that are always
> identical to the
> > non-snapshot mode.  Will they ever vary?
>
> Already removed in my development version.
>
>
> > I see you've hacked out subframe support (which was only
> available in
> > 640x480 anyway).  How come?  I happen to need that.  Can I
> add it back in as
> > an if statement for that specific case?
>
> Already fixed. I'm uploading a snapshot of my development code to
> http://helllabs.org/~claudio/ov511/20000524/.
>
>
> > I see you've hacked out timestamp support.  How come?  I
> happen to need that
> > too.  And if you're committed to getting rid of that, you
> probably ought to
> > not allocate the memory for it.
>
> That's not my fault (but I commented out a piece of a dangling
> timestamp code).
>
>
> claudio
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to