public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 3/6] gspca - sonixj: Add a flag in the driver_info table
Date: Mon, 13 Dec 2010 11:29:23 -0200	[thread overview]
Message-ID: <4D061FB3.7010305@redhat.com> (raw)
In-Reply-To: <20101213140326.569d150d@tele>

Em 13-12-2010 11:03, Jean-Francois Moine escreveu:
> 
> Signed-off-by: Jean-François Moine <moinejf@free.fr>
> 
> diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
> index 5978676..bd5858e 100644
> --- a/drivers/media/video/gspca/sonixj.c
> +++ b/drivers/media/video/gspca/sonixj.c
> @@ -64,6 +64,7 @@ struct sd {
>  	u8 jpegqual;			/* webcam quality */
>  
>  	u8 reg18;
> +	u8 flags;
>  
>  	s8 ag_cnt;
>  #define AG_CNT_START 13
> @@ -96,6 +97,9 @@ enum sensors {
>  	SENSOR_SP80708,
>  };
>  
> +/* device flags */
> +#define PDN_INV	1		/* inverse pin S_PWR_DN / sn_xxx tables */
> +
>  /* V4L2 controls supported by the driver */
>  static void setbrightness(struct gspca_dev *gspca_dev);
>  static void setcontrast(struct gspca_dev *gspca_dev);
> @@ -1763,7 +1767,8 @@ static int sd_config(struct gspca_dev *gspca_dev,
>  	struct cam *cam;
>  
>  	sd->bridge = id->driver_info >> 16;
> -	sd->sensor = id->driver_info;
> +	sd->sensor = id->driver_info >> 8;
> +	sd->flags = id->driver_info;
>  
>  	cam = &gspca_dev->cam;
>  	if (sd->sensor == SENSOR_ADCM1700) {
> @@ -2947,7 +2952,11 @@ static const struct sd_desc sd_desc = {
>  /* -- module initialisation -- */
>  #define BS(bridge, sensor) \
>  	.driver_info = (BRIDGE_ ## bridge << 16) \
> -			| SENSOR_ ## sensor
> +			| (SENSOR_ ## sensor << 8)
> +#define BSF(bridge, sensor, flags) \
> +	.driver_info = (BRIDGE_ ## bridge << 16) \
> +			| (SENSOR_ ## sensor << 8) \
> +			| flags

As "flags" come from a macro, please use "(flags)" instead. This will avoid
the risk of having something bad happening here, if we add some more complex
flags logic.

>  static const __devinitdata struct usb_device_id device_table[] = {
>  #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
>  	{USB_DEVICE(0x0458, 0x7025), BS(SN9C120, MI0360)},


  reply	other threads:[~2010-12-13 13:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-13 13:03 [PATCH 3/6] gspca - sonixj: Add a flag in the driver_info table Jean-Francois Moine
2010-12-13 13:29 ` Mauro Carvalho Chehab [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-12-14 19:15 Jean-François Moine

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=4D061FB3.7010305@redhat.com \
    --to=mchehab@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox