public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Scian <rnd4@dave-tech.it>
To: linux-omap@vger.kernel.org
Subject: RFC: PATCH TI81xx fix MUSB software mode setting
Date: Mon, 18 Jun 2012 16:55:28 +0200	[thread overview]
Message-ID: <4FDF4160.5040907@dave-tech.it> (raw)

[-- 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


             reply	other threads:[~2012-06-18 15:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-18 14:55 Andrea Scian [this message]
     [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

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=4FDF4160.5040907@dave-tech.it \
    --to=rnd4@dave-tech.it \
    --cc=linux-omap@vger.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