summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-10-16 10:43:49 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-11-14 16:56:23 -0800
commit7c6ce54b1a3844440a7350d8baa2f5fe84f4effa (patch)
treefa456b009ddfdc7670da5c5a92356ed61b396fa6 /baseboard
parent9634e023470dba161b3a85d5e8344610dcb9eec9 (diff)
downloadchrome-ec-7c6ce54b1a3844440a7350d8baa2f5fe84f4effa.tar.gz
cleanup: updating grunt & octopus style to match
Making style of tcpc_alert_event method match the style of other ToT implementations. BRANCH=grunt BUG=none TEST=octopus pd still works. Change-Id: Id9132380a466b6e9580cff6d014f30e1c11de583 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1283453 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/grunt/baseboard.c17
-rw-r--r--baseboard/octopus/variant_usbc_standalone_tcpcs.c15
2 files changed, 19 insertions, 13 deletions
diff --git a/baseboard/grunt/baseboard.c b/baseboard/grunt/baseboard.c
index 8591501303..1c0d0d55fc 100644
--- a/baseboard/grunt/baseboard.c
+++ b/baseboard/grunt/baseboard.c
@@ -104,18 +104,17 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
void tcpc_alert_event(enum gpio_signal signal)
{
- int port;
+ int port = -1;
- if (signal == GPIO_USB_C0_PD_INT_ODL) {
- if (!gpio_get_level(GPIO_USB_C0_PD_RST_L))
- return;
+ switch (signal) {
+ case GPIO_USB_C0_PD_INT_ODL:
port = 0;
- }
-
- if (signal == GPIO_USB_C1_PD_INT_ODL) {
- if (!gpio_get_level(GPIO_USB_C1_PD_RST_L))
- return;
+ break;
+ case GPIO_USB_C1_PD_INT_ODL:
port = 1;
+ break;
+ default:
+ return;
}
schedule_deferred_pd_interrupt(port);
diff --git a/baseboard/octopus/variant_usbc_standalone_tcpcs.c b/baseboard/octopus/variant_usbc_standalone_tcpcs.c
index e4e981a72b..e5db47325f 100644
--- a/baseboard/octopus/variant_usbc_standalone_tcpcs.c
+++ b/baseboard/octopus/variant_usbc_standalone_tcpcs.c
@@ -79,11 +79,18 @@ unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips);
void tcpc_alert_event(enum gpio_signal signal)
{
- const int port = (signal == GPIO_USB_C1_MUX_INT_ODL);
-
- if ((signal == GPIO_USB_C1_MUX_INT_ODL) &&
- !gpio_get_level(GPIO_USB_C1_PD_RST_ODL))
+ int port = -1;
+
+ switch (signal) {
+ case GPIO_USB_C0_MUX_INT_ODL:
+ port = 0;
+ break;
+ case GPIO_USB_C1_MUX_INT_ODL:
+ port = 1;
+ break;
+ default:
return;
+ }
schedule_deferred_pd_interrupt(port);
}