From: Paul Kocialkowski <contact@paulk.fr>
To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Bin Liu <b-liu@ti.com>, Chen-Yu Tsai <wens@csie.org>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Paul Kocialkowski <contact@paulk.fr>
Subject: [PATCH] usb: musb: Support gadget mode when the port is set to dual role
Date: Wed, 28 Mar 2018 23:52:13 +0200 [thread overview]
Message-ID: <20180328215213.29538-1-contact@paulk.fr> (raw)
This allows dual-role ports to be reported as having gadget mode by the
musb_has_gadget helper. This is required to enable MUSB at all with MUSB
glue layers that set the port mode to MUSB_PORT_MODE_DUAL_ROLE at init.
Most notably, this allows calling musb_start when needed in the virtual
MUSB root HUB, regardless of whether the current mode should be gadget
or host.
This fixes USB OTG on Allwinner devices that I could test it with,
mainly A20 devices.
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
---
drivers/usb/musb/musb_virthub.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c
index 5165d2b07ade..8fd5c5f86e82 100644
--- a/drivers/usb/musb/musb_virthub.c
+++ b/drivers/usb/musb/musb_virthub.c
@@ -249,7 +249,8 @@ static int musb_has_gadget(struct musb *musb)
#ifdef CONFIG_USB_MUSB_HOST
return 1;
#else
- return musb->port_mode == MUSB_PORT_MODE_HOST;
+ return musb->port_mode == MUSB_PORT_MODE_HOST ||
+ musb->port_mode == MUSB_PORT_MODE_DUAL_ROLE;
#endif
}
--
2.16.2
next reply other threads:[~2018-03-28 21:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-28 21:52 Paul Kocialkowski [this message]
2018-03-29 9:23 ` Maxime Ripard
2018-03-29 11:57 ` Paul Kocialkowski
2018-04-03 9:29 ` Maxime Ripard
2018-04-21 10:51 ` Paul Kocialkowski
2018-04-20 14:25 ` Bin Liu
2018-04-21 10:59 ` Paul Kocialkowski
2018-04-21 14:34 ` Bin Liu
2018-04-30 21:08 ` Paul Kocialkowski
2018-05-01 12:25 ` Bin Liu
2018-05-01 13:26 ` Paul Kocialkowski
2018-05-01 16:22 ` Bin Liu
2019-03-21 10:02 ` Bin Liu
2019-03-21 13:01 ` Maxime Ripard
2019-03-21 16:41 ` Greg Kroah-Hartman
2019-03-22 12:46 ` Bin Liu
2019-03-22 13:09 ` Maxime Ripard
2019-03-22 13:28 ` Bin Liu
2019-03-22 13:34 ` Paul Kocialkowski
2019-03-22 13:44 ` Bin Liu
2019-03-22 13:46 ` Maxime Ripard
2019-03-22 14:04 ` Bin Liu
2019-03-22 13:10 ` Paul Kocialkowski
2019-03-22 13:36 ` Bin Liu
2019-03-22 13:37 ` Paul Kocialkowski
2019-03-22 13:46 ` Bin Liu
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=20180328215213.29538-1-contact@paulk.fr \
--to=contact@paulk.fr \
--cc=b-liu@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=maxime.ripard@bootlin.com \
--cc=wens@csie.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
all inboxes | Powered by JetHome®