Skip to contentSkip to conversation

gspca_cpia1: Restore QX3 illuminators' state on resume

PATCH Superseded Andy Walls 2 participants 2 messages Sep 12, 2010 Media (V4L/DVB)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Andy Walls

author
#0 lore raw

PATCH 3/3 gspca_cpia1: Restore QX3 illuminators' state on resume

gspca_cpia1: Restore QX3 illuminators' state on resume

Turn the lights of the QX3 on (or off) as needed when resuming and at module load.

linux/drivers/media/video/gspca/cpia1.c +4 -0
diff -r 32d5c323c541 -r c2e7fb2d768e linux/drivers/media/video/gspca/cpia1.c
@@ -1772,6 +1772,10 @@
 	if (ret)
 		return ret;
 
+	/* Ensure the QX3 illuminators' states are restored upon resume */
+	if (sd->params.qx3.qx3_detected)
+		command_setlights(gspca_dev);
+
 	sd_stopN(gspca_dev);
 
 	if (!sd->params.qx3.qx3_detected)
#1 lore raw

Hi,

Quoted 11 lines · Andy Walls

gspca_cpia1: Restore QX3 illuminators' state on resume

Turn the lights of the QX3 on (or off) as needed when resuming and at module load.

diff -r 32d5c323c541 -r c2e7fb2d768e linux/drivers/media/video/gspca/cpia1.c

linux/drivers/media/video/gspca/cpia1.c line 1781

Quoted 10 lines
linux/drivers/media/video/gspca/cpia1.c +4 -0
@@ -1772,6 +1772,10 @@
  	if (ret)
  		return ret;
 
+	/* Ensure the QX3 illuminators' states are restored upon resume */
+	if (sd->params.qx3.qx3_detected)
+		command_setlights(gspca_dev);
+
  	sd_stopN(gspca_dev);
 
  	if (!sd->params.qx3.qx3_detected)

Notice the:

	if (sd->params.qx3.qx3_detected)
		command_setlights(gspca_dev);
   	sd_stopN(gspca_dev);
	if (!sd->params.qx3.qx3_detected)
		....

Given that at least the order of execution of the second if statement does not matter wrt to the sd_stopN(gspca_dev), can we please make this:

	if (sd->params.qx3.qx3_detected)
		command_setlights(gspca_dev);
	else
		....
   	sd_stopN(gspca_dev);

Thanks,

Hans