Patent ID: 8458375

Claim:
A portable electronic device, comprising: an audio port; a universal serial bus (USB) circuit; an audio circuit a detecting unit connected to the audio port, and generating a detecting signal in response to detection of either an earphone/microphone or a USB apparatus being connected to the audio port; a switch selectively connecting the audio circuit or the USB circuit to the audio port according to the detecting signal; a microcontroller connected to the detecting unit and the switch, the microcontroller selecting the audio circuit or the USB circuit to connect to the audio port by the switch according to the detecting signal; wherein the audio port includes a first contact, a second contact, a third contact, and a fourth contact; a power management unit connected to the microcontroller and the audio port, wherein the power management unit includes a transistor, a sampling resistor, and a hot swap controller; a source of the transistor is connected to the third contact and also grounded by a capacitor, a drain of the transistor is connected to a power supply by the sampling resistor, a grain of the transistor is connected to the hot swap controller, the hot swap controller detects a voltage of the sampling resistor and controls the transistor to turn on/off according the detected voltage; and wherein the hot swap controller compares the detected voltage with a reference voltage, when the detected voltage is lower than the reference voltage, the hot swap controller controls the transistor to turn on; when the detected voltage is higher than the reference voltage, the hot swap controller controls the transistor to turn off.