mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 00:51:29 +00:00
samus_pd: add dual-role port flag to power info host command
Add flag for whether or not device plugged into a given port is a dual-role PD device. For now, the dual-role flag is always 0, but need to add the flag to the host command now for compatibility in the future. BUG=chrome-os-partner:32650 BRANCH=samus TEST=load onto samus, run ectool --name=cros_pd usbpdpower and verify that for anything plugged in it says "dedicated charger" Change-Id: I2d3c8c149802492f27a87a47aaa68fbf505ee7a9 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/226820 Reviewed-by: Sameer Nanda <snanda@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
86c7e2e90a
commit
3a4f718f22
@@ -201,6 +201,9 @@ static int hc_pd_power_info(struct host_cmd_handler_args *args)
|
||||
else
|
||||
r->role = USB_PD_PORT_POWER_DISCONNECTED;
|
||||
|
||||
/* TODO: fill in appropriate dual-role status */
|
||||
r->dualrole = 0;
|
||||
|
||||
if (sup == CHARGE_SUPPLIER_NONE) {
|
||||
r->type = USB_CHG_TYPE_NONE;
|
||||
r->voltage_max = 0;
|
||||
|
||||
@@ -2778,9 +2778,12 @@ enum usb_power_roles {
|
||||
struct ec_response_usb_pd_power_info {
|
||||
uint8_t role;
|
||||
uint8_t type;
|
||||
uint8_t dualrole;
|
||||
uint8_t reserved1;
|
||||
uint16_t voltage_max;
|
||||
uint16_t voltage_now;
|
||||
uint16_t current_max;
|
||||
uint16_t reserved2;
|
||||
uint32_t max_power;
|
||||
} __packed;
|
||||
|
||||
|
||||
@@ -2921,6 +2921,11 @@ int cmd_usb_pd_power(int argc, char *argv[])
|
||||
printf("Unknown\n");
|
||||
}
|
||||
|
||||
if (r->role != USB_PD_PORT_POWER_DISCONNECTED) {
|
||||
printf(" %s\n", r->dualrole ?
|
||||
"Dual-role device" : "Dedicated charger");
|
||||
}
|
||||
|
||||
printf(" Charger type: ");
|
||||
switch (r->type) {
|
||||
case USB_CHG_TYPE_PD:
|
||||
|
||||
Reference in New Issue
Block a user