Re: USB Battery Charging Specification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, Dec 08, 2009 at 05:43:46PM +0100, ext Anton Vorontsov wrote:
On Tue, Dec 08, 2009 at 06:12:40PM +0200, Felipe Balbi wrote:
[...]
>I'd say musb_power_supply.c. In the kernel you have all the control,
>in the userspace you don't have that much. You especially need the
>control if one thing could possibly distract another.

than it would mean that we would have to poll for charger detection
until we find it and I guess that wouldn't be acceptable. Specially
on embedded, battery powered devices. I would have wake up the cpu
way too much in order to detect a charger; iow I would have to
consume lots of juice from the battery in order to try to charge the
battery. Doesn't sound good.

And how would userspace solution help here? It will have to poll
anyway? OR, are you saying that userspace will listen to usb events
and it will start charging upon enumeration complete? You can
do this in the kernel as well.

yes, it would listen to vbus event from pmic (to be precise) and based on that kick the charger detection by reading some sysfs file. In kernel would look a bit odd, no ?

How do you suggest to notify e.g. musb driver about twl4030-usb's vbus irq ?

[...]
>Wouldn't debouncing just work for both cases? 300ms delay for
>charging detection doesn't sound that bad. In pda_power.c we have
>much longer debouncing periods.

and if the connector isn't connected completely ever ? We will screw
up things again. We need to be sure the data lines are physically
attached before kicking charger detection, but that's only possible
with USB BC 1.1, not 1.0.

Well.. I'm sure there is a way to do some kind of notification to
the power supply driver that USB enumeration is complete and so we
can start charging.

Just insert some notifier (include/linux/notifier.h) so that
power supply driver could listen to USB events.

Maybe uninline usb_gadget_vbus_draw() from linux/usb/gadget.h and
insert the notifier there?

I will look into that. Sounds good. Thanks a lot

--
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux