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. [...] > >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? -- Anton Vorontsov email: cbouatmailru@xxxxxxxxx irc://irc.freenode.net/bd2 -- 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