thunderbolt: Add runtime PM for Software CM
authorMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 5 Jun 2020 11:25:02 +0000 (14:25 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 3 Sep 2020 09:06:42 +0000 (12:06 +0300)
commit6ac6faee5d7d7d1676a3188286438bed2dadd863
treede96d3a7dfe352709d20b4f18ef3acd3dc103a7b
parentb2be2b05cf3b1c7b499d3b05decdcc524879fea7
thunderbolt: Add runtime PM for Software CM

This adds runtime PM support for the Software Connection Manager parts
of the driver. This allows to save power when either there is no device
attached at all or there is a device attached and all following
conditions are true:

  - Tunneled PCIe root/downstream ports are runtime suspended
  - Tunneled USB3 ports are runtime suspended
  - No active DisplayPort stream
  - No active XDomain connection

For the first two we take advantage of device links that were added in
previous patch. Difference for the system sleep case is that we also
enable wakes when something is geting plugged in/out of the Thunderbolt
ports.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/switch.c
drivers/thunderbolt/tb.c
drivers/thunderbolt/tb.h