OpenCloudOS-Kernel/drivers/platform/x86
João Paulo Rechi Vita 2c1a49c961 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>
2016-07-01 16:01:26 -07:00
..
Kconfig asus-wireless: Toggle airplane mode LED 2016-07-01 16:01:26 -07:00
Makefile platform/x86: Add PMC Driver for Intel Core SoC 2016-05-27 11:47:56 -07:00
acer-wmi.c acer-wmi: Use acpi_dev_found() 2016-04-09 03:12:59 +02:00
acerhdf.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
alienware-wmi.c alienware-wmi: whitespace improvements 2016-02-07 12:01:33 -08:00
amilo-rfkill.c platform: x86: drop owner assignment from platform_drivers 2014-10-20 16:21:27 +02:00
apple-gmux.c apple-gmux: Add helper for presence detect 2016-02-09 11:21:11 +01:00
asus-laptop.c asus-laptop: correct error handling in sysfs_acpi_set 2016-04-25 10:42:54 -07:00
asus-nb-wmi.c asus-wmi: Add ambient light sensor toggle key 2016-06-28 22:18:35 -07:00
asus-wireless.c asus-wireless: Toggle airplane mode LED 2016-07-01 16:01:26 -07:00
asus-wmi.c asus-wmi: provide access to ALS control 2016-05-27 11:47:54 -07:00
asus-wmi.h asus-wmi: always report brightness key events 2013-02-27 08:30:37 -05:00
classmate-laptop.c classmate-laptop: Fix sparse warning (0 as NULL) 2015-02-07 12:12:00 -08:00
compal-laptop.c compal-laptop: Add charge control limit 2015-10-03 08:44:57 -07:00
dell-laptop.c dell-smbios: rename dell_smi_error() to dell_smbios_error() 2016-03-23 10:05:49 -07:00
dell-rbtn.c dell-rbtn: Ignore ACPI notifications if device is suspended 2016-05-27 11:47:56 -07:00
dell-rbtn.h dell-rbtn: Export notifier for other kernel modules 2015-06-10 22:04:11 -07:00
dell-smbios.c dell-smbios: rename dell_smi_error() to dell_smbios_error() 2016-03-23 10:05:49 -07:00
dell-smbios.h dell-smbios: rename dell_smi_error() to dell_smbios_error() 2016-03-23 10:05:49 -07:00
dell-smo8800.c dell-smo8800: Add more ACPI ids and change description of driver 2014-12-03 10:10:19 -08:00
dell-wmi-aio.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
dell-wmi.c dell-wmi: Add a WMI event code for display on/off 2016-06-21 09:24:01 -07:00
eeepc-laptop.c eeepc-laptop: Port to new backlight interface selection API 2015-06-19 01:11:56 +02:00
eeepc-wmi.c eeepc-wmi: Use acpi_dev_found() 2016-04-09 03:12:58 +02:00
fujitsu-laptop.c fujitsu-laptop: Add support for eco LED 2016-06-28 22:18:34 -07:00
fujitsu-tablet.c Input: use more descriptive KEY_ROTATE_DISPLAY instead of KEY_DIRECTION 2015-03-06 17:18:16 -08:00
hdaps.c platform: x86: drop owner assignment from platform_drivers 2014-10-20 16:21:27 +02:00
hp-wireless.c hp-wireless: remove unneeded goto/label in hpwl_init 2015-08-25 23:34:15 -07:00
hp-wmi.c hp-wmi: Fix wifi cannot be hard-unblocked 2016-06-28 22:18:32 -07:00
hp_accel.c hp_accel: Silence an uninitialized variable warning 2016-04-15 08:26:25 -07:00
ibm_rtl.c move io-64-nonatomic*.h out of asm-generic 2015-10-15 00:21:07 +02:00
ideapad-laptop.c ideapad-laptop: add a new WMI string for ESC key 2016-05-27 11:47:54 -07:00
intel-hid.c intel-hid: Remove duplicated acpi_remove_notify_handler 2016-06-28 22:18:35 -07:00
intel-rst.c intel-rst: Clean up ACPI add function 2014-09-17 13:55:54 -07:00
intel-smartconnect.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
intel_ips.c move io-64-nonatomic*.h out of asm-generic 2015-10-15 00:21:07 +02:00
intel_ips.h
intel_menlow.c intel_menlow: reduce code duplication 2016-05-27 11:47:55 -07:00
intel_mid_powerbtn.c intel_mid_powerbtn: Remove misuse of IRQF_NO_SUSPEND flag 2015-10-03 09:40:30 -07:00
intel_mid_thermal.c thermal: consistently use int for temperatures 2015-08-03 23:15:50 +08:00
intel_oaktrail.c intel-oaktrail: Port to new backlight interface selection API 2015-06-19 01:12:11 +02:00
intel_pmc_core.c platform/x86: Add PMC Driver for Intel Core SoC 2016-05-27 11:47:56 -07:00
intel_pmc_core.h platform/x86: Add PMC Driver for Intel Core SoC 2016-05-27 11:47:56 -07:00
intel_pmc_ipc.c platform:x86 decouple telemetry driver from the optional IPC resources 2016-04-19 13:51:41 -07:00
intel_pmic_gpio.c platform: x86: intel-pmic: use gpiochip data pointer 2016-04-26 15:34:41 +02:00
intel_punit_ipc.c platform:x86 decouple telemetry driver from the optional IPC resources 2016-04-19 13:51:41 -07:00
intel_scu_ipc.c platform/x86: Make intel_scu_ipc explicitly non-modular 2016-03-23 10:05:47 -07:00
intel_scu_ipcutil.c intel_scu_ipcutil: underflow in scu_reg_access() 2016-01-30 09:40:35 -08:00
intel_telemetry_core.c intel_telemetry: Constify telemetry_core_ops structures 2016-05-05 13:58:55 -07:00
intel_telemetry_debugfs.c intel_telemetry: Remove Monitor MWAIT feature dependency 2016-06-28 22:21:15 -07:00
intel_telemetry_pltdrv.c intel_telemetry: Remove Monitor MWAIT feature dependency 2016-06-28 22:21:15 -07:00
msi-laptop.c msi-laptop: Port to new backlight interface selection API 2015-06-19 01:12:16 +02:00
msi-wmi.c msi-wmi: Port to new backlight interface selection API 2015-06-19 01:12:20 +02:00
mxm-wmi.c Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86 2014-01-29 18:54:05 -08:00
panasonic-laptop.c Fix sleep / suspend keys for Toughbook CF-51 2014-04-06 12:58:11 -04:00
pvpanic.c pvpanic: handle missing _STA correctly 2015-06-07 21:30:12 -07:00
samsung-laptop.c samsung-laptop: Port to new backlight interface selection API 2015-06-19 01:12:25 +02:00
samsung-q10.c platform: x86: drop owner assignment from platform_drivers 2014-10-20 16:21:27 +02:00
sony-laptop.c sony-laptop: Avoid oops on module unload for older laptops 2016-05-05 16:32:32 -07:00
surfacepro3_button.c surfacepro3_button: Add a warning when switching to tablet mode 2016-05-27 11:47:53 -07:00
tc1100-wmi.c tc1100-wmi: fix build warning when CONFIG_PM not enabled 2016-01-19 17:35:47 -08:00
thinkpad_acpi.c platform-drivers-x86 for 4.7-1 2016-05-27 13:56:02 -07:00
topstar-laptop.c platform:x86: Remove OOM message after input_allocate_device 2013-11-20 18:51:03 -05:00
toshiba-wmi.c platform/x86: Toshiba WMI Hotkey Driver 2015-10-03 10:07:08 -07:00
toshiba_acpi.c toshiba_acpi: Bump driver version and update copyright year 2016-06-28 22:18:32 -07:00
toshiba_bluetooth.c toshiba_bluetooth: Add missing newline in toshiba_bluetooth_present function 2015-11-20 15:20:08 -08:00
toshiba_haps.c toshiba_haps: Make use of DEVICE_ATTR_{RW, WO} macros 2015-05-11 10:38:22 -07:00
wmi.c drivers/platform/x86/wmi.c: use generic UUID library 2016-05-20 17:58:30 -07:00
xo1-rfkill.c platform: x86: drop owner assignment from platform_drivers 2014-10-20 16:21:27 +02:00
xo15-ebook.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00