[Gta04-owner] [PATCH 1/4] usb: phy: twl4030: make runtime pm more reliable.

NeilBrown neilb at suse.de
Wed Mar 4 07:24:59 CET 2015


On Mon, 2 Mar 2015 22:03:59 +0100 Pavel Machek <pavel at ucw.cz> wrote:

> Hi!
> 
> > +		status_changed =
> > +			(twl->linkstat == OMAP_MUSB_VBUS_VALID ||
> > +			 twl->linkstat == OMAP_MUSB_ID_GROUND)
> > +			!=
> > +			(status == OMAP_MUSB_VBUS_VALID ||
> > +			 status == OMAP_MUSB_ID_GROUND);
> >  		twl->linkstat = status;
> ...
> > @@ -768,6 +770,10 @@ static int twl4030_usb_remove(struct platform_device *pdev)
> >  
> >  	/* disable complete OTG block */
> >  	twl4030_usb_clear_bits(twl, POWER_CTRL, POWER_CTRL_OTG_ENAB);
> > +
> > +	if (twl->linkstat == OMAP_MUSB_VBUS_VALID ||
> > +	    twl->linkstat == OMAP_MUSB_ID_GROUND)
> > +		pm_runtime_put_noidle(twl->dev);
> >  	pm_runtime_mark_last_busy(twl->dev);
> 
> inline function returning (x == OMAP_MUSB_VBUS_VALID || x ==
> OMAP_MUSB_ID_GROUND) would really help readability here.
> 
> Thanks,
> 									Pavel

Good idea.  I've done that.  The function is called "cable_present()".

Thanks,
NeilBrown
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20150304/07b64599/attachment-0001.asc>


More information about the Gta04-owner mailing list