From: Ravi Babu <ravibabu@ti.com>
To: <linux-usb@vger.kernel.org>
Cc: <balbi@ti.com>, <linux-kernel@vger.kernel.org>,
Ravi Babu <ravibabu@ti.com>
Subject: [PATCH v1 1/3] usb: musb: core: added musb_restart() API to handle babble condition
Date: Wed, 29 May 2013 18:37:02 +0530 [thread overview]
Message-ID: <1369832824-29071-2-git-send-email-ravibabu@ti.com> (raw)
In-Reply-To: <1369832824-29071-1-git-send-email-ravibabu@ti.com>
Added musb_restart() API, used for restart of the musb controller by
the glue layer, when there is babble condition occured on the bus.
During babble condition, the musb controller will remove the session
and no longer in host-mode. As part of recovery this API can be used
to restart the musb controller.
Signed-off-by: Ravi Babu <ravibabu@ti.com>
---
drivers/usb/musb/musb_core.c | 24 ++++++++++++++++++++++++
drivers/usb/musb/musb_core.h | 1 +
2 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 37a261a..ab6fa39 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1373,6 +1373,30 @@ static int ep_config_from_hw(struct musb *musb)
return 0;
}
+/*
+ * musb_restart - restarts musb controller
+ * @param musb the controller
+ */
+int musb_restart(struct musb *musb)
+{
+ int status = 0;
+
+ /* during babble condition the musb controller removes the
+ * session bit and the fifo table initialized value get changed
+ */
+ if (musb->dyn_fifo)
+ status = ep_config_from_table(musb);
+ else
+ status = ep_config_from_hw(musb);
+
+ /* starts session */
+ if (!status)
+ musb_start(musb);
+
+ return status;
+}
+EXPORT_SYMBOL_GPL(musb_restart);
+
enum { MUSB_CONTROLLER_MHDRC, MUSB_CONTROLLER_HDRC, };
/* Initialize MUSB (M)HDRC part of the USB hardware subsystem;
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 7fb4819..f96e899 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -522,6 +522,7 @@ extern const char musb_driver_name[];
extern void musb_start(struct musb *musb);
extern void musb_stop(struct musb *musb);
+extern int musb_restart(struct musb *musb);
extern void musb_write_fifo(struct musb_hw_ep *ep, u16 len, const u8 *src);
extern void musb_read_fifo(struct musb_hw_ep *ep, u16 len, u8 *dst);
--
1.7.0.4
next prev parent reply other threads:[~2013-05-29 13:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 13:07 [PATCH v1 0/3] babble error workaround for am335x platform Ravi Babu
2013-05-29 13:07 ` Ravi Babu [this message]
2013-06-26 8:24 ` [PATCH v1 1/3] usb: musb: core: added musb_restart() API to handle babble condition Felipe Balbi
2013-05-29 13:07 ` [PATCH v1 2/3] usb: musb: core: added babble recovery func-ptr to musb->ops Ravi Babu
2013-06-26 8:26 ` Felipe Balbi
2013-06-26 8:37 ` B, Ravi
2013-06-26 8:53 ` Felipe Balbi
2013-06-26 9:08 ` B, Ravi
2013-05-29 13:07 ` [PATCH v1 3/3] usb: musb: dsps: handle babble condition for dsps platform Ravi Babu
2013-06-26 8:29 ` Felipe Balbi
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=1369832824-29071-2-git-send-email-ravibabu@ti.com \
--to=ravibabu@ti.com \
--cc=balbi@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@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
all inboxes | Powered by JetHome®