diff options
author | Sue <sue.chen@quanta.corp-partner.google.com> | 2020-06-02 13:45:51 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-05 18:40:55 +0000 |
commit | 48f085562764cb00781a479322cf9f4328578a73 (patch) | |
tree | 6aec5bd2e0736482909fb3ab006b497bc1835547 | |
parent | 880a9e8f7200a4a0e3f2d98e85fcf492434db161 (diff) | |
download | chrome-ec-48f085562764cb00781a479322cf9f4328578a73.tar.gz |
Ezkinil: modify some gpio definition
rename GPIO F4: DP1_HPD -> EC_DP1_HPD
remove IOEX 10 HDMI_CONN_HPD_3V3_DB
add GPIO 75: DP1_HPD_EC_IN
move hdmi_hpd_interrupt and hdmi_hpd_handler from baseboard to board
BUG=b:152512560, b:153397667, b:155797182
BRANCH=none
TEST=make buildall -j
Change-Id: I5cdbb42a8284c85104dbbbe7b3d557d51a11a074
Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2224693
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Tested-by: Edward Hill <ecgh@chromium.org>
-rw-r--r-- | baseboard/zork/baseboard.h | 1 | ||||
-rw-r--r-- | baseboard/zork/variant_trembyle.c | 21 | ||||
-rw-r--r-- | board/berknip/board.c | 17 | ||||
-rw-r--r-- | board/berknip/board.h | 2 | ||||
-rw-r--r-- | board/ezkinil/board.c | 18 | ||||
-rw-r--r-- | board/ezkinil/board.h | 3 | ||||
-rw-r--r-- | board/ezkinil/gpio.inc | 4 | ||||
-rw-r--r-- | board/morphius/board.c | 17 | ||||
-rw-r--r-- | board/morphius/board.h | 2 | ||||
-rw-r--r-- | board/trembyle/board.c | 17 | ||||
-rw-r--r-- | board/trembyle/board.h | 2 |
11 files changed, 79 insertions, 25 deletions
diff --git a/baseboard/zork/baseboard.h b/baseboard/zork/baseboard.h index 71cae27e96..708ba40e4d 100644 --- a/baseboard/zork/baseboard.h +++ b/baseboard/zork/baseboard.h @@ -353,7 +353,6 @@ void board_reset_pd_mcu(void); void tcpc_alert_event(enum gpio_signal signal); void bc12_interrupt(enum gpio_signal signal); void ppc_interrupt(enum gpio_signal signal); -void hdmi_hpd_interrupt(enum ioex_signal signal); #endif #ifdef CONFIG_USB_TYPEC_PD_FAST_ROLE_SWAP diff --git a/baseboard/zork/variant_trembyle.c b/baseboard/zork/variant_trembyle.c index 88d5c5dec4..ac39568835 100644 --- a/baseboard/zork/variant_trembyle.c +++ b/baseboard/zork/variant_trembyle.c @@ -507,24 +507,3 @@ struct usb_mux usbc1_amd_fp5_usb_mux = { .i2c_addr_flags = AMD_FP5_MUX_I2C_ADDR_FLAGS, .driver = &amd_fp5_usb_mux_driver, }; - -/***************************************************************************** - * HDMI HPD - */ - -static void hdmi_hpd_handler(void) -{ - int hpd = 0; - - /* Pass HPD through from DB OPT1 HDMI connector to AP's DP1. */ - ioex_get_level(IOEX_HDMI_CONN_HPD_3V3_DB, &hpd); - gpio_set_level(GPIO_DP1_HPD, hpd); - ccprints("HDMI HPD %d", hpd); -} -DECLARE_DEFERRED(hdmi_hpd_handler); - -void hdmi_hpd_interrupt(enum ioex_signal signal) -{ - /* Debounce for 2 msec. */ - hook_call_deferred(&hdmi_hpd_handler_data, (2 * MSEC)); -} diff --git a/board/berknip/board.c b/board/berknip/board.c index 025a77ad95..1562c91eeb 100644 --- a/board/berknip/board.c +++ b/board/berknip/board.c @@ -377,3 +377,20 @@ void mst_hpd_interrupt(enum ioex_signal signal) gpio_set_level(GPIO_DP1_HPD, hpd); hook_call_deferred(&mst_hpd_handler_data, (2 * MSEC)); } + +static void hdmi_hpd_handler(void) +{ + int hpd = 0; + + /* Pass HPD through from DB OPT1 HDMI connector to AP's DP1. */ + ioex_get_level(IOEX_HDMI_CONN_HPD_3V3_DB, &hpd); + gpio_set_level(GPIO_DP1_HPD, hpd); + ccprints("HDMI HPD %d", hpd); +} +DECLARE_DEFERRED(hdmi_hpd_handler); + +void hdmi_hpd_interrupt(enum ioex_signal signal) +{ + /* Debounce for 2 msec. */ + hook_call_deferred(&hdmi_hpd_handler_data, (2 * MSEC)); +} diff --git a/board/berknip/board.h b/board/berknip/board.h index 280690e1cf..cf0fd6df07 100644 --- a/board/berknip/board.h +++ b/board/berknip/board.h @@ -194,6 +194,8 @@ extern const struct usb_mux usbc1_tusb544; extern const struct usb_mux usbc1_ps8743; extern struct usb_mux usbc1_amd_fp5_usb_mux; +void hdmi_hpd_interrupt(enum ioex_signal signal); + #endif /* !__ASSEMBLER__ */ #endif /* __CROS_EC_BOARD_H */ diff --git a/board/ezkinil/board.c b/board/ezkinil/board.c index d3e5e15e5e..87d5dd16ca 100644 --- a/board/ezkinil/board.c +++ b/board/ezkinil/board.c @@ -306,10 +306,26 @@ void setup_fw_config(void) setup_mux(); if (ec_config_has_hdmi_conn_hpd()) - ioex_enable_interrupt(IOEX_HDMI_CONN_HPD_3V3_DB); + gpio_enable_interrupt(GPIO_DP1_HPD_EC_IN); } DECLARE_HOOK(HOOK_INIT, setup_fw_config, HOOK_PRIO_INIT_I2C + 2); +static void hdmi_hpd_handler(void) +{ + /* Pass HPD through from DB OPT1 HDMI connector to AP's DP1. */ + int hpd = gpio_get_level(GPIO_DP1_HPD_EC_IN); + + gpio_set_level(GPIO_DP1_HPD, hpd); + ccprints("HDMI HPD %d", hpd); +} +DECLARE_DEFERRED(hdmi_hpd_handler); + +void hdmi_hpd_interrupt(enum gpio_signal signal) +{ + /* Debounce for 2 msec. */ + hook_call_deferred(&hdmi_hpd_handler_data, (2 * MSEC)); +} + /***************************************************************************** * Fan */ diff --git a/board/ezkinil/board.h b/board/ezkinil/board.h index 343acb264b..f16c4badb4 100644 --- a/board/ezkinil/board.h +++ b/board/ezkinil/board.h @@ -63,6 +63,7 @@ #define GPIO_VOLUME_UP_L GPIO_VOLUP_BTN_ODL #define GPIO_WP_L GPIO_EC_WP_L #define GPIO_PACKET_MODE_EN GPIO_EC_H1_PACKET_MODE +#define GPIO_DP1_HPD GPIO_EC_DP1_HPD #ifndef __ASSEMBLER__ @@ -190,6 +191,8 @@ extern const struct usb_mux usbc1_tusb544; extern const struct usb_mux usbc1_ps8743; extern struct usb_mux usbc1_amd_fp5_usb_mux; +void hdmi_hpd_interrupt(enum gpio_signal signal); + #endif /* !__ASSEMBLER__ */ #endif /* __CROS_EC_BOARD_H */ diff --git a/board/ezkinil/gpio.inc b/board/ezkinil/gpio.inc index 9168a47116..c1d25a15bd 100644 --- a/board/ezkinil/gpio.inc +++ b/board/ezkinil/gpio.inc @@ -25,6 +25,7 @@ GPIO_INT(EC_WP_L, PIN(5, 0), GPIO_INT_BOTH, switch_interrupt) GPIO_INT(VOLDN_BTN_ODL, PIN(A, 6), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(VOLUP_BTN_ODL, PIN(9, 5), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(6AXIS_INT_L, PIN(A, 0), GPIO_INT_FALLING | GPIO_PULL_UP, bmi160_interrupt) +GPIO_INT(DP1_HPD_EC_IN, PIN(7, 5), GPIO_INT_BOTH, hdmi_hpd_interrupt) /* GPIO_INT_BOTH is required for PSL wake from hibernate, but we don't need an interrupt handler. */ GPIO(EC_RST_ODL, PIN(0, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH) @@ -46,7 +47,7 @@ GPIO(EC_SYS_RST_L, PIN(C, 7), GPIO_ODR_HIGH) /* Cold Reset to SOC */ GPIO(USB_C0_TCPC_RST_L, PIN(E, 1), GPIO_OUT_HIGH) /* C0 TCPC Reset */ GPIO(USB_C1_TCPC_RST_L, PIN(F, 0), GPIO_OUT_HIGH) /* C1 TCPC Reset */ GPIO(USB_C0_HPD, PIN(F, 5), GPIO_OUT_LOW) /* C0 DP Hotplug Detect */ -GPIO(DP1_HPD, PIN(F, 4), GPIO_OUT_LOW) /* C1 DP Hotplug Detect */ +GPIO(EC_DP1_HPD, PIN(F, 4), GPIO_OUT_LOW) /* C1 DP Hotplug Detect */ GPIO(DP2_HPD, PIN(C, 1), GPIO_OUT_LOW) /* C1 DP Hotplug Detect */ GPIO(EC_H1_PACKET_MODE, PIN(8, 6), GPIO_OUT_LOW) /* H1 Packet Mode */ @@ -55,7 +56,6 @@ UNIMPLEMENTED(PCH_SMI_L) GPIO(LED_FULL_L, PIN(6, 0), GPIO_OUT_HIGH) GPIO(LED_CHRG_L, PIN(C, 0), GPIO_OUT_HIGH) -IOEX_INT(HDMI_CONN_HPD_3V3_DB, EXPIN(USBC_PORT_C1, 1, 0), GPIO_INT_BOTH, hdmi_hpd_interrupt) IOEX(USB_C0_FAULT_ODL, EXPIN(USBC_PORT_C0, 0, 3), GPIO_ODR_HIGH) /* C0 Fault to SOC */ IOEX(USB_C0_TCPC_FASTSW_CTL_EN, EXPIN(USBC_PORT_C0, 0, 4), GPIO_OUT_LOW) /* C0 FastSwitch Control */ diff --git a/board/morphius/board.c b/board/morphius/board.c index 04960b7d67..34b223095b 100644 --- a/board/morphius/board.c +++ b/board/morphius/board.c @@ -488,3 +488,20 @@ void mst_hpd_interrupt(enum ioex_signal signal) gpio_set_level(GPIO_DP1_HPD, hpd); hook_call_deferred(&mst_hpd_handler_data, (2 * MSEC)); } + +static void hdmi_hpd_handler(void) +{ + int hpd = 0; + + /* Pass HPD through from DB OPT1 HDMI connector to AP's DP1. */ + ioex_get_level(IOEX_HDMI_CONN_HPD_3V3_DB, &hpd); + gpio_set_level(GPIO_DP1_HPD, hpd); + ccprints("HDMI HPD %d", hpd); +} +DECLARE_DEFERRED(hdmi_hpd_handler); + +void hdmi_hpd_interrupt(enum ioex_signal signal) +{ + /* Debounce for 2 msec. */ + hook_call_deferred(&hdmi_hpd_handler_data, (2 * MSEC)); +} diff --git a/board/morphius/board.h b/board/morphius/board.h index ebe1879c31..a3058674e2 100644 --- a/board/morphius/board.h +++ b/board/morphius/board.h @@ -203,6 +203,8 @@ extern const struct usb_mux usbc1_ps8802; extern const struct usb_mux usbc1_ps8818; extern struct usb_mux usbc1_amd_fp5_usb_mux; +void hdmi_hpd_interrupt(enum ioex_signal signal); + #endif /* !__ASSEMBLER__ */ diff --git a/board/trembyle/board.c b/board/trembyle/board.c index e6d09f2d69..73dcf89f72 100644 --- a/board/trembyle/board.c +++ b/board/trembyle/board.c @@ -405,3 +405,20 @@ void mst_hpd_interrupt(enum ioex_signal signal) gpio_set_level(GPIO_DP1_HPD, hpd); hook_call_deferred(&mst_hpd_handler_data, (2 * MSEC)); } + +static void hdmi_hpd_handler(void) +{ + int hpd = 0; + + /* Pass HPD through from DB OPT1 HDMI connector to AP's DP1. */ + ioex_get_level(IOEX_HDMI_CONN_HPD_3V3_DB, &hpd); + gpio_set_level(GPIO_DP1_HPD, hpd); + ccprints("HDMI HPD %d", hpd); +} +DECLARE_DEFERRED(hdmi_hpd_handler); + +void hdmi_hpd_interrupt(enum ioex_signal signal) +{ + /* Debounce for 2 msec. */ + hook_call_deferred(&hdmi_hpd_handler_data, (2 * MSEC)); +} diff --git a/board/trembyle/board.h b/board/trembyle/board.h index 228b2e0330..a520b1279a 100644 --- a/board/trembyle/board.h +++ b/board/trembyle/board.h @@ -201,6 +201,8 @@ extern const struct usb_mux usbc1_ps8802; extern const struct usb_mux usbc1_ps8818; extern struct usb_mux usbc1_amd_fp5_usb_mux; +void hdmi_hpd_interrupt(enum ioex_signal signal); + #endif /* !__ASSEMBLER__ */ #endif /* __CROS_EC_BOARD_H */ |