All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <j.w.r.degoede@hhs.nl>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: Linux and Kernel Video <video4linux-list@redhat.com>
Subject: PATCH: gspca-sonixb-led-off.patch
Date: Sun, 24 Aug 2008 11:46:57 +0200	[thread overview]
Message-ID: <48B12E11.5000500@hhs.nl> (raw)

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

Hi,

* Turn the led of the cam off after plugging in the cam
* Move the probe code from open to config, so that if the probe fails
   we never register

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>

Regards,

Hans

[-- Attachment #2: gspca-sonixb-led-off.patch --]
[-- Type: text/plain, Size: 1119 bytes --]

* Turn the led of the cam off after plugging in the cam
* Move the probe code from open to config, so that if the probe fails
  we never register

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
diff -r a392efb75b57 linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c	Sun Aug 24 11:37:43 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c	Sun Aug 24 11:40:27 2008 +0200
@@ -789,6 +789,11 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 	struct cam *cam;
 	int sif = 0;
+	const __u8 stop = 0x09; /* Disable stream turn of LED */
+
+	reg_r(gspca_dev, 0x00);
+	if (gspca_dev->usb_buf[0] != 0x10)
+		return -ENODEV;
 
 	/* copy the webcam info from the device id */
 	sd->sensor = (id->driver_info >> 24) & 0xff;
@@ -821,15 +826,15 @@
 		sd->autogain = AUTOGAIN_DEF;
 	sd->freq = FREQ_DEF;
 
+	/* Disable stream turn of LED */
+	reg_w(gspca_dev, 0x01, &stop, 1);
+
 	return 0;
 }
 
 /* this function is called at open time */
 static int sd_open(struct gspca_dev *gspca_dev)
 {
-	reg_r(gspca_dev, 0x00);
-	if (gspca_dev->usb_buf[0] != 0x10)
-		return -ENODEV;
 	return 0;
 }
 

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

                 reply	other threads:[~2008-08-24  9:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=48B12E11.5000500@hhs.nl \
    --to=j.w.r.degoede@hhs.nl \
    --cc=moinejf@free.fr \
    --cc=video4linux-list@redhat.com \
    /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.