From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755905AbcBHRFv (ORCPT ); Mon, 8 Feb 2016 12:05:51 -0500 Received: from mail-qg0-f66.google.com ([209.85.192.66]:34490 "EHLO mail-qg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755487AbcBHRFj (ORCPT ); Mon, 8 Feb 2016 12:05:39 -0500 From: "=?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?=" X-Google-Original-From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= To: Darren Hart Cc: Corentin Chary , platform-driver-x86@vger.kernel.org, acpi4asus-user@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux@endlessm.com, =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= Subject: [PATCH 2/5] asus-wmi: Create quirk for airplane_mode LED Date: Mon, 8 Feb 2016 12:05:20 -0500 Message-Id: <1454951123-27470-3-git-send-email-jprvita@endlessm.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454951123-27470-1-git-send-email-jprvita@endlessm.com> References: <1454951123-27470-1-git-send-email-jprvita@endlessm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some Asus laptops that have an "airplane mode" indicator LED, also have the WMI WLAN user bit set, and the following bits in their DSDT: Scope (_SB) { (...) Device (ATKD) { (...) Method (WMNB, 3, Serialized) { (...) If (LEqual (IIA0, 0x00010002)) { OWGD (IIA1) Return (One) } } } } So when asus-wmi uses ASUS_WMI_DEVID_WLAN_LED (0x00010002) to store the wlan state, it drives the airplane mode indicator LED (through the call to OWGD) in an inverted fashion: the LED is ON when airplane mode is OFF (since wlan is ON), and vice-versa. This commit creates a quirk to not register a RFKill switch at all for these laptops, to allow the asus-wireless driver to drive the airplane mode LED correctly. It also adds a match to that quirk for the Asus X555UB. Signed-off-by: João Paulo Rechi Vita --- drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++ drivers/platform/x86/asus-wmi.c | 8 +++++--- drivers/platform/x86/asus-wmi.h | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c index 131fee2..cfee863 100644 --- a/drivers/platform/x86/asus-nb-wmi.c +++ b/drivers/platform/x86/asus-nb-wmi.c @@ -78,6 +78,10 @@ static struct quirk_entry quirk_asus_x200ca = { .wapf = 2, }; +static struct quirk_entry quirk_no_rfkill = { + .no_rfkill = true, +}; + static int dmi_matched(const struct dmi_system_id *dmi) { quirks = dmi->driver_data; @@ -297,6 +301,15 @@ static const struct dmi_system_id asus_quirks[] = { }, .driver_data = &quirk_asus_x200ca, }, + { + .callback = dmi_matched, + .ident = "ASUSTeK COMPUTER INC. X555UB", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "X555UB"), + }, + .driver_data = &quirk_no_rfkill, + }, {}, }; diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index a96630d..370fa347 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -2064,9 +2064,11 @@ static int asus_wmi_add(struct platform_device *pdev) if (err) goto fail_leds; - err = asus_wmi_rfkill_init(asus); - if (err) - goto fail_rfkill; + if (!asus->driver->quirks->no_rfkill) { + err = asus_wmi_rfkill_init(asus); + if (err) + goto fail_rfkill; + } /* Some Asus desktop boards export an acpi-video backlight interface, stop this from showing up */ diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h index 4da4c8b..5de1df5 100644 --- a/drivers/platform/x86/asus-wmi.h +++ b/drivers/platform/x86/asus-wmi.h @@ -38,6 +38,7 @@ struct key_entry; struct asus_wmi; struct quirk_entry { + bool no_rfkill; bool hotplug_wireless; bool scalar_panel_brightness; bool store_backlight_power; -- 2.5.0