From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932294AbZHJQxr (ORCPT ); Mon, 10 Aug 2009 12:53:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932270AbZHJQxq (ORCPT ); Mon, 10 Aug 2009 12:53:46 -0400 Received: from smtp-out.google.com ([216.239.45.13]:52900 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932269AbZHJQxq (ORCPT ); Mon, 10 Aug 2009 12:53:46 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding:x-system-of-record; b=tentcDX+hboWIzsSqz9m4oA5hFr+IvKznjErOJok5ZUGUlxEJFvIdSf4cisleKPmA BDSYk14CHOBNA6082AeEw== MIME-Version: 1.0 In-Reply-To: <20090810163542.GC24947@sirena.org.uk> References: <20090810150011.GA1471@ucw.cz> <20090810152825.GA4624@oksana.dev.rtsoft.ru> <20090810163542.GC24947@sirena.org.uk> Date: Mon, 10 Aug 2009 09:53:40 -0700 Message-ID: Subject: Re: power_supply class/framework question From: Brian Swetland To: Mark Brown Cc: avorontsov@ru.mvista.com, Pavel Machek , Anton Vorontsov , David Woodhouse , linux-kernel Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 10, 2009 at 9:35 AM, Mark Brown wrote: >> > Or enum power_supply_type, with the following priority: >> > mains (wall), usb, battery? > >> Either of those would work, though in the case of USB, as Pavel >> correctly points out, we'd need to differentiate between > > I think we'll need to be able to report a list of supplies rather than > just one - for example, a lot of battery operated devices will use a > combination of USB and battery if the current draw exceeds what the USB > supply is able to deliver. Certainly -- though the case I'm dealing with the battery driver wanting to know how much power is available upstream (via calling am_i_supplied()) so it can decide if it can turn on the charger (and if it should use low or highspeed charging). The way I'm currently handling this is that I have an "ac" supply (power brick) and a "usb" supply, only one of which will be supplying power to the "battery" supply (battery & charger). In my case I'd never have multiple upstream supplies active simultaneously, but I'm not sure if that'd hold true for everyone. Brian