From: Kyle Guinn <elyk03@gmail.com>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 2/2] gspca: Add MR97310A driver
Date: Thu, 15 Jan 2009 21:43:04 -0600 [thread overview]
Message-ID: <200901152143.04843.elyk03@gmail.com> (raw)
In-Reply-To: <20090115131329.175fce4f@free.fr>
On Thursday 15 January 2009 06:13:29 Jean-Francois Moine wrote:
> Hi again,
>
> Here are some remarks about your patch.
>
> > +/* the bytes to write are in gspca_dev->usb_buf */
> > +static int reg_w(struct gspca_dev *gspca_dev,
> > + __u16 index, int len)
> > +{
> > + int rc;
> > +
> > + rc = usb_bulk_msg(gspca_dev->dev,
> > + usb_sndbulkpipe(gspca_dev->dev, 4),
> > + gspca_dev->usb_buf, len, 0, 500);
> > + if (rc < 0)
> > + PDEBUG(D_ERR, "reg write [%02x] error %d", index,
> > rc);
> > + return rc;
> > +}
>
> The 'index' parameter is not useful: the register is always in the first
> byte of the buffer.
>
Noted. I used the mars subdriver as a basis for this driver, and apparently
an old version of it at that. Will be fixed in v2.
> > +/* this function is called at probe time */
> > +static int sd_config(struct gspca_dev *gspca_dev,
> > + const struct usb_device_id *id)
> > +{
> > + struct cam *cam;
> > +
> > + cam = &gspca_dev->cam;
> > + cam->epaddr = 0x01;
>
> This variable has been removed in the last versions of gspca.
>
Will be removed in v2.
> > +static int sd_start(struct gspca_dev *gspca_dev)
> > +{
> > + struct sd *sd = (struct sd *) gspca_dev;
> > + __u8 *data = gspca_dev->usb_buf;
> > + int err_code;
> > + int intpipe;
> > +
> > + PDEBUG(D_STREAM, "camera start, iface %d, alt 8",
> > gspca_dev->iface);
> > + err_code = usb_set_interface(gspca_dev->dev,
> > gspca_dev->iface, 8);
> > + if (err_code < 0) {
> > + PDEBUG(D_ERR|D_STREAM, "Set packet size: set
> > interface error");
> > + return err_code;
> > + }
>
> The usb_set_interface() is already done in the gspca main.
>
Also borrowed from the mars subdriver. Will be removed in v2.
> > + sd->sof_read = 0;
> > +
> > + intpipe = usb_sndintpipe(gspca_dev->dev, 0);
> > + err_code = usb_clear_halt(gspca_dev->dev, intpipe);
>
> Is this really needed?
>
Also borrowed from the mars subdriver, and doesn't appear to be necessary for
the camera to work. Will be removed in v2.
Regards,
-Kyle
prev parent reply other threads:[~2009-01-16 3:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-15 2:59 [PATCH 2/2] gspca: Add MR97310A driver Kyle Guinn
2009-01-15 12:13 ` Jean-Francois Moine
2009-01-16 3:43 ` Kyle Guinn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200901152143.04843.elyk03@gmail.com \
--to=elyk03@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=moinejf@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.