>#1 It is very strange. > 1-1 re-try in langwell_otg_set_vbus() -> fail > 1-2 re-try after ehci driver is ready (put in langwell_otg_set_host()) -> ok.
Langwell_otg_set_host will be invoked sometime later, in that case IPC driver will be ready then. You can try to change module_init(intel_scu_ipc_init); to fs_initcall(intel_scu_ipc_init) in IPC driver. It will make IPC init early and be ready when OTG driver use them. > And I tried replacing intel_scu_ipc_simple_command() by >pmic_scu_ipc_iowrite8() to directly control PMIC, but I got the same situation. Directly set PMIC register is not safe, please don't use, it may impact charging. >#2 Yes, you are right. > But how to handle the exception? > For example, in this case, enable vbus power via ipc command failed if >connected a usb device before booting. > Another example is if battery is low, system may not allow enabling vbus >power. According to USB OTG spec 1.3, the OTG state will move to A_VBUS_ERR state in above cases. User can set user interface a_clr_err to try to get back from the A_VBUS_ERR (vbus err, not valid state). Thanks Hao ________________________________________ From: Wu, Hao [mailto:[email protected]] Sent: Wednesday, November 24, 2010 8:33 PM To: Major Lee/WHQ/Wistron; [email protected] Subject: RE: [Meego-kernel] [RFC] langwell_otg: langwell otg set vbus again if ipc command failed Hi Lee, Thanks for your patch, and some comments about the modification #1 The re-try you put into set_host function, may still fail again, right? Actually I suspect that it is caused by loading order of the drivers, USB driver uses IPC driver to set VBUS, if IPC driver loaded (init) after USB OTG driver, IPC driver interface will always return failure(not ready). It only happens at boot time. If it is this case, it can be fixed by change the driver loading order. #2 Re-try them in langwell_otg_set_host / langwell_otg_set_peripheral does not make sense. Delay vbus operation may cause USB OTG Spec violation Langwell_otg_set_peripheral may be invoked at anytime when user inserted/removed USB Gadget module. Hao _______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
