From patchwork Mon Apr 27 07:23:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 20072 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 n3R7YPbV003335 for ; Mon, 27 Apr 2009 07:34:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753585AbZD0He1 (ORCPT ); Mon, 27 Apr 2009 03:34:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753037AbZD0He0 (ORCPT ); Mon, 27 Apr 2009 03:34:26 -0400 Received: from iksaif.net ([88.191.73.63]:44689 "EHLO iksaif.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753271AbZD0HeW (ORCPT ); Mon, 27 Apr 2009 03:34:22 -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 A54A0C90014; Mon, 27 Apr 2009 09:25:37 +0200 (CEST) From: Corentin Chary To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, Alan Jenkins , Corentin Chary Subject: [PATCH 1/7] eeepc-laptop: fix wlan rfkill state change during init Date: Mon, 27 Apr 2009 09:23:37 +0200 Message-Id: <1240817023-5985-2-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.6.2.3 In-Reply-To: <1240817023-5985-1-git-send-email-corentincj@iksaif.net> References: <1240817023-5985-1-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: Alan Jenkins When an rfkill device is registered, the rfkill core will change its state to the system default. So we need to prepare for state changes *before* we register it. That means installing the eeepc-specific ACPI callback which handles the hotplug of the wireless network adaptor. This problem doesn't occur during normal operation. You have to 1) Boot with wireless enabled. eeepc-laptop should load automatically. 2) modprobe -r eeepc-laptop 3) modprobe eeepc-laptop On boot, the default rfkill state will be set to enabled. With the current core code, step 2) will disable the wireless. Therefore in step 3), the wireless will change state during registration, from disabled to enabled. But without this fix, the PCI device for the wireless adaptor will not appear. Signed-off-by: Alan Jenkins Acked-by: Matthew Garrett Signed-off-by: Corentin Chary --- drivers/platform/x86/eeepc-laptop.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 6f54fd1..e21f7cd 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c @@ -649,6 +649,9 @@ static int eeepc_hotk_add(struct acpi_device *device) if (ACPI_FAILURE(status)) printk(EEEPC_ERR "Error installing notify handler\n"); + eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6"); + eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7"); + if (get_acpi(CM_ASL_WLAN) != -1) { ehotk->eeepc_wlan_rfkill = rfkill_allocate(&device->dev, RFKILL_TYPE_WLAN); @@ -704,9 +707,6 @@ static int eeepc_hotk_add(struct acpi_device *device) goto bluetooth_fail; } - eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6"); - eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7"); - return 0; bluetooth_fail: