Skip to content

Commit

Permalink
asus-wmi: Create quirk for airplane_mode LED
Browse files Browse the repository at this point in the history
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 through the ASHS ACPI device. It also adds a match to
that quirk for the Asus X555UB, which is affected by this problem.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Reviewed-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
  • Loading branch information
João Paulo Rechi Vita authored and Darren Hart committed Jul 1, 2016
1 parent 2c1a49c commit a977e59
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
13 changes: 13 additions & 0 deletions drivers/platform/x86/asus-nb-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -306,6 +310,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,
},
{},
};

Expand Down
8 changes: 5 additions & 3 deletions drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2069,9 +2069,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 */
Expand Down
1 change: 1 addition & 0 deletions drivers/platform/x86/asus-wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a977e59

Please sign in to comment.