thunderbolt: Add support for ACPI _DSM to power on/off retimers
authorRajmohan Mani <rajmohan.mani@intel.com>
Thu, 1 Apr 2021 15:20:17 +0000 (18:20 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 1 Jun 2021 07:53:31 +0000 (10:53 +0300)
commitccc5cb8ad5d18ec0e008d1652711fa1c18e9366c
tree16b4ea3e31c37bf3c8cf82b46152a65c5e76e520
parentcae5f5151d76635f6b5c08133184c48048346e63
thunderbolt: Add support for ACPI _DSM to power on/off retimers

Typically retimers can be accessed only when the USB4 link is up (e.g
there is a cable connected). However, sometimes it is useful to be able
to access retimers even if there is nothing connected to the USB4 port.
For instance we may still want to be able to upgrade the retimer NVM
firmware even if the user does not have any USB4 devices. This is
something that USB4 spec leaves to implementers.

In case of ACPI based systems, we can support this by providing a
special _DSM method under each USB4 port. This _DSM can be used to turn
on power to on-board retimers (and cycle it through different modes so
that the sideband becomes usable).

This patch adds support for this _DSM and makes the functionality
available to the rest of the driver through tb_acpi_power_[on|off]_retimers().

Signed-off-by: Rajmohan Mani <rajmohan.mani@intel.com>
Co-developed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thunderbolt/acpi.c
drivers/thunderbolt/domain.c
drivers/thunderbolt/tb.h