On Sun, Sep 28, 2014 at 10:30:53AM +0800, Peter Chen wrote: > On Fri, Sep 26, 2014 at 10:42:35AM -0400, Alan Stern wrote: > > On Fri, 26 Sep 2014, Michael Grzeschik wrote: > > > > > The current EHCI implementation is prepared to toggle the > > > PORT_POWER bit to enable or disable a USB-Port. In some > > > cases this port power can not be toggled by the PORT_POWER > > > bit but instead i.e. by an external GPIO. > > > This patch adds an callback to be triggered as well. > > > The host needs to assign a capable portpower callback. > > > > The idea is reasonable enough, I suppose (but where does this stop? > > Before you know it, every function normally carried out by the host > > controller will actually be handled by a platform-specific piece of > > hardware!) > > > > The implementation leaves something to be desired. Instead of keeping > > the current port-power code in ehci-hcd inline, as it is, you should > > define a default callback routine to do the work. Then the override > > can replace the default callback. > > > > Agree, but one more thing that I find the clear_port_feature(PORT_POWER) > for roothub doesn't be called when I remove the hcd, we hope > the portsc.pp and external gpio can be in single .portpower API. I suppose you say here to handle both toggle bit portsc.pp and and toggle the gpio based regulator together in one callback? If so, then I agree. As the HCD does not seem to work without enabling the portsc.pp. Thanks, Michael -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- 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