* [RFC PATCH 0/5] musb changes @ 2008-05-13 12:29 Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached Felipe Balbi 0 siblings, 1 reply; 10+ messages in thread From: Felipe Balbi @ 2008-05-13 12:29 UTC (permalink / raw) To: linux-omap; +Cc: Felipe Balbi The following patches let musb keep vbus off as much as we can. Still under development but I'd like to get comments from people who have been working on usb lately. My current TODO would be turn off vbus as soon as we "eject" device (in case of mass storage devices) and port the same behavior to omap3. Felipe Balbi (5): USB: MUSB: Switch to a_idle when micro/mini-a cable is attached USB: MUSB: Change srp sysfs entry to session USB: MUSB: Do not turn vbus on immediately USB: MUSB: Always allow musb to idle USB: MUSB: We already know the default timeout drivers/usb/musb/musb_core.c | 72 +++++++++++++---------------------------- drivers/usb/musb/omap2430.c | 28 ++-------------- drivers/usb/musb/tusb6010.c | 38 +++++----------------- 3 files changed, 36 insertions(+), 102 deletions(-) ^ permalink raw reply [flat|nested] 10+ messages in thread
* [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached 2008-05-13 12:29 [RFC PATCH 0/5] musb changes Felipe Balbi @ 2008-05-13 12:29 ` Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 2/5] USB: MUSB: Change srp sysfs entry to session Felipe Balbi 2008-05-16 17:38 ` [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached Tony Lindgren 0 siblings, 2 replies; 10+ messages in thread From: Felipe Balbi @ 2008-05-13 12:29 UTC (permalink / raw) To: linux-omap; +Cc: ext Felipe Balbi From: ext Felipe Balbi <felipe.balbi@nokia.com> This is mostly cosmetic but can help us in the future making musb driver not insertion-based. I mean, whenever we attach micro-/mini-A connector to musb-based devices, we instantaneously turn vbus on where we should wait until we need to use the bus. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> --- drivers/usb/musb/tusb6010.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 1f3643b..9f92cef 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -673,6 +673,8 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) default_a = is_host_enabled(musb); DBG(2, "Default-%c\n", default_a ? 'A' : 'B'); musb->xceiv.default_a = default_a; + musb->xceiv.state = default_a ? OTG_STATE_A_IDLE + : OTG_STATE_B_IDLE; tusb_source_power(musb, default_a); /* Don't allow idling immediately */ -- 1.5.5.1.125.gc697a ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [RFC PATCH 2/5] USB: MUSB: Change srp sysfs entry to session 2008-05-13 12:29 ` [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached Felipe Balbi @ 2008-05-13 12:29 ` Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 3/5] USB: MUSB: Do not turn vbus on immediately Felipe Balbi 2008-05-16 17:38 ` [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached Tony Lindgren 1 sibling, 1 reply; 10+ messages in thread From: Felipe Balbi @ 2008-05-13 12:29 UTC (permalink / raw) To: linux-omap; +Cc: ext Felipe Balbi From: ext Felipe Balbi <felipe.balbi@nokia.com> The name session is more generic as this interface could be used also by host side to turn vbus on. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> --- drivers/usb/musb/musb_core.c | 42 +++++++++++++++++++++--------------------- 1 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 019898a..5b58d18 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1736,32 +1736,36 @@ musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf) } 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, +musb_session_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) { struct musb *musb = dev_to_musb(dev); - unsigned short srp; + unsigned short session; - if (sscanf(buf, "%hu", &srp) != 1 - || (srp != 1)) { - printk(KERN_ERR "SRP: Value must be 1\n"); + if (sscanf(buf, "%hu", &session) != 1 + || (session != 1)) { + printk(KERN_ERR "Value must be 1\n"); return -EINVAL; } - if (srp == 1) - musb_g_wakeup(musb); + if (session == 1) { + switch (musb->xceiv.state) { + case OTG_STATE_B_IDLE: + musb_g_wakeup(musb); + break; + case OTG_STATE_A_IDLE: + musb_set_vbus(musb, 1); + break; + default: + printk(KERN_INFO "Vbus might be on already\n"); + break; + } + } return n; } -static DEVICE_ATTR(srp, 0644, NULL, musb_srp_store); - -#endif /* CONFIG_USB_GADGET_MUSB_HDRC */ +static DEVICE_ATTR(session, 0644, NULL, musb_session_store); #endif /* sysfs */ @@ -1839,9 +1843,7 @@ static void musb_free(struct musb *musb) #ifdef CONFIG_SYSFS device_remove_file(musb->controller, &dev_attr_mode); device_remove_file(musb->controller, &dev_attr_vbus); -#ifdef CONFIG_USB_MUSB_OTG - device_remove_file(musb->controller, &dev_attr_srp); -#endif + device_remove_file(musb->controller, &dev_attr_session); #endif #ifdef CONFIG_USB_GADGET_MUSB_HDRC @@ -2075,9 +2077,7 @@ fail: #ifdef CONFIG_SYSFS status = device_create_file(dev, &dev_attr_mode); status = device_create_file(dev, &dev_attr_vbus); -#ifdef CONFIG_USB_GADGET_MUSB_HDRC - status = device_create_file(dev, &dev_attr_srp); -#endif /* CONFIG_USB_GADGET_MUSB_HDRC */ + status = device_create_file(dev, &dev_attr_session); status = 0; #endif -- 1.5.5.1.125.gc697a ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [RFC PATCH 3/5] USB: MUSB: Do not turn vbus on immediately 2008-05-13 12:29 ` [RFC PATCH 2/5] USB: MUSB: Change srp sysfs entry to session Felipe Balbi @ 2008-05-13 12:29 ` Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 4/5] USB: MUSB: Always allow musb to idle Felipe Balbi 2008-05-16 17:39 ` [RFC PATCH 3/5] USB: MUSB: Do not turn vbus on immediately Tony Lindgren 0 siblings, 2 replies; 10+ messages in thread From: Felipe Balbi @ 2008-05-13 12:29 UTC (permalink / raw) To: linux-omap; +Cc: ext Felipe Balbi From: ext Felipe Balbi <felipe.balbi@nokia.com> Wait for user interaction to turn vbus on. On end user products, this behavior could be masked under some application with permission to write to /sys/devices/platform/musb_hdrc/session. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> --- drivers/usb/musb/tusb6010.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 9f92cef..14220d9 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -675,11 +675,6 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) musb->xceiv.default_a = default_a; musb->xceiv.state = default_a ? OTG_STATE_A_IDLE : OTG_STATE_B_IDLE; - tusb_source_power(musb, default_a); - - /* Don't allow idling immediately */ - if (default_a) - idle_timeout = jiffies + (HZ * 3); } /* VBUS state change */ -- 1.5.5.1.125.gc697a ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [RFC PATCH 4/5] USB: MUSB: Always allow musb to idle 2008-05-13 12:29 ` [RFC PATCH 3/5] USB: MUSB: Do not turn vbus on immediately Felipe Balbi @ 2008-05-13 12:29 ` Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 5/5] USB: MUSB: We already know the default timeout Felipe Balbi 2008-05-16 17:39 ` [RFC PATCH 3/5] USB: MUSB: Do not turn vbus on immediately Tony Lindgren 1 sibling, 1 reply; 10+ messages in thread From: Felipe Balbi @ 2008-05-13 12:29 UTC (permalink / raw) To: linux-omap; +Cc: ext Felipe Balbi From: ext Felipe Balbi <felipe.balbi@nokia.com> We can conserve more power if we always let it idle when there's nothing using the bus. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> --- drivers/usb/musb/omap2430.c | 28 ++++------------------------ drivers/usb/musb/tusb6010.c | 31 +++++++------------------------ 2 files changed, 11 insertions(+), 48 deletions(-) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 36f1739..5c948e5 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -46,6 +46,7 @@ #endif #define MUSB_TIMEOUT_A_WAIT_BCON 1100 +#define MUSB_DEFAULT_TIMEOUT 500 static struct timer_list musb_idle_timer; @@ -109,34 +110,12 @@ static void musb_do_idle(unsigned long _musb) void musb_platform_try_idle(struct musb *musb, unsigned long timeout) { - unsigned long default_timeout = jiffies + msecs_to_jiffies(3); - static unsigned long last_timer; - - if (timeout == 0) - timeout = default_timeout; - - /* Never idle if active, or when VBUS timeout is not set as host */ - if (musb->is_active || ((musb->a_wait_bcon == 0) - && (musb->xceiv.state == OTG_STATE_A_WAIT_BCON))) { - DBG(4, "%s active, deleting timer\n", otg_state_string(musb)); - del_timer(&musb_idle_timer); - last_timer = jiffies; - return; - } - - if (time_after(last_timer, timeout)) { - if (!timer_pending(&musb_idle_timer)) - last_timer = timeout; - else { - DBG(4, "Longer idle timer already pending, ignoring\n"); - return; - } - } - last_timer = timeout; + unsigned long default_timeout = musb->idle_timeout; DBG(4, "%s inactive, for idle timer for %lu ms\n", otg_state_string(musb), (unsigned long)jiffies_to_msecs(timeout - jiffies)); + mod_timer(&musb_idle_timer, timeout); } @@ -246,6 +225,7 @@ int __init musb_platform_init(struct musb *musb) if (is_peripheral_enabled(musb)) musb->xceiv.set_power = omap_set_power; musb->a_wait_bcon = MUSB_TIMEOUT_A_WAIT_BCON; + musb->idle_timeout = MUSB_DEFAULT_TIMEOUT; setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb); diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 14220d9..ecdf41e 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -30,6 +30,8 @@ static void tusb_source_power(struct musb *musb, int is_on); #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) +#define MUSB_DEFAULT_TIMEOUT 500 + /* * Checks the revision. We need to use the DMA register as 3.0 does not * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. @@ -476,34 +478,12 @@ done: */ void musb_platform_try_idle(struct musb *musb, unsigned long timeout) { - unsigned long default_timeout = jiffies + msecs_to_jiffies(3); - static unsigned long last_timer; - - if (timeout == 0) - timeout = default_timeout; - - /* Never idle if active, or when VBUS timeout is not set as host */ - if (musb->is_active || ((musb->a_wait_bcon == 0) - && (musb->xceiv.state == OTG_STATE_A_WAIT_BCON))) { - DBG(4, "%s active, deleting timer\n", otg_state_string(musb)); - del_timer(&musb_idle_timer); - last_timer = jiffies; - return; - } - - if (time_after(last_timer, timeout)) { - if (!timer_pending(&musb_idle_timer)) - last_timer = timeout; - else { - DBG(4, "Longer idle timer already pending, ignoring\n"); - return; - } - } - last_timer = timeout; + unsigned long default_timeout = musb->idle_timeout; DBG(4, "%s inactive, for idle timer for %lu ms\n", otg_state_string(musb), (unsigned long)jiffies_to_msecs(timeout - jiffies)); + mod_timer(&musb_idle_timer, timeout); } @@ -1128,6 +1108,9 @@ int __init musb_platform_init(struct musb *musb) if (is_peripheral_enabled(musb)) musb->xceiv.set_power = tusb_draw_power; + /* Default idle_timeout in ms */ + musb->idle_timeout = MUSB_DEFAULT_TIMEOUT; + setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb); return ret; -- 1.5.5.1.125.gc697a ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [RFC PATCH 5/5] USB: MUSB: We already know the default timeout 2008-05-13 12:29 ` [RFC PATCH 4/5] USB: MUSB: Always allow musb to idle Felipe Balbi @ 2008-05-13 12:29 ` Felipe Balbi 0 siblings, 0 replies; 10+ messages in thread From: Felipe Balbi @ 2008-05-13 12:29 UTC (permalink / raw) To: linux-omap; +Cc: ext Felipe Balbi From: ext Felipe Balbi <felipe.balbi@nokia.com> Default idle timeout is set on platform_init, not need to report it anymore. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> --- drivers/usb/musb/musb_core.c | 30 ++---------------------------- 1 files changed, 2 insertions(+), 28 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 5b58d18..c407607 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1696,45 +1696,19 @@ musb_mode_store(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR(mode, 0644, musb_mode_show, musb_mode_store); static ssize_t -musb_vbus_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t n) -{ - struct musb *musb = dev_to_musb(dev); - unsigned long flags; - unsigned long val; - - if (sscanf(buf, "%lu", &val) < 1) { - printk(KERN_ERR "Invalid VBUS timeout ms value\n"); - return -EINVAL; - } - - spin_lock_irqsave(&musb->lock, flags); - musb->a_wait_bcon = val; - if (musb->xceiv.state == OTG_STATE_A_WAIT_BCON) - musb->is_active = 0; - musb_platform_try_idle(musb, jiffies + msecs_to_jiffies(val)); - spin_unlock_irqrestore(&musb->lock, flags); - - return n; -} - -static ssize_t musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf) { struct musb *musb = dev_to_musb(dev); unsigned long flags; - unsigned long val; int vbus; spin_lock_irqsave(&musb->lock, flags); - val = musb->a_wait_bcon; vbus = musb_platform_get_vbus_status(musb); spin_unlock_irqrestore(&musb->lock, flags); - return sprintf(buf, "Vbus %s, timeout %lu\n", - vbus ? "on" : "off", val); + return sprintf(buf, "Vbus %s\n", vbus ? "on" : "off"); } -static DEVICE_ATTR(vbus, 0644, musb_vbus_show, musb_vbus_store); +static DEVICE_ATTR(vbus, 0444, musb_vbus_show, NULL); static ssize_t musb_session_store(struct device *dev, struct device_attribute *attr, -- 1.5.5.1.125.gc697a ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [RFC PATCH 3/5] USB: MUSB: Do not turn vbus on immediately 2008-05-13 12:29 ` [RFC PATCH 3/5] USB: MUSB: Do not turn vbus on immediately Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 4/5] USB: MUSB: Always allow musb to idle Felipe Balbi @ 2008-05-16 17:39 ` Tony Lindgren 1 sibling, 0 replies; 10+ messages in thread From: Tony Lindgren @ 2008-05-16 17:39 UTC (permalink / raw) To: Felipe Balbi; +Cc: linux-omap * Felipe Balbi <felipe.balbi@nokia.com> [080513 05:35]: > From: ext Felipe Balbi <felipe.balbi@nokia.com> > > Wait for user interaction to turn vbus on. > On end user products, this behavior could be > masked under some application with permission to > write to /sys/devices/platform/musb_hdrc/session. Again, this breaks USB host support for basic USB devices. Tony > Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> > --- > drivers/usb/musb/tusb6010.c | 5 ----- > 1 files changed, 0 insertions(+), 5 deletions(-) > > diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c > index 9f92cef..14220d9 100644 > --- a/drivers/usb/musb/tusb6010.c > +++ b/drivers/usb/musb/tusb6010.c > @@ -675,11 +675,6 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) > musb->xceiv.default_a = default_a; > musb->xceiv.state = default_a ? OTG_STATE_A_IDLE > : OTG_STATE_B_IDLE; > - tusb_source_power(musb, default_a); > - > - /* Don't allow idling immediately */ > - if (default_a) > - idle_timeout = jiffies + (HZ * 3); > } > > /* VBUS state change */ > -- > 1.5.5.1.125.gc697a > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached 2008-05-13 12:29 ` [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 2/5] USB: MUSB: Change srp sysfs entry to session Felipe Balbi @ 2008-05-16 17:38 ` Tony Lindgren 2008-05-16 18:33 ` Felipe Balbi 1 sibling, 1 reply; 10+ messages in thread From: Tony Lindgren @ 2008-05-16 17:38 UTC (permalink / raw) To: Felipe Balbi; +Cc: linux-omap * Felipe Balbi <felipe.balbi@nokia.com> [080513 05:33]: > From: ext Felipe Balbi <felipe.balbi@nokia.com> > > This is mostly cosmetic but can help us in the future > making musb driver not insertion-based. > > I mean, whenever we attach micro-/mini-A connector to > musb-based devices, we instantaneously turn vbus on where > we should wait until we need to use the bus. This would break standard host behavious of basic USB devices that don't support SRP? Tony > Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> > --- > drivers/usb/musb/tusb6010.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c > index 1f3643b..9f92cef 100644 > --- a/drivers/usb/musb/tusb6010.c > +++ b/drivers/usb/musb/tusb6010.c > @@ -673,6 +673,8 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) > default_a = is_host_enabled(musb); > DBG(2, "Default-%c\n", default_a ? 'A' : 'B'); > musb->xceiv.default_a = default_a; > + musb->xceiv.state = default_a ? OTG_STATE_A_IDLE > + : OTG_STATE_B_IDLE; > tusb_source_power(musb, default_a); > > /* Don't allow idling immediately */ > -- > 1.5.5.1.125.gc697a > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached 2008-05-16 17:38 ` [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached Tony Lindgren @ 2008-05-16 18:33 ` Felipe Balbi 2008-05-16 18:40 ` Tony Lindgren 0 siblings, 1 reply; 10+ messages in thread From: Felipe Balbi @ 2008-05-16 18:33 UTC (permalink / raw) To: Tony Lindgren; +Cc: Felipe Balbi, linux-omap On Fri, 16 May 2008 10:38:43 -0700, Tony Lindgren <tony@atomide.com> wrote: > * Felipe Balbi <felipe.balbi@nokia.com> [080513 05:33]: >> From: ext Felipe Balbi <felipe.balbi@nokia.com> >> >> This is mostly cosmetic but can help us in the future >> making musb driver not insertion-based. >> >> I mean, whenever we attach micro-/mini-A connector to >> musb-based devices, we instantaneously turn vbus on where >> we should wait until we need to use the bus. > > This would break standard host behavious of basic USB devices that > don't support SRP? Hmm... the way it is today yeah, but I can keep the behaviour that we try to turn vbus on whenever we attach micro/mini-a. But I was thinking on letting a file manager (or any other application that would use usb) to turn vbus on. If it's a mass storage device, you could let file manager write to session sysfs entry (which I'm changing to make it work on both roles). > > Tony > >> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> >> --- >> drivers/usb/musb/tusb6010.c | 2 ++ >> 1 files changed, 2 insertions(+), 0 deletions(-) >> >> diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c >> index 1f3643b..9f92cef 100644 >> --- a/drivers/usb/musb/tusb6010.c >> +++ b/drivers/usb/musb/tusb6010.c >> @@ -673,6 +673,8 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void > __iomem *tbase) >> default_a = is_host_enabled(musb); >> DBG(2, "Default-%c\n", default_a ? 'A' : 'B'); >> musb->xceiv.default_a = default_a; >> + musb->xceiv.state = default_a ? OTG_STATE_A_IDLE >> + : OTG_STATE_B_IDLE; >> tusb_source_power(musb, default_a); >> >> /* Don't allow idling immediately */ >> -- >> 1.5.5.1.125.gc697a >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-omap" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Best Regards, Felipe Balbi http://felipebalbi.com me@felipebalbi.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached 2008-05-16 18:33 ` Felipe Balbi @ 2008-05-16 18:40 ` Tony Lindgren 0 siblings, 0 replies; 10+ messages in thread From: Tony Lindgren @ 2008-05-16 18:40 UTC (permalink / raw) To: Felipe Balbi; +Cc: Felipe Balbi, linux-omap * Felipe Balbi <me@felipebalbi.com> [080516 11:33]: > > > On Fri, 16 May 2008 10:38:43 -0700, Tony Lindgren <tony@atomide.com> wrote: > > * Felipe Balbi <felipe.balbi@nokia.com> [080513 05:33]: > >> From: ext Felipe Balbi <felipe.balbi@nokia.com> > >> > >> This is mostly cosmetic but can help us in the future > >> making musb driver not insertion-based. > >> > >> I mean, whenever we attach micro-/mini-A connector to > >> musb-based devices, we instantaneously turn vbus on where > >> we should wait until we need to use the bus. > > > > This would break standard host behavious of basic USB devices that > > don't support SRP? > > Hmm... the way it is today yeah, but I can keep the behaviour > that we try to turn vbus on whenever we attach micro/mini-a. But > I was thinking on letting a file manager (or any other application > that would use usb) to turn vbus on. > > If it's a mass storage device, you could let file manager write > to session sysfs entry (which I'm changing to make it work on > both roles). I guess that could be optional behaviour assuming it does not break "normal" behaviour :) Tony > > > > > Tony > > > >> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> > >> --- > >> drivers/usb/musb/tusb6010.c | 2 ++ > >> 1 files changed, 2 insertions(+), 0 deletions(-) > >> > >> diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c > >> index 1f3643b..9f92cef 100644 > >> --- a/drivers/usb/musb/tusb6010.c > >> +++ b/drivers/usb/musb/tusb6010.c > >> @@ -673,6 +673,8 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void > > __iomem *tbase) > >> default_a = is_host_enabled(musb); > >> DBG(2, "Default-%c\n", default_a ? 'A' : 'B'); > >> musb->xceiv.default_a = default_a; > >> + musb->xceiv.state = default_a ? OTG_STATE_A_IDLE > >> + : OTG_STATE_B_IDLE; > >> tusb_source_power(musb, default_a); > >> > >> /* Don't allow idling immediately */ > >> -- > >> 1.5.5.1.125.gc697a > >> > >> -- > >> To unsubscribe from this list: send the line "unsubscribe linux-omap" in > >> the body of a message to majordomo@vger.kernel.org > >> More majordomo info at http://vger.kernel.org/majordomo-info.html > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- > Best Regards, > > Felipe Balbi > http://felipebalbi.com > me@felipebalbi.com > ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-05-16 18:40 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-05-13 12:29 [RFC PATCH 0/5] musb changes Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 2/5] USB: MUSB: Change srp sysfs entry to session Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 3/5] USB: MUSB: Do not turn vbus on immediately Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 4/5] USB: MUSB: Always allow musb to idle Felipe Balbi 2008-05-13 12:29 ` [RFC PATCH 5/5] USB: MUSB: We already know the default timeout Felipe Balbi 2008-05-16 17:39 ` [RFC PATCH 3/5] USB: MUSB: Do not turn vbus on immediately Tony Lindgren 2008-05-16 17:38 ` [RFC PATCH 1/5] USB: MUSB: Switch to a_idle when micro/mini-a cable is attached Tony Lindgren 2008-05-16 18:33 ` Felipe Balbi 2008-05-16 18:40 ` Tony Lindgren
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox