public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: mario.limonciello@amd.com, andreas.noever@gmail.com,
	michael.jamet@intel.com, westeri@kernel.org,
	YehezkelShB@gmail.com
Cc: Opal Voravootivat <puthik@google.com>,
	Raul Rangel <rrangel@chromium.org>,
	Utkarsh Patel <utkarsh.h.patel@intel.com>,
	Richard Gong <richard.gong@amd.com>, Sanath S <sanath.s@amd.com>,
	linux-usb@vger.kernel.org
Subject: [PATCH] thunderbolt: Use wake on connect and disconnect over suspend
Date: Wed,  9 Apr 2025 23:36:57 -0500	[thread overview]
Message-ID: <20250410043717.2291559-1-superm1@kernel.org> (raw)

From: Mario Limonciello <mario.limonciello@amd.com>

Wake on connect is useful for being able to wake up a suspended
laptop without opening the lid by plugging into a dock.

Add the default policy to the USB4 router when wakeup is enabled
for the router.  Behavior for individual ports can be controlled
by port wakeup settings.

Cc: Opal Voravootivat <puthik@google.com>
Cc: Raul Rangel <rrangel@chromium.org>
Cc: Utkarsh Patel <utkarsh.h.patel@intel.com>
Cc: Richard Gong <richard.gong@amd.com>
Cc: Sanath S <sanath.s@amd.com>
Link: https://lore.kernel.org/linux-usb/20250410042723.GU3152277@black.fi.intel.com/T/#m0249e8c0e1c77ec92a44a3d6c8b4a8e5a9b7114e
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/thunderbolt/switch.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 6a2116cbb06f9..28febb95f8fa1 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -3599,6 +3599,7 @@ void tb_switch_suspend(struct tb_switch *sw, bool runtime)
 		flags |= TB_WAKE_ON_USB4;
 		flags |= TB_WAKE_ON_USB3 | TB_WAKE_ON_PCIE | TB_WAKE_ON_DP;
 	} else if (device_may_wakeup(&sw->dev)) {
+		flags |= TB_WAKE_ON_CONNECT | TB_WAKE_ON_DISCONNECT;
 		flags |= TB_WAKE_ON_USB4 | TB_WAKE_ON_USB3 | TB_WAKE_ON_PCIE;
 	}
 
-- 
2.43.0


             reply	other threads:[~2025-04-10  4:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10  4:36 Mario Limonciello [this message]
2025-04-11 11:24 ` [PATCH] thunderbolt: Use wake on connect and disconnect over suspend Mika Westerberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250410043717.2291559-1-superm1@kernel.org \
    --to=superm1@kernel.org \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=michael.jamet@intel.com \
    --cc=puthik@google.com \
    --cc=richard.gong@amd.com \
    --cc=rrangel@chromium.org \
    --cc=sanath.s@amd.com \
    --cc=utkarsh.h.patel@intel.com \
    --cc=westeri@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox