OSDN Git Service

eeepc-laptop: enable camera by default
authorCorentin Chary <corentincj@iksaif.net>
Sun, 27 Sep 2009 18:39:04 +0000 (20:39 +0200)
committerCorentin Chary <corentincj@iksaif.net>
Wed, 30 Sep 2009 20:17:43 +0000 (22:17 +0200)
If we leave the camera disabled by default, userspace programs (e.g.
Skype, Cheese) leave the user out in the cold saying that the machine
"has no camera." Therefore, it's better to enable camera by default and
let people who really don't want it just disable the thing.

To reduce power usage you should enable USB autosuspend:
echo -n auto > /sys/bus/usb/drivers/uvcvideo/*:*/../power/level

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/platform/x86/eeepc-laptop.c

index 13a5682..b7ad658 100644 (file)
@@ -331,6 +331,15 @@ static int eeepc_rfkill_state(void *data, enum rfkill_state *state)
 }
 
 
+static void __init 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);
+}
+
 /*
  * Sys helpers
  */
@@ -1023,6 +1032,9 @@ static int __init eeepc_laptop_init(void)
        result = eeepc_hwmon_init(dev);
        if (result)
                goto fail_hwmon;
+
+       eeepc_enable_camera();
+
        /* Register platform stuff */
        result = platform_driver_register(&platform_driver);
        if (result)