From: Jean-Francois Moine <moinejf@free.fr>
To: Kyle Guinn <elyk03@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 2/2] gspca: Add MR97310A driver
Date: Thu, 15 Jan 2009 13:13:29 +0100 [thread overview]
Message-ID: <20090115131329.175fce4f@free.fr> (raw)
In-Reply-To: <200901142059.41383.elyk03@gmail.com>
On Wed, 14 Jan 2009 20:59:41 -0600
Kyle Guinn <elyk03@gmail.com> wrote:
> gspca: Add MR97310A driver
>
> From: Kyle Guinn <elyk03@gmail.com>
>
> This patch adds support for USB webcams based on the MR97310A chip.
> It was tested with an Aiptek PenCam VGA+ webcam.
Hi again,
Here are some remarks about your patch.
[snip]
> +/* 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.
[snip]
> +/* 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.
> + cam->cam_mode = vga_mode;
> + cam->nmodes = ARRAY_SIZE(vga_mode);
> + return 0;
> +}
[snip]
> +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.
[snip]
> + sd->sof_read = 0;
> +
> + intpipe = usb_sndintpipe(gspca_dev->dev, 0);
> + err_code = usb_clear_halt(gspca_dev->dev, intpipe);
Is this really needed?
> + data[0] = 0x00;
> + data[1] = 0x4d; /* ISOC transfering enable... */
> + reg_w(gspca_dev, data[0], 2);
> + return err_code;
> +}
[snip]
--
Ken ar c'hentan | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
next prev parent reply other threads:[~2009-01-15 12:24 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 [this message]
2009-01-16 3:43 ` Kyle Guinn
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=20090115131329.175fce4f@free.fr \
--to=moinejf@free.fr \
--cc=elyk03@gmail.com \
--cc=linux-media@vger.kernel.org \
/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.