From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Chen Subject: Re: To otg-fsm or not to otg-fsm? That is the question. Date: Fri, 15 Aug 2014 08:32:03 +0800 Message-ID: <20140815003202.GB2710@peterchendt> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Received: from mail-bn1lp0139.outbound.protection.outlook.com ([207.46.163.139]:13908 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750916AbaHOAcQ (ORCPT ); Thu, 14 Aug 2014 20:32:16 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Tim Bird Cc: "linux-usb@vger.kernel.org" , "balbi@ti.com" , "av.tikhomirov@samsung.com" , "b47624@freescal.com" , "linux-arm-msm@vger.kernel.org" , "Ivan T. Ivanov" , b47624@freescale.com On Tue, Aug 12, 2014 at 09:13:47AM -0700, Tim Bird wrote: > On Mon, Aug 11, 2014 at 5:28 PM, Peter Chen wrote: > > The OTG FSM at /usb/common/usb-otg-fsm.c is a software OTG FSM implementation > > which follows On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification > > (Revision 2.0 version 1.1a) Chapter 7 State Diagrams. > > > > If the platform doesn't support hardware otg fsm, it should follow above fsm implementation since > > it follows the newest OTG & EH spec. Besides, as far as I know, the qualcomm uses > > chipidea core for its usb2, then it should be easy for qualcomm using this common > > otg fsm implementation. > > OK. sounds good. > > Yes, the qualcomm chips use a chipidea core for usb2. The main > difficulty, IMHO, will > be mapping the qcom charger state machine onto the generic OTG state > machine implementation > in usb-otg-fsm. I'm not sure if I'll be able to embed the needed > functionality into the existing functions > called by the generic state machine, or if I'll need to add some new > entries to the function table > to handle this extra logic. > > I'll probably try to get the driver working without the charger stuff > first, and then, once I have a > better idea of how the state machines map, try adding the charger > stuff. If I feel like I need > to modify the generic state machine, I'll ask on list. I'm a newbie > at USB stuff and I don't want > to break anything. > > Thanks. > One remind, you may need to know which role-switch function you need, if you only need role-switch based in ID pin, then no OTG FSM support is needed, this is current most of "OTG" device supports, it is not fully OTG compliance. -- Best Regards, Peter Chen