charge_manager: Classify VBUS supplier type

Add a new supplier type for VBUS chargers (USB chargers which supply VBUS
but are not identified as another charger type).

BUG=chrome-os-partner:37168
TEST=Manual on Samus with subsequent kernel commit. Modify code to
reject all non-VBUS suppliers, charge with SDP port, and verify charge
icon appears in OS.
BRANCH=Samus

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I5fbdb1cb57bd0224b01aaf5a763f93b678b6d204
Reviewed-on: https://chromium-review.googlesource.com/254346
Reviewed-by: Alec Berg <alecaberg@chromium.org>
This commit is contained in:
Shawn Nematbakhsh
2015-02-26 14:31:16 -08:00
committed by ChromeOS Commit Bot
parent 3ff0be248c
commit c7bc5965fa
3 changed files with 8 additions and 1 deletions

View File

@@ -183,6 +183,9 @@ static void charge_manager_fill_power_info(int port,
case CHARGE_SUPPLIER_BC12_SDP:
r->type = USB_CHG_TYPE_BC12_SDP;
break;
case CHARGE_SUPPLIER_VBUS:
r->type = USB_CHG_TYPE_VBUS;
break;
default:
r->type = USB_CHG_TYPE_OTHER;
}

View File

@@ -2780,7 +2780,8 @@ enum usb_chg_type {
USB_CHG_TYPE_BC12_DCP,
USB_CHG_TYPE_BC12_CDP,
USB_CHG_TYPE_BC12_SDP,
USB_CHG_TYPE_OTHER
USB_CHG_TYPE_OTHER,
USB_CHG_TYPE_VBUS,
};
enum usb_power_roles {
USB_PD_PORT_POWER_DISCONNECTED,

View File

@@ -3203,6 +3203,9 @@ static void print_pd_power_info(struct ec_response_usb_pd_power_info *r)
case USB_CHG_TYPE_OTHER:
printf(" Other");
break;
case USB_CHG_TYPE_VBUS:
printf(" VBUS");
break;
}
printf(" %dmV max %dmV / %dmA",
r->meas.voltage_now, r->meas.voltage_max, r->meas.current_max);