]> git.baikalelectronics.ru Git - kernel.git/commit
asus-wireless: Toggle airplane mode LED
authorJoão Paulo Rechi Vita <jprvita@gmail.com>
Mon, 13 Jun 2016 20:57:30 +0000 (16:57 -0400)
committerDarren Hart <dvhart@linux.intel.com>
Fri, 1 Jul 2016 23:01:26 +0000 (16:01 -0700)
commite148fcd3eae5335765b49a622c4d8dc97c95877d
tree00da181b507b503382ca8d0531eaa87cbad1f89e
parentf470bc231c25c98930ac6a3d86aa57707cded82e
asus-wireless: Toggle airplane mode LED

In the ASHS device we have the HSWC method, which calls either OWGD or
OWGS, depending on its parameter:

Device (ASHS)
{
Name (_HID, "ATK4002")  // _HID: Hardware ID
Method (HSWC, 1, Serialized)
{
If ((Arg0 < 0x02))
{
OWGD (Arg0)
Return (One)
}
If ((Arg0 == 0x02))
{
Local0 = OWGS ()
If (Local0)
{
Return (0x05)
}
Else
{
Return (0x04)
}
}
If ((Arg0 == 0x03))
{
Return (0xFF)
}
If ((Arg0 == 0x04))
{
OWGD (Zero)
Return (One)
}
If ((Arg0 == 0x05))
{
OWGD (One)
Return (One)
}
If ((Arg0 == 0x80))
{
Return (One)
}
}
Method (_STA, 0, NotSerialized)  // _STA: Status
{
If ((MSOS () >= OSW8))
{
Return (0x0F)
}
Else
{
Return (Zero)
}
}
}

On the Asus laptops that do not have an airplane mode LED, OWGD has an
empty implementation and OWGS simply returns 0. On the ones that have an
airplane mode LED these methods have the following implementation:

Method (OWGD, 1, Serialized)
{
SGPL (0x0203000F, Arg0)
SGPL (0x0203000F, Arg0)
}

Method (OWGS, 0, Serialized)
{
Store (RGPL (0x0203000F), Local0)
Return (Local0)
}

Where OWGD(1) sets the airplane mode LED ON, OWGD(0) set it off, and
OWGS() returns its state.

This commit exposes the airplane mode indicator LED to userspace under
the name asus-wireless::airplane, so it can be driven according to
userspace's policy.

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>
drivers/platform/x86/Kconfig
drivers/platform/x86/asus-wireless.c