From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Liu Subject: Re: [PATCH v2 06/11] phy: da8xx-usb: new driver for DA8XX SoC USB PHY Date: Fri, 1 Apr 2016 14:56:35 -0500 Message-ID: <20160401195635.GA29841@uda0271908> References: <1458181615-27782-1-git-send-email-david@lechnology.com> <1458181615-27782-7-git-send-email-david@lechnology.com> <56FE74AC.6080303@ti.com> <20160401144510.GA6264@uda0271908> <56FE9B8F.7050605@lechnology.com> <56FECFEB.2030708@cogentembedded.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <56FECFEB.2030708-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sergei Shtylyov Cc: David Lechner , Kishon Vijay Abraham I , Petr Kulhavy , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Sekhar Nori , Kevin Hilman , Alan Stern , Greg Kroah-Hartman , Andreas =?iso-8859-1?Q?F=E4rber?= , Tony Lindgren , Robert Jarzmik , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org Hi, On Fri, Apr 01, 2016 at 10:45:47PM +0300, Sergei Shtylyov wrote: > On 04/01/2016 07:02 PM, David Lechner wrote: > > >>>>+EXPORT_SYMBOL_GPL(da8xx_usb20_phy_set_mode); > >>> > >>>Don't prefer export symbols from PHY driver. That'll create unnecessary > >>>dependencies between the controller and the PHY. > >> > >>Agreed. > >> > >>>I think it'll be better to create a new attribute and use it? > >> > >>Another simpler option is to not support _set_mode() for DA8xx, and the > >>phy driver set the otgmode bit in probe() based on dr_mode of the > >>controller. > >> > >>Regards, > >>-Bin. > > > >This certainly works for my particular use case, however, Sergei Shtylyov, who > >wrote the da8xx musb glue layer originally, seemed to recall in his review of > >the patch series that this really is necessary for OTG mode to work properly. > > No, it's still not necessary, however this method is now called > from musb_init_controller() (it wasn't in my time). ISTR however > that you needed to enforce the mode override in CFGCHIP2 for the > host mode to function properly. Yes, but I think we don't have to rely on musb_init_controller(), what we can do is the phy probe() calls of_usb_get_dr_mode_by_phy() to get the dr_mode of the controller then sets CFGCHIP2 bits accordingly, so that we can drop _set_mode() in the phy driver. Regards, -Bin. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html