From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752024AbbGMCai (ORCPT ); Sun, 12 Jul 2015 22:30:38 -0400 Received: from mail-bn1on0136.outbound.protection.outlook.com ([157.56.110.136]:55524 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751737AbbGMCae (ORCPT ); Sun, 12 Jul 2015 22:30:34 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; Date: Mon, 13 Jul 2015 09:21:26 +0800 From: Peter Chen To: Roger Quadros CC: , , , , , , , , , , Subject: Re: [PATCH v3 01/11] usb: otg-fsm: Add documentation for struct otg_fsm Message-ID: <20150713012109.GC19248@shlinux2> References: <1436350777-28056-1-git-send-email-rogerq@ti.com> <1436350777-28056-2-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1436350777-28056-2-git-send-email-rogerq@ti.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD038;1:ddVO4NO1LU/jTBQ247MZh78PUgPF0qKgnNXP95jWWb4AdX9q+404jyICRtOqvU8lgnbl/6zmSdYx0DJb+ffQJnbziciuAxmqp+D1XzE4uZpzE4XYc9GwFsvMp5Y8gRqO6WByKZEM6oY+Dfrd0OeygV8vZlND85QjS9AhCBkqq+TiW6zF1wwVcmKw4hWFoNL/R6UdlH6w9TXanrXnAVeLIKB1XGV5zBKDGsXYOFoKfEDhqOEe57cKULz1W53suGdAILiS7xgucdSOceQK+dlIIXQGMT87JbjBUDfMOmxSioTSVemPWzA8pzilkdeleW6BW2H1Kw5c2q0zopo1m1dsPfns2nCoMwx2wm3ONLR2YsmfVETNW7L9kZpXjh8gNwMdAUhHiapmi0Noq8+URAWtC0hyMMRFuzElViHe+x4Ldo7QbgbL690B+OS3tfBf/nZ91v8a28YkoUY+5abkA0iOKQ== X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1060300003)(339900001)(51704005)(24454002)(199003)(189002)(86362001)(104016003)(33656002)(50466002)(2950100001)(87936001)(6806004)(33716001)(47776003)(46406003)(110136002)(97756001)(5001960100002)(85426001)(110436001)(19580405001)(19580395003)(77096005)(23726002)(50986999)(54356999)(46102003)(77156002)(76176999)(62966003)(4290100001)(92566002)(105606002)(106466001)(5001920100001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB1231;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB1231;2:nnLvZWfP6UsO11auUlT8b2d3Yj4oPPChWPtWhnxsayUeR5hLt0iipYSqgtjOgS8z;3:DgaQvYUtJvNXhJ7MG6nWMOmH9ZgwA40byiH2hYIdxCq0WhyNGocz5VScj5cvZjQOQUpBRzuqvBK+QZWruS0wf7mPWraKpt1dHRGH12NGc7lFKV7PXf4Vy5pfCCioN3x4zIq071HixMvjnEYubkqk/ddmw7kv+2Hbm9Ns0LHRIG03+0uD7LdyKJR9uERCPikyzyi15YUbpY1SLkhf9y5OlHvIY6nqDkk4Ad78nOAm2KM=;25:RDAJIm4vl06N7QAJpV6HLJz7IgU3SbYpZjAs4wx2/okUhpmV9Y/IxwyvsGFLjV48hGcl5i2y7NSOxDE1bsCESsfRJb9I1s0TXqGUaSCSB6V+x1h1FD1ChajvL52deD9BFTr97wvA1PO36wWOsFo5J9ehn2e89gkPDzcUuh7AfKxnX/SPck5mZAJjF3mkJCnXvxAa7AYFWD9voGHXYistT2UIHjNEAU/mQQ8RRPUOfeo+/h9h+YlVf9+D9ybcPG2d;20:qS7Arq/fyJ5aux+mU9Ywq595vRW3kiDxIZBHm4UFKfRhf6zxdyIZ91VIbfr+T2LVbNM2kzE286kd4/C2bD7nsqbpo6tTvy/mAiu9yOUAMchcEehOedoYhGe+QLw+Pm9KKBDVn+EMdoOqQ/twUmlTjGn9zHYy9JmbIkWc5V431Jm9asqwGURPfeLYvyGgaH09QAJBUUgv/gd7cixNKs/QXM3BStNuEfKgDSk62MkhcfDbz8R6KCSwKApN6mznStPSvEs+LhXsNR69jP1ugNZIAvpbhY4UIBL6yCOPhmdFyG+Uautrbp2RKZ0gL/OAXZRxjqAuB7EeYTLA6m/Q9y4nrlFPgO1uPnqP+UzaeAAUkJQ= X-Microsoft-Antispam: UriScan:;BCL:1;PCL:0;RULEID:;SRVR:DM2PR0301MB1231;UriScan:;BCL:1;PCL:0;RULEID:;SRVR:DM2PR0301MB0880; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:1;PCL:0;RULEID:(601004)(1201001)(5005006)(3002001);SRVR:DM2PR0301MB1231;BCL:1;PCL:0;RULEID:;SRVR:DM2PR0301MB1231; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB1231;4:Fd8fpQ9dlVWc9s0CROCj2zF5IBQGca9CUPjA7a3uNjHOVzQWQ9zZbSc1gFWV8cp/p9nPJGURMMHLu/VlxPmwep9IxvBUMVDFhSjj8jCTPKTlaGx1rTrtHE00C/ojuNE+As3YE2u7nbjaQLZ5/AfNfFa+9pHR3iHfOcQac5Aj9pELTpWANfwPQ+vDjt6IjgtTyxFiiN6w+nudeVWsQ7WqsngkTDItFfV04a+U4/69i1K9VGDuGbl1uADXwomK8bWhercSa0kHnYJFKt/K3kWBTins/RhgF4mWMAkYhj+seq3ebqJRhqRNg/4DvXwdEkfV X-Forefront-PRVS: 0636271852 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB1231;23:/sPWTb9wtWuuypOga+YwLVim0XlMq//4GqOPKZf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bs7UPFMDFJ4HrsKCvLpw2jP0AhuBQ52+31WH9KV8mkFzQhd5Iy8t?= =?us-ascii?Q?IXElCmiSYmY5IOL6jGQ51VnMcHWFFGpaxOU5Dn49eyvcbgUD22HfkC946nCe?= =?us-ascii?Q?P4a+JkZ0gYaII/k5kRFQKHxfS?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB1231;5:PWfV3WXShQWUzDJw6PkWbA57hFhdH7yjtfc1QPBpcF8RlPCzCzYx4VfyvRkeKhn4HSCGXQsG5dcYj2ovx+5YQpYaYHsdsXuuFdLuoqbS1nABfzxgE7FR5Kdb2qmkUjhHfS892uLnd/9L5M5KgHCglQ==;24:AdpAzSRMLmaPxd+A+shUQpJLTagdeQOiVOY8vD9u2ObPwXuOnUlPr9zmlivNNsx5RzazUsH2JWHI6o6BYI8fBl/G88FD5tlyNm6tAHfb09o=;20:/zKXfEegpJzs4arHBztjdCb/jEz//Lje04RWTuD+Lo3wSfHYUAzls9sVWx5UjEU6ONGRb1U9x8XHn8OyHYK8dQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2015 02:30:30.5001 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB1231 X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0880;2:DwYs7xT5SnTjEbY409h2BJ9ENx/Xwbnz6Y5GAecaByHBlnfqOUqq6LWemP15sNJj;3:sh0XYdcXduB5XnWKJ+Z22uF8m5Tz/BnVx14ySvIvUzNuZJMsK7clbjhAG0YpG/f0VZOGgHDRgqCL9pe+wk6qyKBR9inDY4CGzc4kL9pIlwvIr0MWxk3KWl8uGUPoMebo3aENh6z2TKVwkOXM4qoG5PI4OgU3N3Jvq+59dsZTg9AnEIs+aRdolZwL1eqSlqmBTmCZ8IXsA4TSNfh22TjI56vCyg/1oVRITB/fvyQNV20=;25:6dsTClm24Ld31HU5vtZIPP9RO1rhvyOQTv+gatFSSd3bm/skWmK708hMnrhLog3A8aq8xCC2yYxZm2k2Ux5MLoVslxFdvqsIQLfYSDuCOJI0IAc1O7rTAbH+r6hnlVHRXfBQwfaKfSN06014zw1DKRVPHCwFyilmPD4YSZpX0WPxnV3Yfwv34UfojeBDVR4wSaCI6yBTQEAyO6EzIimOiDNm1ooNSl+290xjSXFYDHlt2yjYtTU5hqgfxsOBJgja;23:d9e53gF0Kd6OX5h2PV+984Sjkbhq9BrSUuQdo0PEEkwxBnYt6LkjSUPHyHHi+sH8EGB1GiT5I15DdFYHafmI5CnJQiaOcHaXBPYUjsoLWPBpdUvuvKsmr8BsrlZKzta5uKhYOH4QBpZIrG5L4p2pdwzRx6XEn0H/koHvmthEcaMrhO+1HBZetO2JLncNJ8xtDULATByHF211i84C9VQ/dAzWjrPu8lnYKOvaFHyFX3m1qm4CheKbGAs7NmaZCAj2 X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 08, 2015 at 01:19:27PM +0300, Roger Quadros wrote: > struct otg_fsm is the interface to the OTG state machine. > > Document the input, output and internal state variables. > Definations are taken from Table 7-2 and Table 7-4 of > the USB OTG & EH Specification Rev.2.0 > > Re-arrange some of the members as per use case for more > clarity. > > Signed-off-by: Roger Quadros > --- > include/linux/usb/otg-fsm.h | 89 +++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 82 insertions(+), 7 deletions(-) > > diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h > index f728f18..ca508c2 100644 > --- a/include/linux/usb/otg-fsm.h > +++ b/include/linux/usb/otg-fsm.h > @@ -59,37 +59,112 @@ enum otg_fsm_timer { > NUM_OTG_FSM_TIMERS, > }; > > -/* OTG state machine according to the OTG spec */ > +/** > + * struct otg_fsm - OTG state machine according to the OTG spec > + * > + * OTG hardware Inputs > + * > + * Common inputs for A and B device > + * @id: TRUE for B-device, FALSE for A-device. > + * @adp_change: TRUE when current ADP measurement (n) value, compared to the > + * ADP measurement taken at n-2, differs by more than CADP_THR > + * @power_up: TRUE when the OTG device first powers up its USB system and > + * ADP measurement taken if ADP capable > + * > + * A-Device state inputs > + * @a_srp_det: TRUE if the A-device detects SRP > + * @a_vbus_vld: TRUE when VBUS voltage is in regulation > + * @b_conn: TRUE if the A-device detects connection from the B-device > + * @a_bus_resume: TRUE when the B-device detects that the A-device is signaling > + * a resume (K state) > + * B-Device state inputs > + * @a_bus_suspend: TRUE when the B-device detects that the A-device has put the > + * bus into suspend > + * @a_conn: TRUE if the B-device detects a connection from the A-device > + * @b_se0_srp: TRUE when the line has been at SE0 for more than the minimum > + * time before generating SRP > + * @b_ssend_srp: TRUE when the VBUS has been below VOTG_SESS_VLD for more than > + * the minimum time before generating SRP > + * @b_sess_vld: TRUE when the B-device detects that the voltage on VBUS is > + * above VOTG_SESS_VLD > + * @test_device: TRUE when the B-device switches to B-Host and detects an OTG > + * test device. This must be set by host/hub driver > + * > + * Application inputs (A-Device) > + * @a_bus_drop: TRUE when A-device application needs to power down the bus > + * @a_bus_req: TRUE when A-device application wants to use the bus. > + * FALSE to suspend the bus > + * > + * Application inputs (B-Device) > + * @b_bus_req: TRUE during the time that the Application running on the > + * B-device wants to use the bus > + * > + * Auxilary inputs (OTG v1.3 only. Obsolete now.) > + * @a_sess_vld: TRUE if the A-device detects that VBUS is above VA_SESS_VLD > + * @b_bus_suspend: TRUE when the A-device detects that the B-device has put > + * the bus into suspend > + * @b_bus_resume: TRUE when the A-device detects that the B-device is signaling > + * resume on the bus > + * > + * OTG Output status. Read only for users. updated by otg_ops() helpers updated by OTG FSM helpers defined in this file Only one tiny comment, others are ok. Acked-by: Peter Chen -- Best Regards, Peter Chen From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Chen Subject: Re: [PATCH v3 01/11] usb: otg-fsm: Add documentation for struct otg_fsm Date: Mon, 13 Jul 2015 09:21:26 +0800 Message-ID: <20150713012109.GC19248@shlinux2> References: <1436350777-28056-1-git-send-email-rogerq@ti.com> <1436350777-28056-2-git-send-email-rogerq@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <1436350777-28056-2-git-send-email-rogerq@ti.com> Sender: linux-kernel-owner@vger.kernel.org To: Roger Quadros Cc: stern@rowland.harvard.edu, balbi@ti.com, gregkh@linuxfoundation.org, dan.j.williams@intel.com, jun.li@freescale.com, mathias.nyman@linux.intel.com, tony@atomide.com, Joao.Pinto@synopsys.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org List-Id: linux-omap@vger.kernel.org On Wed, Jul 08, 2015 at 01:19:27PM +0300, Roger Quadros wrote: > struct otg_fsm is the interface to the OTG state machine. > > Document the input, output and internal state variables. > Definations are taken from Table 7-2 and Table 7-4 of > the USB OTG & EH Specification Rev.2.0 > > Re-arrange some of the members as per use case for more > clarity. > > Signed-off-by: Roger Quadros > --- > include/linux/usb/otg-fsm.h | 89 +++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 82 insertions(+), 7 deletions(-) > > diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h > index f728f18..ca508c2 100644 > --- a/include/linux/usb/otg-fsm.h > +++ b/include/linux/usb/otg-fsm.h > @@ -59,37 +59,112 @@ enum otg_fsm_timer { > NUM_OTG_FSM_TIMERS, > }; > > -/* OTG state machine according to the OTG spec */ > +/** > + * struct otg_fsm - OTG state machine according to the OTG spec > + * > + * OTG hardware Inputs > + * > + * Common inputs for A and B device > + * @id: TRUE for B-device, FALSE for A-device. > + * @adp_change: TRUE when current ADP measurement (n) value, compared to the > + * ADP measurement taken at n-2, differs by more than CADP_THR > + * @power_up: TRUE when the OTG device first powers up its USB system and > + * ADP measurement taken if ADP capable > + * > + * A-Device state inputs > + * @a_srp_det: TRUE if the A-device detects SRP > + * @a_vbus_vld: TRUE when VBUS voltage is in regulation > + * @b_conn: TRUE if the A-device detects connection from the B-device > + * @a_bus_resume: TRUE when the B-device detects that the A-device is signaling > + * a resume (K state) > + * B-Device state inputs > + * @a_bus_suspend: TRUE when the B-device detects that the A-device has put the > + * bus into suspend > + * @a_conn: TRUE if the B-device detects a connection from the A-device > + * @b_se0_srp: TRUE when the line has been at SE0 for more than the minimum > + * time before generating SRP > + * @b_ssend_srp: TRUE when the VBUS has been below VOTG_SESS_VLD for more than > + * the minimum time before generating SRP > + * @b_sess_vld: TRUE when the B-device detects that the voltage on VBUS is > + * above VOTG_SESS_VLD > + * @test_device: TRUE when the B-device switches to B-Host and detects an OTG > + * test device. This must be set by host/hub driver > + * > + * Application inputs (A-Device) > + * @a_bus_drop: TRUE when A-device application needs to power down the bus > + * @a_bus_req: TRUE when A-device application wants to use the bus. > + * FALSE to suspend the bus > + * > + * Application inputs (B-Device) > + * @b_bus_req: TRUE during the time that the Application running on the > + * B-device wants to use the bus > + * > + * Auxilary inputs (OTG v1.3 only. Obsolete now.) > + * @a_sess_vld: TRUE if the A-device detects that VBUS is above VA_SESS_VLD > + * @b_bus_suspend: TRUE when the A-device detects that the B-device has put > + * the bus into suspend > + * @b_bus_resume: TRUE when the A-device detects that the B-device is signaling > + * resume on the bus > + * > + * OTG Output status. Read only for users. updated by otg_ops() helpers updated by OTG FSM helpers defined in this file Only one tiny comment, others are ok. Acked-by: Peter Chen -- Best Regards, Peter Chen