From patchwork Tue Jun 16 19:28:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 30662 X-Patchwork-Delegate: lenb@kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5GJVQiK004683 for ; Tue, 16 Jun 2009 19:31:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754227AbZFPTb1 (ORCPT ); Tue, 16 Jun 2009 15:31:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754578AbZFPTb1 (ORCPT ); Tue, 16 Jun 2009 15:31:27 -0400 Received: from iksaif.net ([88.191.73.63]:60972 "EHLO iksaif.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753026AbZFPTbY (ORCPT ); Tue, 16 Jun 2009 15:31:24 -0400 Received: from localhost.localdomain (cxr69-11-88-180-139-205.fbx.proxad.net [88.180.139.205]) (Authenticated sender: corentincj@iksaif.net) by iksaif.net (Postfix) with ESMTPA id 15E89C9002A; Tue, 16 Jun 2009 21:33:53 +0200 (CEST) From: Corentin Chary To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, Pekka Enberg , Andrew Morton , Corentin Chary Subject: [PATCH 04/15] eeepc-laptop: enable camera by default Date: Tue, 16 Jun 2009 21:28:45 +0200 Message-Id: <1245180536-28009-5-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.6.3.1 In-Reply-To: <1245180536-28009-4-git-send-email-corentincj@iksaif.net> References: <1245180536-28009-1-git-send-email-corentincj@iksaif.net> <1245180536-28009-2-git-send-email-corentincj@iksaif.net> <1245180536-28009-3-git-send-email-corentincj@iksaif.net> <1245180536-28009-4-git-send-email-corentincj@iksaif.net> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Pekka Enberg 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 Signed-off-by: Pekka Enberg Signed-off-by: Corentin Chary --- drivers/platform/x86/eeepc-laptop.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 51b07c6..2a03425 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c @@ -341,6 +341,15 @@ static int eeepc_bluetooth_rfkill_state(void *data, enum rfkill_state *state) return 0; } +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 */ @@ -1072,6 +1081,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)