lkml.org 
[lkml]   [2013]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/5] usb: musb: ux500: add otg notifier support
Hello Felipe,

On Mon, Mar 04, 2013 at 04:38:10PM +0200, Felipe Balbi wrote:
> On Thu, Feb 28, 2013 at 11:38:52AM +0100, Fabio Baltieri wrote:
> > Add transceiver notifier event handling to the ux500 driver to set vbus
> > on specific transceiver events.
> >
> > Acked-by: Linus Walleij <linus.walleij@linaro.org>
> > Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
> > ---
> > drivers/usb/musb/ux500.c | 41 +++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 41 insertions(+)
> >
> > diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
> > index 5b742ba..b20326bb 100644
> > --- a/drivers/usb/musb/ux500.c
> > +++ b/drivers/usb/musb/ux500.c
> > @@ -98,6 +98,36 @@ static void ux500_musb_set_vbus(struct musb *musb, int is_on)
> > musb_readb(musb->mregs, MUSB_DEVCTL));
> > }
> >
> > +static int musb_otg_notifications(struct notifier_block *nb,
> > + unsigned long event, void *unused)
> > +{
> > + struct musb *musb = container_of(nb, struct musb, nb);
> > +
> > + dev_dbg(musb->controller, "musb_otg_notifications %ld %s\n",
> > + event, otg_state_string(musb->xceiv->state));
> > +
> > + switch (event) {
> > + case USB_EVENT_ID:
> > + dev_dbg(musb->controller, "ID GND\n");
> > + ux500_musb_set_vbus(musb, 1);
> > + break;
> > + case USB_EVENT_VBUS:
> > + dev_dbg(musb->controller, "VBUS Connect\n");
>
> are you sure this is correct ? you're not doing anything in case of
> vbus event. Shouldn't you make sure your vbus is off ?

The implementation I'm taking as reference for this patches does not do
anything on VBUS event and as I can see from commmit history, it has
been based on the omap2430 one, that in turns used to just run phy_init
- and that's not implemented. But...

> What if your user uses a non-standard cable which has id-pin grounded
> on both sides ?

A cable with two micro/mini connectors with grounded IDs? Did you ever
encountered such a thing? I guess a ux500_musb_set_vbus(musb, 0) would
not hurt in that case.

Fabio

--
Fabio Baltieri


\
 
 \ /
  Last update: 2013-03-06 03:21    [W:0.097 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site