From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932103AbbCBVH1 (ORCPT ); Mon, 2 Mar 2015 16:07:27 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:58161 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755130AbbCBVD5 (ORCPT ); Mon, 2 Mar 2015 16:03:57 -0500 Date: Mon, 2 Mar 2015 22:03:55 +0100 From: Pavel Machek To: NeilBrown Cc: Tony Lindgren , Felipe Balbi , Kishon Vijay Abraham I , linux-omap@vger.kernel.org, lkml , GTA04 owners Subject: Re: [PATCH 2/4] usb: phy: twl4030: allow charger to see usb current draw limits. Message-ID: <20150302210355.GF13270@amd> References: <20150224033730.31400.78200.stgit@notabene.brown> <20150224034037.31400.26595.stgit@notabene.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150224034037.31400.26595.stgit@notabene.brown> 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 On Tue 2015-02-24 14:40:37, NeilBrown wrote: > The charger needs to know when a USB gadget has been enumerated > and what the agreed maximum current was so that it can adjust > charging accordingly. > > So define a "set_power()" function to record the permitted > draw, and pass a pointer to that when sending USB_EVENT_ENUMERATED > notification. > > Signed-off-by: NeilBrown > --- > drivers/phy/phy-twl4030-usb.c | 27 +++++++++++++++++++++------ > 1 file changed, 21 insertions(+), 6 deletions(-) > > diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c > index 97c59074233f..023fe150c7a1 100644 > --- a/drivers/phy/phy-twl4030-usb.c > +++ b/drivers/phy/phy-twl4030-usb.c > @@ -163,6 +163,11 @@ struct twl4030_usb { > enum omap_musb_vbus_id_status linkstat; > bool vbus_supplied; > > + /* Permitted vbus draw - only meaningful after add "in mA"? > + * USB_EVENT_ENUMERATED > + */ > + unsigned vbus_draw; > + > struct delayed_work id_workaround_work; -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html