From patchwork Sun Apr 12 11:26:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattia Dongili X-Patchwork-Id: 17820 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 n3CBQZqX007056 for ; Sun, 12 Apr 2009 11:26:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760135AbZDLL0j (ORCPT ); Sun, 12 Apr 2009 07:26:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760059AbZDLL0j (ORCPT ); Sun, 12 Apr 2009 07:26:39 -0400 Received: from static-220-247-10-204.b-man.svips.gol.ne.jp ([220.247.10.204]:41444 "EHLO smtp.kamineko.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760072AbZDLL0f (ORCPT ); Sun, 12 Apr 2009 07:26:35 -0400 Received: by smtp.kamineko.org (Postfix, from userid 8) id 303D52400F; Sun, 12 Apr 2009 20:26:34 +0900 (JST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on enma.kamineko.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=ham version=3.2.5 Received: from caligola.kamineko.org (unknown [192.168.1.34]) by smtp.kamineko.org (Postfix) with ESMTP id DA4022D10A; Sun, 12 Apr 2009 20:26:31 +0900 (JST) Received: by caligola.kamineko.org (Postfix, from userid 1000) id A8A7A15FFF; Sun, 12 Apr 2009 20:26:31 +0900 (JST) From: Mattia Dongili To: Len Brown Cc: linux-acpi@vger.kernel.org, Mattia Dongili , Matthias Welwarsky , Matthew Garrett Subject: [PATCH 6/6] sony-laptop: always try to unblock rfkill on load Date: Sun, 12 Apr 2009 20:26:31 +0900 Message-Id: <1239535591-15514-7-git-send-email-malattia@linux.it> X-Mailer: git-send-email 1.6.2.2 In-Reply-To: <1239535591-15514-6-git-send-email-malattia@linux.it> References: <1239535591-15514-1-git-send-email-malattia@linux.it> <1239535591-15514-2-git-send-email-malattia@linux.it> <1239535591-15514-3-git-send-email-malattia@linux.it> <1239535591-15514-4-git-send-email-malattia@linux.it> <1239535591-15514-5-git-send-email-malattia@linux.it> <1239535591-15514-6-git-send-email-malattia@linux.it> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org This fixes an inconsistent behaviour when loading the driver with the switch on or off. In the former case you would also need to soft unblock the switch via the sysfs file entries to really disable rfkill, in the latter you wouldn't. Signed-off-by: Mattia Dongili Cc: Matthias Welwarsky Cc: Matthew Garrett Acked-by: Matthew Garrett --- drivers/platform/x86/sony-laptop.c | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 419873a..9c0ce73 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -1103,8 +1103,11 @@ static int sony_nc_setup_wifi_rfkill(struct acpi_device *device) err = rfkill_register(sony_wifi_rfkill); if (err) rfkill_free(sony_wifi_rfkill); - else + else { sony_rfkill_devices[SONY_WIFI] = sony_wifi_rfkill; + sony_nc_rfkill_set(sony_wifi_rfkill->data, + RFKILL_STATE_UNBLOCKED); + } return err; } @@ -1125,8 +1128,11 @@ static int sony_nc_setup_bluetooth_rfkill(struct acpi_device *device) err = rfkill_register(sony_bluetooth_rfkill); if (err) rfkill_free(sony_bluetooth_rfkill); - else + else { sony_rfkill_devices[SONY_BLUETOOTH] = sony_bluetooth_rfkill; + sony_nc_rfkill_set(sony_bluetooth_rfkill->data, + RFKILL_STATE_UNBLOCKED); + } return err; } @@ -1146,8 +1152,11 @@ static int sony_nc_setup_wwan_rfkill(struct acpi_device *device) err = rfkill_register(sony_wwan_rfkill); if (err) rfkill_free(sony_wwan_rfkill); - else + else { sony_rfkill_devices[SONY_WWAN] = sony_wwan_rfkill; + sony_nc_rfkill_set(sony_wwan_rfkill->data, + RFKILL_STATE_UNBLOCKED); + } return err; } @@ -1167,8 +1176,11 @@ static int sony_nc_setup_wimax_rfkill(struct acpi_device *device) err = rfkill_register(sony_wimax_rfkill); if (err) rfkill_free(sony_wimax_rfkill); - else + else { sony_rfkill_devices[SONY_WIMAX] = sony_wimax_rfkill; + sony_nc_rfkill_set(sony_wimax_rfkill->data, + RFKILL_STATE_UNBLOCKED); + } return err; }