Re: [PATCH 10/15] usb: musb: Don't set d+ high before enable for 2430 glue layer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, May 13, 2016 at 03:35:40PM -0700, Tony Lindgren wrote:
> * Tony Lindgren <tony@xxxxxxxxxxx> [160513 14:19]:
> > * Bin Liu <b-liu@xxxxxx> [160513 14:05]:
> > > In stead of removing it, session bit should only be set when musb_mode
> > > == MUSB_HOST, will this fix the D+ pullup problem?
> > 
> > Good point, I forgot about it being specific to host mode. I'll check.
> 
> Yeah good call, the patch below fixes the issue. Then we can remove the

Good to know it fixes the issue.

> set_mode later if the generic approach looks OK to you.

I don't think we need to add the generic approach which sets session bit
in core set_mode(), at least for now, because only omap2430 glue needs
to set the session bit in its set_mode(), no one else does so.

Regards,
-Bin.

> 
> Regards,
> 
> Tony
> 
> 8< ----------------------
> From: Tony Lindgren <tony@xxxxxxxxxxx>
> Date: Fri, 13 May 2016 07:59:35 -0700
> Subject: [PATCH] usb: musb: Don't set d+ high before enable for 2430 glue
>  layer
> 
> At least 2430 glue layer pulls d+ high on start up even if there are
> no gadgets configured. This is bad at least for anything using a separate
> battery charger chip as it can confuse the charger detection.
> 
> Let's fix the issue by only setting the SESSION bit in host mode
> as suggested by Bin Liu <b-liu@xxxxxx>.
> 
> Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx>
> 
> --- a/drivers/usb/musb/omap2430.c
> +++ b/drivers/usb/musb/omap2430.c
> @@ -124,8 +124,12 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
>  
>  static int omap2430_musb_set_mode(struct musb *musb, u8 musb_mode)
>  {
> -	u8	devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
> +	u8 devctl;
>  
> +	if (musb_mode != MUSB_HOST)
> +		return 0;
> +
> +	devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
>  	devctl |= MUSB_DEVCTL_SESSION;
>  	musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
>  
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux