summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2022-02-10 17:26:31 -0700
committerCommit Bot <commit-bot@chromium.org>2022-02-25 21:10:51 +0000
commit8cf6f2acfdba3b8c08610821876bf445e06de7c1 (patch)
tree0e7cc826210cafdcf92697aea8275bf2112cd4a2
parent498c8a0ad97fd1ee03ece7fbb4485c3bffff8505 (diff)
downloadchrome-ec-8cf6f2acfdba3b8c08610821876bf445e06de7c1.tar.gz
zephyr: Fix GPIO includes for corsola
Use the Zephyr driver GPIO include for Zephyr shim code instead of the legacy EC GPIO header. BUG=b:218856245 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I80f9cbf012a9bd49b80f2b0fad1f0663da2e34b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3489246 Reviewed-by: Tristan Honscheid <honscheid@google.com>
-rw-r--r--zephyr/projects/corsola/include/baseboard_usbc_config.h4
-rw-r--r--zephyr/projects/corsola/src/board_chipset.c3
-rw-r--r--zephyr/projects/corsola/src/hibernate.c2
-rw-r--r--zephyr/projects/corsola/src/kingler/usb_pd_policy.c1
-rw-r--r--zephyr/projects/corsola/src/kingler/usbc_config.c7
-rw-r--r--zephyr/projects/corsola/src/krabby/battery.c1
-rw-r--r--zephyr/projects/corsola/src/krabby/hooks.c3
-rw-r--r--zephyr/projects/corsola/src/krabby/led.c1
-rw-r--r--zephyr/projects/corsola/src/usbc_config.c3
-rw-r--r--zephyr/projects/corsola/src/variant_db_detection.c13
10 files changed, 19 insertions, 19 deletions
diff --git a/zephyr/projects/corsola/include/baseboard_usbc_config.h b/zephyr/projects/corsola/include/baseboard_usbc_config.h
index 1d6fb33128..eb09a86865 100644
--- a/zephyr/projects/corsola/include/baseboard_usbc_config.h
+++ b/zephyr/projects/corsola/include/baseboard_usbc_config.h
@@ -8,11 +8,7 @@
#ifndef __CROS_EC_BASEBOARD_USBC_CONFIG_H
#define __CROS_EC_BASEBOARD_USBC_CONFIG_H
-#include "gpio.h"
-
-void bc12_interrupt(enum gpio_signal signal);
void ppc_interrupt(enum gpio_signal signal);
-void tcpc_alert_event(enum gpio_signal signal);
/* USB-A ports */
enum usba_port {
diff --git a/zephyr/projects/corsola/src/board_chipset.c b/zephyr/projects/corsola/src/board_chipset.c
index 22d5de5346..81d49a73bd 100644
--- a/zephyr/projects/corsola/src/board_chipset.c
+++ b/zephyr/projects/corsola/src/board_chipset.c
@@ -5,8 +5,9 @@
/* Corsola baseboard-chipset specific configuration */
+#include <drivers/gpio.h>
+
#include "common.h"
-#include "gpio.h"
#include "hooks.h"
/* Called on AP S3 -> S0 transition */
diff --git a/zephyr/projects/corsola/src/hibernate.c b/zephyr/projects/corsola/src/hibernate.c
index e70047b7ab..8eae2e697a 100644
--- a/zephyr/projects/corsola/src/hibernate.c
+++ b/zephyr/projects/corsola/src/hibernate.c
@@ -2,10 +2,10 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+#include <drivers/gpio.h>
#include "charger.h"
#include "driver/charger/isl923x_public.h"
-#include "gpio.h"
#include "system.h"
/* Corsola board specific hibernate implementation */
diff --git a/zephyr/projects/corsola/src/kingler/usb_pd_policy.c b/zephyr/projects/corsola/src/kingler/usb_pd_policy.c
index ac33b4e3b7..c06f817ba1 100644
--- a/zephyr/projects/corsola/src/kingler/usb_pd_policy.c
+++ b/zephyr/projects/corsola/src/kingler/usb_pd_policy.c
@@ -6,7 +6,6 @@
#include "charge_manager.h"
#include "console.h"
#include "driver/ppc/rt1718s.h"
-#include "gpio.h"
#include "system.h"
#include "usb_mux.h"
#include "usb_pd.h"
diff --git a/zephyr/projects/corsola/src/kingler/usbc_config.c b/zephyr/projects/corsola/src/kingler/usbc_config.c
index a5b5351202..ee9f79ed7c 100644
--- a/zephyr/projects/corsola/src/kingler/usbc_config.c
+++ b/zephyr/projects/corsola/src/kingler/usbc_config.c
@@ -25,6 +25,13 @@
#include "baseboard_usbc_config.h"
#include "variant_db_detection.h"
+/* TODO(b/220196310): Create GPIO driver for RT17181S TCPC */
+#ifdef __REQUIRE_ZEPHYR_GPIOS__
+#undef __REQUIRE_ZEPHYR_GPIOS__
+#endif
+#include "gpio.h"
+
+
#define CPRINTS(format, args...) cprints(CC_USBPD, format, ## args)
#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ## args)
diff --git a/zephyr/projects/corsola/src/krabby/battery.c b/zephyr/projects/corsola/src/krabby/battery.c
index f07c38e1b8..0c0efc8200 100644
--- a/zephyr/projects/corsola/src/krabby/battery.c
+++ b/zephyr/projects/corsola/src/krabby/battery.c
@@ -8,7 +8,6 @@
#include "battery_smart.h"
#include "charge_manager.h"
#include "chipset.h"
-#include "gpio.h"
#include "hooks.h"
#include "system.h"
#include "usb_pd.h"
diff --git a/zephyr/projects/corsola/src/krabby/hooks.c b/zephyr/projects/corsola/src/krabby/hooks.c
index 59d56fec1d..cba2401f12 100644
--- a/zephyr/projects/corsola/src/krabby/hooks.c
+++ b/zephyr/projects/corsola/src/krabby/hooks.c
@@ -3,7 +3,8 @@
* found in the LICENSE file.
*/
-#include "gpio.h"
+#include <drivers/gpio.h>
+
#include "hooks.h"
static void board_suspend(void)
diff --git a/zephyr/projects/corsola/src/krabby/led.c b/zephyr/projects/corsola/src/krabby/led.c
index 7b3aaf095b..43832d7485 100644
--- a/zephyr/projects/corsola/src/krabby/led.c
+++ b/zephyr/projects/corsola/src/krabby/led.c
@@ -5,7 +5,6 @@
#include "chipset.h"
#include "ec_commands.h"
-#include "gpio.h"
#include "hooks.h"
#include "led_common.h"
#include "led_onoff_states.h"
diff --git a/zephyr/projects/corsola/src/usbc_config.c b/zephyr/projects/corsola/src/usbc_config.c
index b83209285b..a5706fbd28 100644
--- a/zephyr/projects/corsola/src/usbc_config.c
+++ b/zephyr/projects/corsola/src/usbc_config.c
@@ -5,6 +5,8 @@
/* Corsola baseboard-specific USB-C configuration */
+#include <drivers/gpio.h>
+
#include "adc.h"
#include "baseboard_usbc_config.h"
#include "button.h"
@@ -13,7 +15,6 @@
#include "console.h"
#include "ec_commands.h"
#include "extpower.h"
-#include "gpio.h"
#include "gpio/gpio_int.h"
#include "hooks.h"
#include "i2c.h"
diff --git a/zephyr/projects/corsola/src/variant_db_detection.c b/zephyr/projects/corsola/src/variant_db_detection.c
index b6e57b949f..4ca6bad814 100644
--- a/zephyr/projects/corsola/src/variant_db_detection.c
+++ b/zephyr/projects/corsola/src/variant_db_detection.c
@@ -4,10 +4,9 @@
*/
/* Corsola daughter board detection */
+#include <drivers/gpio.h>
#include "console.h"
-#include "drivers/gpio.h"
-#include "dt-bindings/gpio_defines.h"
#include "gpio/gpio_int.h"
#include "hooks.h"
@@ -16,15 +15,13 @@
#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args)
#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ## args)
-BUILD_ASSERT(GPIO_OUT_HIGH == 0xA00, "Don't use cros ec gpio flags here");
-
static void corsola_db_config(enum corsola_db_type type)
{
switch (type) {
case CORSOLA_DB_HDMI:
/* EC_X_GPIO1 */
gpio_pin_configure_dt(GPIO_DT_FROM_ALIAS(gpio_en_hdmi_pwr),
- GPIO_OUT_HIGH);
+ GPIO_OUTPUT_HIGH);
/* X_EC_GPIO2 */
gpio_pin_configure_dt(GPIO_DT_FROM_ALIAS(gpio_ps185_ec_dp_hpd),
GPIO_INPUT);
@@ -32,12 +29,12 @@ static void corsola_db_config(enum corsola_db_type type)
GPIO_INT_FROM_NODELABEL(int_x_ec_gpio2));
/* EC_X_GPIO3 */
gpio_pin_configure_dt(GPIO_DT_FROM_ALIAS(gpio_ps185_pwrdn_odl),
- GPIO_ODR_HIGH);
+ GPIO_OUTPUT_HIGH | GPIO_OPEN_DRAIN);
return;
case CORSOLA_DB_TYPEC:
/* EC_X_GPIO1 */
gpio_pin_configure_dt(GPIO_DT_FROM_ALIAS(gpio_usb_c1_frs_en),
- GPIO_OUT_LOW);
+ GPIO_OUTPUT_LOW);
/* X_EC_GPIO2 */
gpio_pin_configure_dt(
GPIO_DT_FROM_ALIAS(gpio_usb_c1_ppc_int_odl),
@@ -47,7 +44,7 @@ static void corsola_db_config(enum corsola_db_type type)
/* EC_X_GPIO3 */
gpio_pin_configure_dt(
GPIO_DT_FROM_ALIAS(gpio_usb_c1_dp_in_hpd),
- GPIO_OUT_LOW);
+ GPIO_OUTPUT_LOW);
return;
default:
break;