why arent these devices autocharge when connected and they need to either be ejected or whatever port they are connected manually turned on for charging?
travisn000, this tool seem to automatically allow charging when a kindle or ipad is plugged in. Is this the expected and desirable feature? what if somebody want the kindle connected but not charging? like when its connected to a laptop that runs on battery?
From what I understand these devices behave as they do (no charging), because the default power output for a connected usb device is 100 mA, which is not enough to trigger a charging state for such power hungry devices (or even maintain a charge). USB spec allows for up to up to 500mA of power over usb, which is just enough to trigger charging on most of these devices. Ejecting the device makes the full 500 mA available again, as does the iPad app that I modified for use with the kindle; the iPad and many similar devices will draw up to 2000mA (2A) from a wall charger (I'm guessing the kernel default to 100mA as a precaution to avoid over powering any device; 100mA is the bottom end of the spec).
As far as the solution I posted, I pretty sure it still allows for regular mount/unmount access to the device; it just uses a udev rule and a few C commands to signal the kernel via libusb that the device can handle the full 500 mA (max) available over USB v2.
I'm not sure why someone would have a problem with the kernel increasing the power to charging levels every time the device is connected, as any modern device will simply stop accepting the charge if it doesn't need it.. in the unplugged laptop situation I would expect the user would only have the device connected long enough to transfer files and would then disconnect it if they were concerned about power usage.
I suppose the udev rule could probably be modified to use a GUI prompt to ask for permission before upping the current on the device, but I would bet most people would find this quite intrusive.
If there was enough interest we could also write a GUI / script to manage the creation of the udev rules so that any device with similar needs could be used. Perhaps this management tool would be where the user could set the option to be prompted for charging.
In case any one is interested, all I did with the iPad charging app is to remove the Apple vendor and product ID's from the original app and replace them with variables that could then be set via a command line option. Since the udev rule that runs the charge application uses these same vendor and product ID's to recognize the device, I had the udev rule pass the ID's to the charge app instead of having them hard coded as they were in the original code. This should make it work as a more universal charge triggering app as long as a corresponding udev rule is added.