From: David Brownell <david-b@pacbell.net>
To: Dirk Behme <dirk.behme@googlemail.com>
Cc: linux-omap-open-source@linux.omap.com
Subject: Re: [PATCH] ARM: OMAP: Fix warning in plat_uds.c
Date: Mon, 20 Aug 2007 01:41:47 -0700 [thread overview]
Message-ID: <200708200141.48452.david-b@pacbell.net> (raw)
In-Reply-To: <46C939F2.5070903@googlemail.com>
On Sunday 19 August 2007, Dirk Behme wrote:
>
> Sorry for stupid question from a non-USB expert: But what is the
> proposed fix for this now? ;)
Something not totally unlike the appended. Build-tested only.
============================================== CUT HERE
Fix various build warnings for peripheral-only builds, and some
linewrap bugs.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
drivers/usb/musb/musbdefs.h | 4 ++--
drivers/usb/musb/plat_uds.c | 28 +++++++++++++++++-----------
drivers/usb/musb/tusb6010.c | 4 ----
3 files changed, 19 insertions(+), 17 deletions(-)
--- o26.orig/drivers/usb/musb/plat_uds.c 2007-08-20 00:28:38.000000000 -0700
+++ o26/drivers/usb/musb/plat_uds.c 2007-08-20 01:39:59.000000000 -0700
@@ -364,9 +364,7 @@ static irqreturn_t musb_stage0_irq(struc
u8 devctl, u8 power)
{
irqreturn_t handled = IRQ_NONE;
-#ifdef CONFIG_USB_MUSB_HDRC_HCD
void __iomem *mbase = musb->mregs;
-#endif
DBG(3, "<== Power=%02x, DevCtl=%02x, int_usb=0x%x\n", power, devctl,
int_usb);
@@ -604,18 +602,18 @@ static irqreturn_t musb_stage0_irq(struc
* only host sees babble; only peripheral sees bus reset.
*/
if (int_usb & MUSB_INTR_RESET) {
- if (devctl & MUSB_DEVCTL_HM) {
+ if (is_host_capable() && (devctl & MUSB_DEVCTL_HM) != 0) {
/*
* Looks like non-HS BABBLE can be ignored, but
- * HS BABBLE is an error condition. For HS the solution
- * is to avoid babble in the first place and fix whatever
- * causes BABBLE. When HS BABBLE happens we can only stop
- * the session.
+ * HS BABBLE is an error condition. For HS the
+ * solution is to avoid babble in the first place
+ * and fix whatever causes BABBLE. When HS BABBLE
+ * happens we can only stop the session.
*/
if (devctl & (MUSB_DEVCTL_FSDEV | MUSB_DEVCTL_LSDEV))
DBG(1, "BABBLE devctl: %02x\n", devctl);
else {
- ERR("Stopping host session because of babble\n");
+ ERR("Stopping session because of babble\n");
musb_writeb(mbase, MUSB_DEVCTL, 0);
}
} else {
@@ -1705,6 +1703,11 @@ musb_vbus_show(struct device *dev, struc
}
static DEVICE_ATTR(vbus, 0644, musb_vbus_show, musb_vbus_store);
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
+
+/* Gadget drivers can't know that a host is connected so they might want
+ * to start SRP, but users can. This allows userspace to trigger SRP.
+ */
static ssize_t
musb_srp_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t n)
@@ -1727,7 +1730,10 @@ musb_srp_store(struct device *dev, struc
return n;
}
static DEVICE_ATTR(srp, 0644, NULL, musb_srp_store);
-#endif
+
+#endif /* CONFIG_USB_GADGET_MUSB_HDRC */
+
+#endif /* sysfs */
/* Only used to provide cable state change events */
static void musb_irq_work(struct work_struct *data)
@@ -2029,9 +2035,9 @@ fail:
status = device_create_file(dev, &dev_attr_mode);
status = device_create_file(dev, &dev_attr_cable);
status = device_create_file(dev, &dev_attr_vbus);
-#ifdef CONFIG_USB_MUSB_OTG
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
status = device_create_file(dev, &dev_attr_srp);
-#endif /* CONFIG_USB_MUSB_OTG */
+#endif /* CONFIG_USB_GADGET_MUSB_HDRC */
status = 0;
#endif
--- o26.orig/drivers/usb/musb/musbdefs.h 2007-08-20 00:28:37.000000000 -0700
+++ o26/drivers/usb/musb/musbdefs.h 2007-08-20 00:44:33.000000000 -0700
@@ -328,12 +328,12 @@ struct musb {
irqreturn_t (*isr)(int, void *);
struct work_struct irq_work;
-#ifdef CONFIG_USB_MUSB_HDRC_HCD
-
/* this hub status bit is reserved by USB 2.0 and not seen by usbcore */
#define MUSB_PORT_STAT_RESUME (1 << 31)
u32 port1_status;
+
+#ifdef CONFIG_USB_MUSB_HDRC_HCD
unsigned long rh_timer;
enum musb_h_ep0_state ep0_stage;
--- o26.orig/drivers/usb/musb/tusb6010.c 2007-08-20 00:28:38.000000000 -0700
+++ o26/drivers/usb/musb/tusb6010.c 2007-08-20 00:46:18.000000000 -0700
@@ -438,11 +438,9 @@ static void musb_do_idle(unsigned long _
if (!musb->is_active) {
u32 wakeups;
-#ifdef CONFIG_USB_MUSB_HDRC_HCD
/* wait until khubd handles port change status */
if (is_host_active(musb) && (musb->port1_status >> 16))
goto done;
-#endif
#ifdef CONFIG_USB_GADGET_MUSB_HDRC
if (is_peripheral_enabled(musb) && !musb->gadget_driver)
@@ -586,7 +584,6 @@ void musb_platform_set_mode(struct musb
{
void __iomem *base = musb->ctrl_base;
u32 otg_stat, phy_otg_ctrl, phy_otg_ena, dev_conf;
- int vbus = 0;
if (musb->board_mode != MUSB_OTG) {
ERR("Changing mode currently only supported in OTG mode\n");
@@ -606,7 +603,6 @@ void musb_platform_set_mode(struct musb
phy_otg_ena |= TUSB_PHY_OTG_CTRL_OTG_ID_PULLUP;
dev_conf |= TUSB_DEV_CONF_ID_SEL;
dev_conf &= ~TUSB_DEV_CONF_SOFT_ID;
- vbus = 1;
break;
#endif
next prev parent reply other threads:[~2007-08-20 8:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-17 15:43 [PATCH] ARM: OMAP: Fix warning in plat_uds.c Dirk Behme
2007-08-17 16:12 ` Felipe Balbi
2007-08-17 16:39 ` Dirk Behme
2007-08-17 16:57 ` David Brownell
2007-08-17 18:14 ` Felipe Balbi
2007-08-17 18:30 ` David Brownell
2007-08-17 20:36 ` Felipe Balbi
2007-08-17 21:02 ` David Brownell
2007-08-20 6:51 ` Dirk Behme
2007-08-20 8:41 ` David Brownell [this message]
2007-08-20 9:59 ` Dirk Behme
2007-08-20 18:10 ` David Brownell
2007-08-21 7:24 ` Tony Lindgren
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=200708200141.48452.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=dirk.behme@googlemail.com \
--cc=linux-omap-open-source@linux.omap.com \
/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