public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* RFC: PATCH TI81xx fix MUSB software mode setting
@ 2012-06-18 14:55 Andrea Scian
  0 siblings, 0 replies; 3+ messages in thread
From: Andrea Scian @ 2012-06-18 14:55 UTC (permalink / raw)
  To: linux-omap

[-- Attachment #1: Type: text/plain, Size: 856 bytes --]


Dear all,

when configuring our platform (DM8148 based) to work with USB0 as device 
and USB1 as host I've found some problems.
It was fine if I configure both as device or both as host or enable only 
one port, but configure both in different modes lead to a not working 
configuration.
After a bit of debug I've found that probably the problem is inside 
ti81xx_musb_set_mode() because this configure the controller but does 
not set musb->board_mode. IIUC, without setting this structure the whole 
musb generic state machine does not work correctly.

Attached you can find the patch that fixed the problem on our board. I 
hope this can help others too and can be integrated inside the main tree.

Feel free to comment and tell me if I've done something wrong.

I hope the the patch format is quite correct for you.

Best Regards,


-- 

Andrea SCIAN

[-- Attachment #2: 0001-set-board_mode-too-when-forcing-musb-mode-in-this-wa.patch --]
[-- Type: text/plain, Size: 1140 bytes --]

>From d88b38b52d6561e8cee40cb7726fd4dc099fb07f Mon Sep 17 00:00:00 2001
From: Andrea Scian <andrea.scian@dave.eu>
Date: Mon, 18 Jun 2012 16:17:28 +0200
Subject: [PATCH] set board_mode too when forcing musb mode, in this way musb is initialized
 properly

---
 drivers/usb/musb/ti81xx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/ti81xx.c b/drivers/usb/musb/ti81xx.c
index 22390e7..3656c74 100644
--- a/drivers/usb/musb/ti81xx.c
+++ b/drivers/usb/musb/ti81xx.c
@@ -1011,6 +1011,7 @@ int ti81xx_musb_set_mode(struct musb *musb, u8 musb_mode)
 
 	/* TODO: implement this using CONF0 */
 	if (musb_mode == MUSB_HOST) {
+		musb->board_mode = MUSB_HOST;
 		regval = musb_readl(reg_base, USB_MODE_REG);
 
 		regval &= ~USBMODE_USBID_HIGH;
@@ -1023,6 +1024,7 @@ int ti81xx_musb_set_mode(struct musb *musb, u8 musb_mode)
 			musb_readl(reg_base, USB_MODE_REG), regval);
 	} else
 	if (musb_mode == MUSB_PERIPHERAL) {
+		musb->board_mode = MUSB_PERIPHERAL;
 		/* TODO commmented writing 8 to USB_MODE_REG device
 			mode is not working */
 		regval = musb_readl(reg_base, USB_MODE_REG);
-- 
1.6.5.GIT


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-19  7:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <464859D4BE03A84686BA47749242C1D03EA93DED@DBDE01.ent.ti.com>
2012-06-19  6:18 ` RFC: PATCH TI81xx fix MUSB software mode setting B, Ravi
2012-06-19  6:55   ` Andrea Scian - DAVE Simply Embedded
2012-06-18 14:55 Andrea Scian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox