From patchwork Wed Aug 18 08:37:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ike Panhc X-Patchwork-Id: 120097 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7I8bWEF018903 for ; Wed, 18 Aug 2010 08:37:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752103Ab0HRIha (ORCPT ); Wed, 18 Aug 2010 04:37:30 -0400 Received: from adelie.canonical.com ([91.189.90.139]:51037 "EHLO adelie.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750974Ab0HRIha (ORCPT ); Wed, 18 Aug 2010 04:37:30 -0400 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1Ole9H-0004kH-ET; Wed, 18 Aug 2010 09:37:27 +0100 Received: from [210.242.151.101] (helo=canonical.com) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1Ole9G-000156-Op; Wed, 18 Aug 2010 09:37:27 +0100 From: Ike Panhc To: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Cc: Thomas Renninger , Alan Cox , Andrew Morton , Corentin Chary , David Woodhouse , Randy Dunlap , Len Brown , Matthew Garrett Subject: [PATCH 2/8] ideapad: check VPC bit before sync rfkill hw status Date: Wed, 18 Aug 2010 16:37:17 +0800 Message-Id: <1282120637-11398-1-git-send-email-ike.pan@canonical.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1282120564-11324-1-git-send-email-ike.pan@canonical.com> References: <1282120564-11324-1-git-send-email-ike.pan@canonical.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 18 Aug 2010 08:37:50 +0000 (UTC) diff --git a/drivers/platform/x86/ideapad_acpi.c b/drivers/platform/x86/ideapad_acpi.c index af630e2..6176597 100644 --- a/drivers/platform/x86/ideapad_acpi.c +++ b/drivers/platform/x86/ideapad_acpi.c @@ -381,7 +381,21 @@ static int ideapad_acpi_remove(struct acpi_device *adevice, int type) static void ideapad_acpi_notify(struct acpi_device *adevice, u32 event) { - ideapad_sync_rfk_state(adevice); + acpi_handle handle = adevice->handle; + unsigned long vpc1, vpc2, vpc_bit; + + if (read_ec_data(handle, 0x10, &vpc1)) + return; + if (read_ec_data(handle, 0x1A, &vpc2)) + return; + + vpc1 = (vpc2 << 8) | vpc1; + for (vpc_bit = 0; vpc_bit < 16; vpc_bit++) { + if (test_bit(vpc_bit, &vpc1)) { + if (vpc_bit == 9) + ideapad_sync_rfk_state(adevice); + } + } } static struct acpi_driver ideapad_acpi_driver = {