Thread (14 messages) 14 messages, 2 authors, 2021-12-06

[PATCH 2/3] usb: aspeed-vhub: support remote wakeup feature

flat view

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2021-11-29 23:51:13
Also in: linux-arm-kernel, linux-usb, lkml

On Fri, 2021-11-26 at 19:09 +0800, Neal Liu wrote:
Remote wakeup signaling will be automatically issued
whenever any write commands has been received in suspend
state.
quoted hunk ↗ jump to hunk
--- a/drivers/usb/gadget/udc/aspeed-vhub/core.c
+++ b/drivers/usb/gadget/udc/aspeed-vhub/core.c
@@ -240,6 +240,9 @@ void ast_vhub_init_hw(struct ast_vhub *vhub)
 	if (vhub->force_usb1)
 		ctrl |= VHUB_CTRL_FULL_SPEED_ONLY;
 
+	/* Enable auto remote wakeup */
+	ctrl |= VHUB_CTRL_AUTO_REMOTE_WAKEUP;
+
 	ctrl |= VHUB_CTRL_UPSTREAM_CONNECT;
 	writel(ctrl, vhub->regs + AST_VHUB_CTRL);
Should this  be controlled by d->wakeup_en ? IE, we have a feature for
the host to enable/disable remote wakeup, should we honor it ?
 
quoted hunk ↗ jump to hunk
+	} else if (wValue == USB_DEVICE_TEST_MODE) {
+		val = readl(d->vhub->regs + AST_VHUB_CTRL);
+		val &= ~GENMASK(10, 8);
+		val |= VHUB_CTRL_SET_TEST_MODE((wIndex >> 8) & 0x7);
+		writel(val, d->vhub->regs + AST_VHUB_CTRL);
This is unrelated to remote wakeup is it ? In which case it should
probably be a separate patch.

Cheers,
Ben.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help