From patchwork Fri Aug 28 12:56:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 44482 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 n7SD3j1m008656 for ; Fri, 28 Aug 2009 13:03:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750851AbZH1NDm (ORCPT ); Fri, 28 Aug 2009 09:03:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751163AbZH1NDl (ORCPT ); Fri, 28 Aug 2009 09:03:41 -0400 Received: from smtp22.services.sfr.fr ([93.17.128.11]:60843 "EHLO smtp22.services.sfr.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851AbZH1NDk (ORCPT ); Fri, 28 Aug 2009 09:03:40 -0400 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2206.sfr.fr (SMTP Server) with ESMTP id 853C470000A1; Fri, 28 Aug 2009 14:57:46 +0200 (CEST) Received: from localhost.localdomain (224.96.81-79.rev.gaoland.net [79.81.96.224]) by msfrf2206.sfr.fr (SMTP Server) with ESMTP id 16FEE700008E; Fri, 28 Aug 2009 14:57:46 +0200 (CEST) X-SFR-UUID: 20090828125746942.16FEE700008E@msfrf2206.sfr.fr From: Corentin Chary To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, alan-jenkins@tuffmail.co.uk, Corentin Chary Subject: [PATCH 15/24] asus-laptop: Show HRWS in infos and fix output format Date: Fri, 28 Aug 2009 14:56:46 +0200 Message-Id: <1251464215-6540-16-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.6.4 In-Reply-To: <1251464215-6540-15-git-send-email-corentincj@iksaif.net> References: <1251464215-6540-1-git-send-email-corentincj@iksaif.net> <1251464215-6540-2-git-send-email-corentincj@iksaif.net> <1251464215-6540-3-git-send-email-corentincj@iksaif.net> <1251464215-6540-4-git-send-email-corentincj@iksaif.net> <1251464215-6540-5-git-send-email-corentincj@iksaif.net> <1251464215-6540-6-git-send-email-corentincj@iksaif.net> <1251464215-6540-7-git-send-email-corentincj@iksaif.net> <1251464215-6540-8-git-send-email-corentincj@iksaif.net> <1251464215-6540-9-git-send-email-corentincj@iksaif.net> <1251464215-6540-10-git-send-email-corentincj@iksaif.net> <1251464215-6540-11-git-send-email-corentincj@iksaif.net> <1251464215-6540-12-git-send-email-corentincj@iksaif.net> <1251464215-6540-13-git-send-email-corentincj@iksaif.net> <1251464215-6540-14-git-send-email-corentincj@iksaif.net> <1251464215-6540-15-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 Show HRWS in /sys/platform/devices/asus-laptop/infos. HRWS is a bitfield used to get information about Hardware available in the laptop. Also change sprintf format from 0x%04x to %#x. Signed-off-by: Corentin Chary --- drivers/platform/x86/asus-laptop.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index db657bb..2344950 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -516,7 +516,17 @@ static ssize_t show_infos(struct device *dev, */ rv = acpi_evaluate_integer(hotk->handle, "SFUN", NULL, &temp); if (!ACPI_FAILURE(rv)) - len += sprintf(page + len, "SFUN value : 0x%04x\n", + len += sprintf(page + len, "SFUN value : %#x\n", + (uint) temp); + /* + * The HWRS method return informations about the hardware. + * 0x80 bit is for WLAN, 0x100 for Bluetooth. + * The significance of others is yet to be found. + * If we don't find the method, we assume the device are present. + */ + rv = acpi_evaluate_integer(hotk->handle, "HRWS", NULL, &temp); + if (!ACPI_FAILURE(rv)) + len += sprintf(page + len, "HRWS value : %#x\n", (uint) temp); /* * Another value for userspace: the ASYM method returns 0x02 for @@ -527,7 +537,7 @@ static ssize_t show_infos(struct device *dev, */ rv = acpi_evaluate_integer(hotk->handle, "ASYM", NULL, &temp); if (!ACPI_FAILURE(rv)) - len += sprintf(page + len, "ASYM value : 0x%04x\n", + len += sprintf(page + len, "ASYM value : %#x\n", (uint) temp); if (asus_info) { snprintf(buf, 16, "%d", asus_info->length);