Re: power_supply class/framework question

From: Brian Swetland
Date: Mon Aug 10 2009 - 12:53:54 EST


On Mon, Aug 10, 2009 at 9:35 AM, Mark
Brown<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/