summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt_Wang <Matt_Wang@compal.corp-partner.google.com>2021-08-17 21:47:03 +0800
committerCommit Bot <commit-bot@chromium.org>2021-08-18 19:28:08 +0000
commit8fa8eee5dd93f42791a0423ec55825d97b6e9c68 (patch)
treebb2ba227f06285a223000739b50b36bcac34a160
parentf0b90da8d60494c8d82c2dd68bda2dcf0eb95ea5 (diff)
downloadchrome-ec-8fa8eee5dd93f42791a0423ec55825d97b6e9c68.tar.gz
driblee: Initial EC image set gpio
Initial gpio for driblee. BUG=b:196922068 BRANCH=keeby TEST=make BOARD=driblee Signed-off-by: Matt_Wang <Matt_Wang@compal.corp-partner.google.com> Change-Id: Id6c14a5f5e8a039345d4ffb8974e8c240ccb015e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3099552 Tested-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
-rw-r--r--board/driblee/board.c14
-rw-r--r--board/driblee/board.h6
-rw-r--r--board/driblee/gpio.inc27
3 files changed, 28 insertions, 19 deletions
diff --git a/board/driblee/board.c b/board/driblee/board.c
index 7817ab7f51..4a343d6a42 100644
--- a/board/driblee/board.c
+++ b/board/driblee/board.c
@@ -58,7 +58,6 @@ static uint8_t new_adc_key_state;
/* USB-A Configuration */
const int usb_port_enable[USB_PORT_COUNT] = {
GPIO_EN_USB_A0_VBUS,
- GPIO_EN_USB_A1_VBUS,
};
/* Keyboard scan setting */
@@ -145,6 +144,19 @@ static void usb_c0_interrupt(enum gpio_signal s)
}
+static void sub_hdmi_hpd_interrupt(enum gpio_signal s)
+{
+ int hdmi_hpd_odl = gpio_get_level(GPIO_EC_I2C_SUB_C1_SDA_HDMI_HPD_ODL);
+
+ gpio_set_level(GPIO_EC_AP_USB_C1_HDMI_HPD, !hdmi_hpd_odl);
+}
+
+static void c0_ccsbu_ovp_interrupt(enum gpio_signal s)
+{
+ cprints(CC_USBPD, "C0: CC OVP, SBU OVP, or thermal event");
+ pd_handle_cc_overvoltage(0);
+}
+
#include "gpio_list.h"
/* ADC channels */
diff --git a/board/driblee/board.h b/board/driblee/board.h
index 72f0aa9ff0..6f8ef8cae6 100644
--- a/board/driblee/board.h
+++ b/board/driblee/board.h
@@ -41,7 +41,6 @@
/* Keyboard */
#define CONFIG_KEYBOARD_KEYPAD
-#define CONFIG_PWM_KBLIGHT
/* LED defines */
#define CONFIG_LED_ONOFF_STATES
@@ -63,13 +62,14 @@
#define CONFIG_USBC_RETIMER_PS8802
/* Common USB-A defines */
-#define USB_PORT_COUNT 2
+#define USB_PORT_COUNT 1
#define CONFIG_USB_PORT_POWER_SMART
+#undef CONFIG_USB_PORT_POWER_SMART_PORT_COUNT
+#define CONFIG_USB_PORT_POWER_SMART_PORT_COUNT 1
#define CONFIG_USB_PORT_POWER_SMART_CDP_SDP_ONLY
#define CONFIG_USB_PORT_POWER_SMART_DEFAULT_MODE USB_CHARGE_MODE_CDP
#define CONFIG_USB_PORT_POWER_SMART_INVERTED
#define GPIO_USB1_ILIM_SEL GPIO_USB_A0_CHARGE_EN_L
-#define GPIO_USB2_ILIM_SEL GPIO_USB_A1_CHARGE_EN_L
/******************************************************************************/
diff --git a/board/driblee/gpio.inc b/board/driblee/gpio.inc
index bf37c59fe4..e5823a011c 100644
--- a/board/driblee/gpio.inc
+++ b/board/driblee/gpio.inc
@@ -26,6 +26,8 @@ GPIO_INT(PG_PP1050_ST_OD, PIN(4, 2), GPIO_INT_BOTH, power_signal_interrupt)
/* USB-C interrupts */
GPIO_INT(USB_C0_INT_ODL, PIN(6, 2), GPIO_INT_FALLING | GPIO_PULL_UP, usb_c0_interrupt)
+GPIO_INT(EC_I2C_SUB_C1_SDA_HDMI_HPD_ODL, PIN(9, 1), GPIO_INT_BOTH, sub_hdmi_hpd_interrupt) /* HDMI_HPD */
+GPIO_INT(USB_C0_CCSBU_OVP_ODL, PIN(A, 2), GPIO_INT_FALLING | GPIO_PULL_UP, c0_ccsbu_ovp_interrupt) /* Fault protection */
/* Button interrupts */
GPIO_INT(EC_PWR_BTN_ODL, PIN(0, 1), GPIO_INT_BOTH | GPIO_PULL_UP, power_button_interrupt)
@@ -43,21 +45,14 @@ GPIO(EC_I2C_SENSOR_SCL, PIN(B, 5), GPIO_INPUT)
GPIO(EC_I2C_SENSOR_SDA, PIN(B, 4), GPIO_INPUT)
GPIO(EC_I2C_USB_C0_SCL, PIN(9, 0), GPIO_INPUT)
GPIO(EC_I2C_USB_C0_SDA, PIN(8, 7), GPIO_INPUT)
-GPIO(EC_I2C_SUB_USB_C1_SDA, PIN(9, 1), GPIO_INPUT)
-
-/* Extra Sub-board I/O pins */
-
-GPIO(EC_SUB_IO_2, PIN(3, 4), GPIO_OUT_LOW)
/* Misc Enables */
GPIO(EN_VCCIO_EXT, PIN(6, 1), GPIO_OUT_LOW)
/* TODO(b:149775160) - Modify if needed if we ever use this signal. */
GPIO(EN_VCCST, PIN(A, 7), GPIO_INPUT)
-GPIO(EN_PP3300_PEN, PIN(6, 3), GPIO_OUT_LOW)
GPIO(EN_PP3300_A, PIN(0, 3), GPIO_OUT_LOW)
GPIO(EN_PP5000_U, PIN(A, 4), GPIO_OUT_LOW)
GPIO(EN_SLP_Z, PIN(8, 3), GPIO_OUT_LOW)
-GPIO(EN_KB_BL, PIN(6, 0), GPIO_OUT_LOW)
GPIO(EN_BL_OD, PIN(D, 3), GPIO_ODR_LOW)
GPIO(EC_CBI_WP, PIN(E, 5), GPIO_OUT_LOW)
GPIO(SUB_USB_C1_INT_ODL, PIN(F, 5), GPIO_OUT_LOW) /* 5V power en */
@@ -86,12 +81,9 @@ GPIO(SYS_RST_ODL, PIN(C, 5), GPIO_ODR_HIGH)
/* USB pins */
GPIO(EC_AP_USB_C1_HDMI_HPD, PIN(9, 6), GPIO_OUT_LOW)
GPIO(EC_AP_USB_C0_HPD, PIN(9, 3), GPIO_OUT_LOW)
-GPIO(HDMI_SEL_L, PIN(7, 2), GPIO_OUT_HIGH)
GPIO(EC_BATTERY_PRES_ODL, PIN(E, 1), GPIO_INPUT)
-GPIO(USB_A0_CHARGE_EN_L, PIN(3, 7), GPIO_OUT_HIGH) /* Enable A0 1.5A Charging */
-GPIO(USB_A1_CHARGE_EN_L, PIN(F, 3), GPIO_OUT_HIGH) /* Enable A1 1.5A Charging */
-GPIO(EN_USB_A0_VBUS, PIN(4, 1), GPIO_OUT_LOW) /* Enable A1 5V Charging */
-GPIO(EN_USB_A1_VBUS, PIN(F, 2), GPIO_OUT_LOW) /* Enable A1 5V Charging */
+GPIO(EN_USB_A0_VBUS, PIN(4, 1), GPIO_OUT_LOW) /* Enable A0 5V Charging */
+GPIO(USB_A0_CHARGE_EN_L, PIN(6, 3), GPIO_OUT_HIGH) /* Reverse: Enable A0 1.5A Charging */
/*
* Lalala doesn't have these physical pins coming to the EC but uses other
* logic.
@@ -116,9 +108,6 @@ ALTERNATE(PIN_MASK(0, 0xF0), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO10-
ALTERNATE(PIN_MASK(8, 0x04), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO14 */
GPIO(EC_KSO_02_INV, PIN(1, 7), GPIO_OUT_LOW) /* KSO2 inverted */
-/* PWM */
-ALTERNATE(PIN_MASK(8, BIT(0)), 0, MODULE_PWM, 0) /* PWM3 */
-
/* UART */
ALTERNATE(PIN_MASK(6, 0x30), 0, MODULE_UART, 0) /* UART1 */
@@ -140,3 +129,11 @@ GPIO(GPIOD1_NC, PIN(D, 1), GPIO_INPUT | GPIO_PULL_UP)
GPIO(GPIOD6_NC, PIN(D, 6), GPIO_INPUT | GPIO_PULL_UP)
GPIO(GPIOE0_NC, PIN(E, 0), GPIO_INPUT | GPIO_PULL_UP)
GPIO(GPIO40_NC, PIN(4, 0), GPIO_INPUT | GPIO_PULL_UP)
+GPIO(GPIO50_NC, PIN(5, 0), GPIO_INPUT | GPIO_PULL_UP)
+GPIO(GPIO34_NC, PIN(3, 4), GPIO_INPUT | GPIO_PULL_UP)
+GPIO(GPIO37_NC, PIN(3, 7), GPIO_INPUT | GPIO_PULL_UP)
+GPIO(GPIOF2_NC, PIN(F, 2), GPIO_INPUT | GPIO_PULL_UP)
+GPIO(GPIOF3_NC, PIN(F, 3), GPIO_INPUT | GPIO_PULL_UP)
+GPIO(GPIO72_NC, PIN(7, 2), GPIO_INPUT | GPIO_PULL_UP)
+GPIO(GPIO73_NC, PIN(7, 3), GPIO_INPUT | GPIO_PULL_UP)
+GPIO(GPIO75_NC, PIN(7, 5), GPIO_INPUT | GPIO_PULL_UP)