diff options
author | Rajat Khandelwal <rajat.khandelwal@intel.com> | 2022-11-01 14:50:42 +0300 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2022-11-07 15:36:47 +0300 |
commit | a5cfc9d65879c0d377f732531a2e80ee3a9eebbc (patch) | |
tree | 686b07fb4686f4bafe4125deb53c308276bc39bc /drivers/thunderbolt/usb4_port.c | |
parent | 2ae18cc2269fc2d05d36bf44a8daa4404fa11dde (diff) | |
download | linux-a5cfc9d65879c0d377f732531a2e80ee3a9eebbc.tar.xz |
thunderbolt: Add wake on connect/disconnect on USB4 ports
Wake on connect/disconnect is only supported while runtime suspend for
now, which is obviously necessary. It is also not inherently desired for
the system to wakeup on Thunderbolt/USB4 hot plug events. However, we
can still make user in control of waking up the system in the events of
hot plug/unplug.
This patch adds 'wakeup' attribute under 'usb4_portX/power' sysfs
attribute and only enables wakes on connect/disconnect to the respective
port when 'wakeup' is set to 'enabled'. The attribute is set to
'disabled' by default.
Signed-off-by: Rajat Khandelwal <rajat.khandelwal@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/usb4_port.c')
-rw-r--r-- | drivers/thunderbolt/usb4_port.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/thunderbolt/usb4_port.c b/drivers/thunderbolt/usb4_port.c index 1a30c0a23286..e355bfd6343f 100644 --- a/drivers/thunderbolt/usb4_port.c +++ b/drivers/thunderbolt/usb4_port.c @@ -284,6 +284,9 @@ struct usb4_port *usb4_port_device_add(struct tb_port *port) } } + if (!tb_is_upstream_port(port)) + device_set_wakeup_capable(&usb4->dev, true); + pm_runtime_no_callbacks(&usb4->dev); pm_runtime_set_active(&usb4->dev); pm_runtime_enable(&usb4->dev); |