Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755591AbcC2ArB (ORCPT ); Mon, 28 Mar 2016 20:47:01 -0400 Received: from mail-db3on0099.outbound.protection.outlook.com ([157.55.234.99]:25760 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751733AbcC2Aq6 (ORCPT ); Mon, 28 Mar 2016 20:46:58 -0400 X-Greylist: delayed 882 seconds by postgrey-1.27 at vger.kernel.org; Mon, 28 Mar 2016 20:46:57 EDT From: Peter Chen To: Baolin Wang , Peter Chen CC: Felipe Balbi , Greg KH , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Peter Chen , Alan Stern , "r.baldyga@samsung.com" , Yoshihiro Shimoda , Lee Jones , "Mark Brown" , Charles Keepax , "patches@opensource.wolfsonmicro.com" , Linux PM list , USB , "device-mainlining@lists.linuxfoundation.org" , LKML Subject: RE: [PATCH v8 0/4] Introduce usb charger framework to deal with the usb gadget power negotation Thread-Topic: [PATCH v8 0/4] Introduce usb charger framework to deal with the usb gadget power negotation Thread-Index: AQHRhcnURUputCZIGEaEgiD/0HOB+59pvwGAgASx+gCAAAYzgIAAIG0AgAEA9/A= Date: Tue, 29 Mar 2016 00:32:12 +0000 Message-ID: References: <20160325070937.GA22398@peterchendt> <20160328071351.GC3302@peterchendt> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; x-originating-ip: [58.33.225.112] x-ms-office365-filtering-correlation-id: 7bd2b767-9dde-41f8-e9c8-08d357699208 x-microsoft-exchange-diagnostics: 1;HE1PR04MB1449;5:9lYCCY7S8e4lsbNF/8cJm+mI2ZswebSRrbmvQkr2V7qJL8dje2/uHwFRTBCy2B839gKDL7HyFj+Wda0qUcCnu4Pq47on369UqdZeF4r64T/4op8b6c+KjVxbO9N4beRGpfybpnlb92ktWlonlMBC9w==;24:MDQdCUJ9ES0LmkavLLSu51bvq/s4mpLNTaPuvpFCV7pB2W1e9EKz8pqcxU8zFKMYYCOLXD3YJXUOKEYPSQjqdW4rHOtge+vNWfuYgVLg1XY= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR04MB1449; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:HE1PR04MB1449;BCL:0;PCL:0;RULEID:;SRVR:HE1PR04MB1449; x-forefront-prvs: 0896BFCE6C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(24454002)(81166005)(2950100001)(102836003)(2900100001)(86362001)(1096002)(106116001)(11100500001)(1220700001)(122556002)(19580395003)(50986999)(54356999)(19580405001)(76576001)(76176999)(74316001)(33656002)(5003600100002)(10400500002)(586003)(92566002)(5004730100002)(189998001)(3660700001)(3846002)(5002640100001)(93886004)(5001770100001)(66066001)(3280700002)(87936001)(5008740100001)(4326007)(2906002)(77096005)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR04MB1449;H:HE1PR04MB1450.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2016 00:32:12.0893 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1449 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u2T0l60r011027 Content-Length: 1594 Lines: 38 > > On 28 March 2016 at 15:13, Peter Chen wrote: > > On Mon, Mar 28, 2016 at 02:51:40PM +0800, Baolin Wang wrote: > >> On 25 March 2016 at 15:09, Peter Chen wrote: > >> > On Thu, Mar 24, 2016 at 08:35:53PM +0800, Baolin Wang wrote: > >> >> Currently the Linux kernel does not provide any standard > >> >> integration of this feature that integrates the USB subsystem with > >> >> the system power regulation provided by PMICs meaning that either > >> >> vendors must add this in their kernels or USB gadget devices based > >> >> on Linux (such as mobile phones) may not behave as they should. Thus > provide a standard framework for doing this in kernel. > >> >> > >> >> Now introduce one user with wm831x_power to support and test the > >> >> usb charger, which is pending testing. Moreover there may be other > >> >> potential users will use it in future. > >> >> > >> > > >> > I am afraid I still not find the user (udc driver) for this > >> > framework, I would like to see how udc driver block the enumeration > >> > until the charger detection has finished, or am I missing something? > >> > >> It is not for udc driver but for power users who want to negotiate > >> with USB subsystem. > >> > > > > Then, where is the code the test user to decide what kinds of USB > > charger (SDP, CDP, DCP) is connecting now? > > Users can choose to implement multiple ways to get the charger type In > 'usb_charger_detect_type()' function. > > > Then, how you test your code? When we introduce an API, at least, there is one user for it. Peter