int usb_cable_in(void) { #if !CFG_FPGA_PLATFORM int exist = 0; CHARGER_TYPE ret; if ((g_boot_reason == BR_USB) || usb_accessory_in()) { ret = mt_charger_type_detection(); if (ret == PMIC_STANDARD_HOST || ret == PMIC_CHARGING_HOST) { print("\n%s USB cable in\n", MOD); mt_usb_phy_poweron(); mt_usb_phy_savecurrent(); /* enable pmic hw charger detection */ #if CFG_BATTERY_DETECT if (hw_check_battery()) pl_hw_ulc_det(); #endif exist = 1; } else if (ret == PMIC_NONSTANDARD_CHARGER || ret == PMIC_STANDARD_CHARGER) { #if CFG_USBIF_COMPLIANCE platform_set_chrg_cur(450); #endif } } return exist; #else mt_usb_phy_poweron(); mt_usb_phy_savecurrent(); return 1; #endif }
bool is_usb_connected(void) { #ifdef CONFIG_POWER_EXT if (upmu_get_rgs_chrdet() #else if (upmu_is_chr_det() #endif && (mt_charger_type_detection() == STANDARD_HOST)) { return true; } else { return false; } }
void usb_check_connect(void) { if (upmu_is_chr_det()) { switch(mt_charger_type_detection()) { case STANDARD_HOST: mt_usb_connect(); DBG(0,"connect success\n"); return; case CHARGER_UNKNOWN: case STANDARD_CHARGER: case NONSTANDARD_CHARGER: case CHARGING_HOST: break; } } }
bool usb_cable_connected(void) { #ifdef CONFIG_POWER_EXT CHARGER_TYPE chg_type = mt_charger_type_detection(); os_printk(K_INFO, "%s ext-chrdet=%d type=%d\n", __func__, upmu_get_rgs_chrdet(), chg_type); if (upmu_get_rgs_chrdet() && (chg_type == STANDARD_HOST)) #else os_printk(K_INFO, "%s chrdet=%d\n", __func__, upmu_is_chr_det()); if (upmu_is_chr_det()) #endif { return true; } else { return false; } return true; }
bool usb_cable_connected(void) { os_printk(K_DEBUG,"[MUSB] %s\n", __func__); #ifdef NEVER #ifdef CONFIG_POWER_EXT if (upmu_get_rgs_chrdet() #else if (upmu_is_chr_det() #endif && (mt_charger_type_detection() == STANDARD_HOST)) { return true; } else { return false; } #endif /* NEVER */ return true; }