public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf@free.fr>
To: lorin@obs-besancon.fr
Cc: linux-media@vger.kernel.org
Subject: Re: Driver for webcams based on GL860 chip.
Date: Fri, 4 Sep 2009 09:53:03 +0200	[thread overview]
Message-ID: <20090904095303.437d3d0b@tele> (raw)
In-Reply-To: <20090901235543.7hoqudid6sg80o88@webmail.obs-besancon.fr>

On Tue, 01 Sep 2009 23:55:43 +0200
lorin@obs-besancon.fr wrote:

> I would like to add the support for GL860 based webcams within the  
> GSPCA framework.
> 
> A patch (116KB) for that can be found at :
> http://launchpadlibrarian.net/31182405/patchu_gl860g.diff
> 
> This is not a final version, some improvement in the auto detection
> of sensor will be done. Before that I'm waiting for comments about
> what should changed in this patch in order to be accepted.
> 
> Basically there is four managed sensors so that this patch add a new  
> directory in the gspca one, it contains the main part of the driver  
> and the four sub-drivers.

Hi Olivier,

Here are some remarks:

- in gl860/gl860.h, there are complex macros. Please, use functions
  instead.

- in gl860/gl860.c

. don't change the returned values of the virtual functions as:

	static s32  sd_init(struct gspca_dev *gspca_dev);

  (should be int and not s32)

. more generally, it is a bad idea to have s32 variables.

. why are the module parameters read only? (see below)

. some initialization are unuseful as:

		static char sensor[7] = "";

. why is the video control table not static? (if some controls are not
  available for some webcams, just set gspca_dev->ctl_dis)

. in the function gl860_guess_sensor, there is

	if (product_id == 0xf191)
		sd->vsettings.sensor = ID_MI1320;

  This information could be in the device_table, and also, in the
  declaration of this table, '.driver_info = 0' is not useful.

. in the function sd_config, there is no need to set values to 0 as:

	sd->vsettings.mirrorMask = 0;

. in the same function,

	gspca_dev->alt   = 3 + 1;

  is not useful (the value will be reset at streaming start).

. in the function sd_pkt_scan, the line

	switch (*(s16 *)data) {

  may not work either with BE or LE machines.

. in the function sd_mod_init, why are the static module parameters
  moved to the variable vsettings?

. about this same variable, it should be better to set the device
  settings from the module parameters at connect time instead of at
  module load time. This permits to have different webcam types active
  at the same time...

- in the other .c files

. the use of static variables prevents to have more than one active
  webcam.

. there are values >= 0x80 in 'char' tables. These ones should be 's8'
  or 'u8' ('char' may be unsigned).

. using strings to handle binary values is less readable than simple
  hexadecimal values.

Cheers.

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

  reply	other threads:[~2009-09-04  7:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01 21:55 Driver for webcams based on GL860 chip lorin
2009-09-04  7:53 ` Jean-Francois Moine [this message]
2009-09-12 19:33   ` lorin

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=20090904095303.437d3d0b@tele \
    --to=moinejf@free.fr \
    --cc=linux-media@vger.kernel.org \
    --cc=lorin@obs-besancon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox