Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce6a9002 authored by Mario Limonciello's avatar Mario Limonciello Committed by Andy Shevchenko
Browse files

platform/x86: Add driver to force WMI Thunderbolt controller power status



Current implementations of Intel Thunderbolt controllers will go
into a low power mode when not in use.

Many machines containing these controllers also have a GPIO wired up
that can force the controller awake.  This is offered via a ACPI-WMI
interface intended to be manipulated by a userspace utility.

This mechanism is provided by Intel to OEMs to include in BIOS.
It uses an industry wide GUID that is populated in a separate _WDG
entry with no binary MOF.

This interface allows software such as fwupd to wake up thunderbolt
controllers to query the firmware version or flash new firmware.

Signed-off-by: default avatarMario Limonciello <mario.limonciello@dell.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: default avatarYehezkel Bernat <yehezkel.bernat@intel.com>
Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
[andy fixed merge conflicts and bump kernel version for ABI]
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 2bd6bf03
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
What:		/sys/devices/platform/<platform>/force_power
Date:		September 2017
KernelVersion:	4.15
Contact:	"Mario Limonciello" <mario.limonciello@dell.com>
Description:
		Modify the platform force power state, influencing
		Thunderbolt controllers to turn on or off when no
		devices are connected (write-only)
		There are two available states:
		    * 0 -> Force power disabled
		    * 1 -> Force power enabled
+15 −0
Original line number Diff line number Diff line
@@ -197,3 +197,18 @@ information is missing.

To recover from this mode, one needs to flash a valid NVM image to the
host host controller in the same way it is done in the previous chapter.

Forcing power
-------------
Many OEMs include a method that can be used to force the power of a
thunderbolt controller to an "On" state even if nothing is connected.
If supported by your machine this will be exposed by the WMI bus with
a sysfs attribute called "force_power".

For example the intel-wmi-thunderbolt driver exposes this attribute in:
  /sys/devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341/force_power

  To force the power to on, write 1 to this attribute file.
  To disable force power, write 0 to this attribute file.

Note: it's currently not possible to query the force power state of a platform.
+5 −0
Original line number Diff line number Diff line
@@ -7092,6 +7092,11 @@ F: Documentation/wimax/README.i2400m
F:	drivers/net/wimax/i2400m/
F:	include/uapi/linux/wimax/i2400m.h

INTEL WMI THUNDERBOLT FORCE POWER DRIVER
M:	Mario Limonciello <mario.limonciello@dell.com>
S:	Maintained
F:	drivers/platform/x86/intel-wmi-thunderbolt.c

INTEL(R) TRACE HUB
M:	Alexander Shishkin <alexander.shishkin@linux.intel.com>
S:	Supported
+13 −0
Original line number Diff line number Diff line
@@ -658,6 +658,19 @@ config WMI_BMOF
	  To compile this driver as a module, choose M here: the module will
	  be called wmi-bmof.

config INTEL_WMI_THUNDERBOLT
	tristate "Intel WMI thunderbolt force power driver"
	depends on ACPI_WMI
	default ACPI_WMI
	---help---
	  Say Y here if you want to be able to use the WMI interface on select
	  systems to force the power control of Intel Thunderbolt controllers.
	  This is useful for updating the firmware when devices are not plugged
	  into the controller.

	  To compile this driver as a module, choose M here: the module will
	  be called intel-wmi-thunderbolt.

config MSI_WMI
	tristate "MSI WMI extras"
	depends on ACPI_WMI
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ obj-$(CONFIG_PEAQ_WMI) += peaq-wmi.o
obj-$(CONFIG_SURFACE3_WMI)	+= surface3-wmi.o
obj-$(CONFIG_TOPSTAR_LAPTOP)	+= topstar-laptop.o
obj-$(CONFIG_WMI_BMOF)		+= wmi-bmof.o
obj-$(CONFIG_INTEL_WMI_THUNDERBOLT)	+= intel-wmi-thunderbolt.o

# toshiba_acpi must link after wmi to ensure that wmi devices are found
# before toshiba_acpi initializes
Loading