phy: phy-rockchip-inno-usb2: fix the wrong charger type
The wrong type of charger was reported when there was not usb-cable plugged in. This change adds USB-Vbus status checking before do charge detection to fix it. Change-Id: I5e35414d40fdfe8d07ab2aa0771490e86a97e248 Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
This commit is contained in:
parent
57ab23a62c
commit
bebadd87fb
|
|
@ -265,6 +265,12 @@ int rockchip_chg_get_type(void)
|
|||
base = get_reg_base(rphy);
|
||||
port_cfg = &rphy->phy_cfg->port_cfgs[USB2PHY_PORT_OTG];
|
||||
|
||||
/* Check USB-Vbus status first */
|
||||
if (!property_enabled(base, &port_cfg->utmi_bvalid)) {
|
||||
pr_info("%s: no charger found\n", __func__);
|
||||
return POWER_SUPPLY_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
/* Suspend USB-PHY and put the controller in non-driving mode */
|
||||
property_enable(base, &port_cfg->phy_sus, true);
|
||||
property_enable(base, &rphy->phy_cfg->chg_det.opmode, false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue