All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] gspca pac7302: remove LED blinking when switching stream on and off
@ 2010-02-24  6:52 Németh Márton
  2010-02-27  0:21 ` Németh Márton
  0 siblings, 1 reply; 2+ messages in thread
From: Németh Márton @ 2010-02-24  6:52 UTC (permalink / raw)
  To: Jean-Francois Moine; +Cc: V4L Mailing List

From: Márton Németh <nm127@freemail.hu>

The init sequences for PAC7302 contained register settings affecting
the LED state which can result blinking of the LED when it is set to
always on or always off. The blinking happened when the stream was
switched on or off.

Remove the register changes from the init sequence and handle it with
the function set_streaming_led().

Signed-off-by: Márton Németh <nm127@freemail.hu>
---
--- a/linux/drivers/media/video/gspca/pac7302.c	2010-02-08 20:46:47.000000000 +0100
+++ b/linux/drivers/media/video/gspca/pac7302.c	2010-02-08 20:48:04.000000000 +0100
@@ -331,13 +331,6 @@ static const struct v4l2_pix_format vga_
 #define END_OF_SEQUENCE		0

 /* pac 7302 */
-static const __u8 init_7302[] = {
-/*	index,value */
-	0xff, 0x01,		/* page 1 */
-	0x78, 0x00,		/* deactivate */
-	0xff, 0x01,
-	0x78, 0x40,		/* led off */
-};
 static const __u8 start_7302[] = {
 /*	index, len, [value]* */
 	0xff, 1,	0x00,		/* page 0 */
@@ -373,7 +366,8 @@ static const __u8 start_7302[] = {
 	0xff, 1,	0x01,		/* page 1 */
 	0x12, 3,	0x02, 0x00, 0x01,
 	0x3e, 2,	0x00, 0x00,
-	0x76, 5,	0x01, 0x20, 0x40, 0x00, 0xf2,
+	0x76, 2,	0x01, 0x20,
+	0x79, 2,	0x00, 0xf2,
 	0x7c, 1,	0x00,
 	0x7f, 10,	0x4b, 0x0f, 0x01, 0x2c, 0x02, 0x58, 0x03, 0x20,
 			0x02, 0x00,
@@ -397,8 +391,6 @@ static const __u8 start_7302[] = {
 	0x2a, 5,	0xc8, 0x00, 0x18, 0x12, 0x22,
 	0x64, 8,	0x00, 0x00, 0xf0, 0x01, 0x14, 0x44, 0x44, 0x44,
 	0x6e, 1,	0x08,
-	0xff, 1,	0x01,		/* page 1 */
-	0x78, 1,	0x00,
 	0, END_OF_SEQUENCE		/* end of sequence */
 };

@@ -496,15 +488,6 @@ static void reg_w(struct gspca_dev *gspc
 	}
 }

-static void reg_w_seq(struct gspca_dev *gspca_dev,
-		const __u8 *seq, int len)
-{
-	while (--len >= 0) {
-		reg_w(gspca_dev, seq[0], seq[1]);
-		seq += 2;
-	}
-}
-
 /* load the beginning of a page */
 static void reg_w_page(struct gspca_dev *gspca_dev,
 			const __u8 *page, int len)
@@ -774,7 +757,7 @@ static void set_streaming_led(struct gsp
 /* this function is called at probe and resume time for pac7302 */
 static int sd_init(struct gspca_dev *gspca_dev)
 {
-	reg_w_seq(gspca_dev, init_7302, sizeof(init_7302)/2);
+	set_streaming_led(gspca_dev, 0);
 	return gspca_dev->usb_err;
 }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] gspca pac7302: remove LED blinking when switching stream on and off
  2010-02-24  6:52 [PATCH 2/2] gspca pac7302: remove LED blinking when switching stream on and off Németh Márton
@ 2010-02-27  0:21 ` Németh Márton
  0 siblings, 0 replies; 2+ messages in thread
From: Németh Márton @ 2010-02-27  0:21 UTC (permalink / raw)
  To: Jean-Francois Moine, Richard Purdie; +Cc: V4L Mailing List

From: Márton Németh <nm127@freemail.hu>

The init sequences for PAC7302 contained register settings affecting
the LED state which can result blinking of the LED when it is set to
always on or always off. The blinking happened when the stream was
switched on or off.

Remove the register changes from the init sequence and handle it with
the function set_streaming_led().

Signed-off-by: Márton Németh <nm127@freemail.hu>
---
--- a/linux/drivers/media/video/gspca/pac7302.c.orig	2010-02-27 01:00:30.000000000 +0100
+++ b/linux/drivers/media/video/gspca/pac7302.c	2010-02-27 01:00:49.000000000 +0100
@@ -322,13 +322,6 @@
 #define END_OF_SEQUENCE		0

 /* pac 7302 */
-static const __u8 init_7302[] = {
-/*	index,value */
-	0xff, 0x01,		/* page 1 */
-	0x78, 0x00,		/* deactivate */
-	0xff, 0x01,
-	0x78, 0x40,		/* led off */
-};
 static const __u8 start_7302[] = {
 /*	index, len, [value]* */
 	0xff, 1,	0x00,		/* page 0 */
@@ -364,7 +357,8 @@
 	0xff, 1,	0x01,		/* page 1 */
 	0x12, 3,	0x02, 0x00, 0x01,
 	0x3e, 2,	0x00, 0x00,
-	0x76, 5,	0x01, 0x20, 0x40, 0x00, 0xf2,
+	0x76, 2,	0x01, 0x20,
+	0x79, 2,	0x00, 0xf2,
 	0x7c, 1,	0x00,
 	0x7f, 10,	0x4b, 0x0f, 0x01, 0x2c, 0x02, 0x58, 0x03, 0x20,
 			0x02, 0x00,
@@ -388,8 +382,6 @@
 	0x2a, 5,	0xc8, 0x00, 0x18, 0x12, 0x22,
 	0x64, 8,	0x00, 0x00, 0xf0, 0x01, 0x14, 0x44, 0x44, 0x44,
 	0x6e, 1,	0x08,
-	0xff, 1,	0x01,		/* page 1 */
-	0x78, 1,	0x00,
 	0, END_OF_SEQUENCE		/* end of sequence */
 };

@@ -487,15 +479,6 @@
 	}
 }

-static void reg_w_seq(struct gspca_dev *gspca_dev,
-		const __u8 *seq, int len)
-{
-	while (--len >= 0) {
-		reg_w(gspca_dev, seq[0], seq[1]);
-		seq += 2;
-	}
-}
-
 /* load the beginning of a page */
 static void reg_w_page(struct gspca_dev *gspca_dev,
 			const __u8 *page, int len)
@@ -787,7 +770,7 @@
 /* this function is called at probe and resume time for pac7302 */
 static int sd_init(struct gspca_dev *gspca_dev)
 {
-	reg_w_seq(gspca_dev, init_7302, sizeof(init_7302)/2);
+	set_streaming_led(gspca_dev, 0);
 	return gspca_dev->usb_err;
 }



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-27  0:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-24  6:52 [PATCH 2/2] gspca pac7302: remove LED blinking when switching stream on and off Németh Márton
2010-02-27  0:21 ` Németh Márton

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.