diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2017-02-28 15:33:00 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-03-07 14:15:56 -0800 |
commit | ad089de4b0430e5d997b9f6d6f187daae1fb11dc (patch) | |
tree | bf6668423a37f7beba6f9c1b24765385cc6e6135 /include | |
parent | 5b8b06e976623ad52a1c4c558dfdac8b1c9d3dc7 (diff) | |
download | chrome-ec-ad089de4b0430e5d997b9f6d6f187daae1fb11dc.tar.gz |
pdcontrol: Suspend port individually
pdcontrol suspend command will be used to prevent tcpm from putting
the chip into sleep while firmware update is taking place. Currently
the command suspends or resumes port 0. This patch makes the command
apply to ports individually.
pd enable console command now takes a port number:
pd <port> enable/disable.
This patch also replaces CONFIG_USB_PD_COMM_ENABLED with _DISABLED.
When it's defined, PD communication is disabled at startup.
Plankton undefines CONFIG_USB_PD_COMM_ENABLED enable, intending to
disable PD communication at startup. Therefore, this patch defines
CONFIG_USB_PD_COMM_DISABLED in its board.h.
BUG=b:35586859
BRANCH=none
TEST=From AP console:
localhost # /tmp/ectool pdcontrol suspend 1
[600.188013 TCPC p1 suspended!]
> pd 1 state
Port C1 CC1, Dis - Role: SNK-UFP State: SUSPENDED, Flags: 0x0020
localhost # /tmp/ectool pdcontrol resume 1
[678.516613 TCPC p1 resumed!]
> pd 1 state
Port C1 CC1, Ena - Role: SNK-UFP State: DRP_AUTO_TOGGLE, Flags: 0x0020
From ec console:
> pd 1 disable
Port C1 disable
> pd 1 state
Port C1 CC1, Dis - Role: SNK-UFP State: DRP_AUTO_TOGGLE, Flags: 0x0020
> pd 1 enable
Port C1 enabled
> pd 1 state
Port C1 CC1, Ena - Role: SNK-UFP State: DRP_AUTO_TOGGLE, Flags: 0x0020
Change-Id: Ia0cc4904ac52adc4b89de20918968c8df78b9c80
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/447968
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 4 | ||||
-rw-r--r-- | include/usb_pd.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/config.h b/include/config.h index 19a6653161..b998fde1ed 100644 --- a/include/config.h +++ b/include/config.h @@ -2158,8 +2158,8 @@ /* Check if max voltage request is allowed before each request */ #undef CONFIG_USB_PD_CHECK_MAX_REQUEST_ALLOWED -/* Default state of PD communication enabled flag */ -#define CONFIG_USB_PD_COMM_ENABLED +/* Default state of PD communication disabled flag */ +#undef CONFIG_USB_PD_COMM_DISABLED /* * Do not enable PD communication in RO as a security measure. diff --git a/include/usb_pd.h b/include/usb_pd.h index 23909e6ac7..01b4ed5358 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -1555,9 +1555,10 @@ void pd_request_data_swap(int port); * the port can still detect connection and source power but will not * send or respond to any PD communication. * + * @param port USB-C port number * @param enable Enable flag to set */ -void pd_comm_enable(int enable); +void pd_comm_enable(int port, int enable); /** * Set the PD pings enabled flag. When source has negotiated power over |