gspca_cpia1: Restore QX3 illuminators' state on resume
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.
Signed-off-by Andy Walls <[email protected]>
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)
Hi,
Quoted 11 lines · Andy Walls
gspca_cpia1: Restore QX3 illuminators' state on resumeTurn the lights of the QX3 on (or off) as needed when resuming and at module load.
Signed-off-by Andy Walls<[email protected]>diff -r
32d5c323c541-rc2e7fb2d768elinux/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