eeepc-laptop: don't enable camera at startup if it's already on.
authorLuca Niccoli <[email protected]>
Fri, 16 Oct 2009 20:22:47 +0000 (22:22 +0200)
committerLen Brown <[email protected]>
Tue, 3 Nov 2009 15:24:19 +0000 (10:24 -0500)
Switching the camera takes 500ms, checking if it's on is almost free...
The BIOS remembers the setting through reboots, so there's good chance the
camera is already enabled.

Signed-off-by: Luca Niccoli <[email protected]>
Cc: Corentin Chary <[email protected]>
Cc: Alan Jenkins <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Len Brown <[email protected]>
drivers/platform/x86/eeepc-laptop.c

index 789d6ae003fb6a0a07549b3663274d96e7a47893..4226e535273874fb06aea0344c4c8ce00a8b957c 100644 (file)
@@ -356,7 +356,8 @@ static void __devinit eeepc_enable_camera(void)
         * If the following call to set_acpi() fails, it's because there's no
         * camera so we can ignore the error.
         */
-       set_acpi(CM_ASL_CAMERA, 1);
+       if (get_acpi(CM_ASL_CAMERA) == 0)
+               set_acpi(CM_ASL_CAMERA, 1);
 }
 
 /*