Hi Morimoto-san, On Thu, Aug 2, 2012 at 9:09 AM, <kuninori.morimoto.gx@xxxxxxxxxxx> wrote: > > Hi Alan, Rafael, Magnus > > Thank you for your reply > >> The problem is that the ehci-platform driver currently doesn't know >> anything about clocks or power sources. We need to add that >> information in a generic fashion, somehow. Until that's done, you >> can't really use ehci-platform as your driver. >> >> So for example, if ehci-platform _did_ know about clocks and power >> sources, then before calling usb_add_hcd() you would do: >> >> ehci_platform_enable_clocks_and_power(dev); >> pm_runtime_set_active(&dev->dev); >> pm_runtime_enable(&dev->dev); >> >> But you definitely cannot call pm_runtime_get_aync() or anything >> similar, because the EHCI core resume routine assumes the controller's >> clocks are already running and its power supply is at full power. >> >> Can you figure out a good way to add clock and power information to the >> usb_ehci_pdata structure? Something that will work with a large >> variety of SoC EHCI controllers? > > It is possible to power-on on platform setup level > if Rafael and Magnus don't care this style. > Then, I don't need this patch on ehci/ohci driver. > > 1) power-on on platform setup timing > 2) use ehci/ohci driver > > the other is that add .power callback on usb_ehci_pdata, > and control all power on this. > > -- probe -- > if (pdata->power) > pdata->power(xxx, 1) > > usb_add_hcd() > > -- remove -- > usb_remove_hcd() > > if (pdata->power) > pdata->power(xxx, 0) >From my point of view this all depends on what the hardware supports. If the USB host controller hardware can be powered down (power domain off, clock off) when no USB hardware is connected, but still perform hotplug detection of a newly added device, then if so then I'd like to see more fine grained PM support in the drivers. If that's not possible then I believe the more static approach (on probe/remove) is fine. Perhaps the latter is a good first step. Thanks, / magnus -- 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