surban / usb-gadget

Expose standard or fully custom USB peripherals (gadgets) through a USB device controller (UDC) on Linux using Rust.
https://crates.io/crates/usb-gadget
Apache License 2.0
65 stars 6 forks source link

Set USB port max current to 900 mA on USB 3.0 #8

Closed FallingSnow closed 5 months ago

FallingSnow commented 5 months ago

Shouldn't the max power consumption for a USB 3 port be more than 500 mA? Or is this maxed to 500 mA by the linux gadget API? Or if the API only works on USB 2 ports?

https://github.com/surban/usb-gadget/blob/5282909742bf5e613e5481bf26c87b31cc4c4b4e/src/gadget.rs#L196

The amount of current draw for SuperSpeed devices are increased to 150 mA for low-power devices and 900 mA for high-power devices when operating in SuperSpeed mode.

https://www.maxrev.de/files/2014/08/usb_3_0_english.pdf - Section 9.2.5.1

surban commented 5 months ago

Yes, the current setting was actually wrong. It should be fixed now.