+ int id = sunxi_usb_phy_id_detect(0);
+
+ if (id == 1 && sunxi_usb_phy_power_is_on(0))
+ sunxi_usb_phy_power_off(0);
+
+ if (!sunxi_usb_phy_power_is_on(0)) {
+ int vbus = sunxi_usb_phy_vbus_detect(0);
+ if (vbus == 1) {
+ printf("A charger is plugged into the OTG: ");
+ return -ENODEV;
+ }