Patent ID: 8762746

Claim:
A device comprising: a universal serial bus (USB) port having a D+ line and a D− line; a USB device controller configured to operate in a host controller mode and a device controller mode; one or more processors operatively coupled to a computer readable medium; and a power management module maintained on the computer-readable medium and executed on the one or more processors to perform operations including: detecting that a power source is connected to the USB port; based at least in part on determining that the D+ and D− lines are at least one of shorted or floating, setting the USB device controller to operate in the host controller mode; determining, based at least in part on a pull-up or pull-down placed on one of the D+ or D− lines, whether the D+ and D− lines are shorted or floating; and when the D+ and D− lines are shorted, identifying the power source as being a type of power adapter capable of providing a known level of current.