On Fri, 17 Nov 2006, Boky Test wrote: > Hi everyone. > > I am desperatly trying to find a solution to charge (at the moment) my > Blackberry at home while away from work. > > You're probably familiar with the reason why this doesn't work: the > computer provides only 100mA of power to the device while the > Blackberry needs full 500 mA.
That's not quite correct. The computer provides as much current as the Blackberry takes (up to 500 mA). The trick is to put the Blackberry in a mode where it will accept the full 500 mA. > On Windows this is achieved through Blackberry Desktop Software; it > seems the device does not by itself report to the system that it need > more juice. > > When googling around all I could find was this: > http://www.oclug.on.ca/archives/oclug/2005-May/045737.html > > Where the instructions go: "You should be able to change it somewhere > in /sys/dev/usb..." USB devices are not supposed to take more than 100 mA unless they are set to a non-zero configuration. You can indeed change the device's configuration via sysfs. You just have to do: echo N >/sys/.../bConfigurationValue where N is a configuration value supported by the Blackberry and the "..." part is a path leading to the device's directory (try looking under /sys/bus/usb/devices/ and search for the entry that showed up in your system log when the Blackberry was plugged in). > I've also come across a page with the description of Blackberry USB > protocol; it seems that by plugging it it exchanges a few hello world > / handshake packets with desktop software which then switches USB to > high-power mode. > > What I am looking for: > - (good) a way to manually increase power by doing something in the > lines of "echo 500 > /sys/.../usb/power" > - (much better) device driver support for blackberry (charging only) That device driver part is tricky. New updates to the Linux kernel are going to cause devices without a driver to automatically be put into suspend mode, which means they aren't allowed to draw more than 500 uA! So you will need some sort of minimal driver for the Blackberry. Fortunately minimal drivers like that don't have to reside in the kernel. Using libusb, anyone can write a user program that will do what you want: Set the device to a nonzero configuration and prevent it from being suspended. (Nothing special needs to be done for that last part since devices with userspace drivers are never suspended automatically.) Maybe you can figure out how to do it! Alan Stern ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Linux-usb-users@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users