Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759958AbcDFBWM (ORCPT ); Tue, 5 Apr 2016 21:22:12 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35576 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758870AbcDFBWJ (ORCPT ); Tue, 5 Apr 2016 21:22:09 -0400 Date: Wed, 6 Apr 2016 09:15:26 +0800 From: Peter Chen To: Mark Brown Cc: Baolin Wang , Felipe Balbi , Greg KH , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Peter Chen , Alan Stern , r.baldyga@samsung.com, Yoshihiro Shimoda , Lee Jones , Charles Keepax , patches@opensource.wolfsonmicro.com, Linux PM list , USB , device-mainlining@lists.linuxfoundation.org, LKML Subject: Re: [PATCH v9 0/4] Introduce usb charger framework to deal with the usb gadget power negotation Message-ID: <20160406011526.GB6301@shlinux2.ap.freescale.net> References: <20160405064637.GA31351@shlinux2.ap.freescale.net> <20160405081222.GC31351@shlinux2.ap.freescale.net> <20160405165305.GD1924@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160405165305.GD1924@sirena.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1476 Lines: 32 On Tue, Apr 05, 2016 at 09:53:05AM -0700, Mark Brown wrote: > > > > The framework does not want to focus on charger detection too much, > > > and just supplies one callback '->charger_detect()' for user to be > > > implemented if they ensure they need to do the SW charger detection > > > manually (Note: must at the right time to do the SW detection.). So > > > the usb charger just focus on dealing with the usb gadget power > > > negotiation, and it does not need to care much how to do charger > > > detection on your platform. > > > No, this comment is common one, but only for SW detection. Eg, when > > the PMIC tells you it is a SDP, you can't notify to charger IC about > > 500mA at once, you need to do it after host allows you to do it. > > Note that this isn't just the charger device that needs to constrain > current consumption - it's the entire system. You can't charge to the > limit for system power draw if the USB controller is supplying the main > system rail. Sorry, I can't catch up you. USB Host (SDP or CDP) supplies power for USB device (not only USB controller, it is the whole system), it can supply more power after set configuration. See 1.4.13 from BC 1.2. An SDP expects a downstream device with a good battery to draw less than 2.5mA average when unconnected or suspended, up to 100mA maximum when connected and not configured and not suspended, and up to 500mA maximum if so configured and not suspended. -- Best Regards, Peter Chen