Re: Blackberry driver and pm

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
Am Donnerstag, 8. Februar 2007 02:25 schrieb Greg KH:
> Ok, again, I don't see this as being an issue from any other device that
> is on the bus, asking for power, yet not having any driver bound to it.

Other devices are not broken with respect to power.

The purpose of the driver is to charge blackberries. Bus powered hubs
cannot do that safely. If that wouldn't have any effect I'd not bother.
But it does, devices which beforehand would be configured, are no longer.
Strictly speaking you are introducing a regression.

You may argue that usbcore is behaving according to standard. Superficially
this is true, but the standards neither mentions magic power commands, nor
devices morphing power consumption values.
If the device respected the standard, it would have two configurations and
we'd select the correct one. It chose an obscure non-standard solution.
Nevertheless your driver will make the choice without regard for the
power bugdet.

Here's a patch to fix that.

	Regards
		Oliver

Signed-off-by: Oliver Neukum <[email protected]>
----

--- a/drivers/usb/misc/berry_charge.c	2007-02-08 10:18:51.000000000 +0100
+++ b/drivers/usb/misc/berry_charge.c	2007-02-08 10:29:22.000000000 +0100
@@ -102,6 +102,13 @@
 		return -ENODEV;
 	}
 
+	/* check whether the parent hub can supply that much power */
+	if (udev->bus_mA < 500) {
+		dbg(&udev->dev, "the hub can supply only %dmA, charging takes more\n",
+		    udev->bus_mA);
+		return -ENODEV;
+	}
+
 	/* turn the power on */
 	magic_charge(udev);
 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.