diff options
author | Tang Qijun <qijun.tang@ecs.corp-partner.google.com> | 2022-08-24 09:01:42 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-08-25 07:02:04 +0000 |
commit | 8c28b4fa0b514935868764f0113766c93d3b5acb (patch) | |
tree | 085008ca38ec0f40d75f5092339ec4058d695c02 | |
parent | b7bcc2ae420f79a2b35f3410d3d1f5a8156eda2d (diff) | |
download | chrome-ec-8c28b4fa0b514935868764f0113766c93d3b5acb.tar.gz |
Pazquel360: Setup volume buttons for pazquel360 only
Pazquel/pazquel360 share the same firmware, setup volume buttons for
pazquel360 only.
BUG=b:239599467
BRANCH=trogdor
TEST=emerge-trogdor chromeos-ec & ectool mkbpget buttons on pazquel360
Signed-off-by: Tang Qijun <qijun.tang@ecs.corp-partner.google.com>
Change-Id: I996b38b46bdc1e4a7cbc7257e72a42671d61d7c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3853302
Reviewed-by: Wai-Hong Tam <waihong@google.com>
-rw-r--r-- | board/pazquel/board.c | 19 | ||||
-rw-r--r-- | board/pazquel/board.h | 6 | ||||
-rw-r--r-- | board/pazquel/gpio.inc | 4 |
3 files changed, 24 insertions, 5 deletions
diff --git a/board/pazquel/board.c b/board/pazquel/board.c index 5cf3b29156..bcbf6a8e07 100644 --- a/board/pazquel/board.c +++ b/board/pazquel/board.c @@ -311,6 +311,16 @@ void board_tcpc_init(void) for (int port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; ++port) usb_mux_hpd_update(port, USB_PD_MUX_HPD_LVL_DEASSERTED | USB_PD_MUX_HPD_IRQ_DEASSERTED); + /* + * Pazquel/pazquel360 share the same firmware ,only pazquel360 has + * volume keys. So disable volume keys for pazquel board + */ + if (!board_has_side_volume_buttons()) { + button_disable_gpio(BUTTON_VOLUME_UP); + button_disable_gpio(BUTTON_VOLUME_DOWN); + gpio_set_flags(GPIO_VOLUME_DOWN_L, GPIO_INPUT | GPIO_PULL_DOWN); + gpio_set_flags(GPIO_VOLUME_UP_L, GPIO_INPUT | GPIO_PULL_DOWN); + } } DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C + 1); @@ -697,3 +707,12 @@ static void sku_init(void) CPRINTS("SKU: %u (%s)", sku_id, model_name[get_model()]); } DECLARE_HOOK(HOOK_INIT, sku_init, HOOK_PRIO_INIT_I2C + 1); + +int board_has_side_volume_buttons(void) +{ + return get_model() == PAZQUEL360; +} +__override int mkbp_support_volume_buttons(void) +{ + return board_has_side_volume_buttons(); +} diff --git a/board/pazquel/board.h b/board/pazquel/board.h index 5e2f1db49f..782d3a2ccc 100644 --- a/board/pazquel/board.h +++ b/board/pazquel/board.h @@ -37,9 +37,6 @@ #define USB_PORT_COUNT 1 #define CONFIG_USB_PORT_POWER_DUMB -/* No side volume button */ -#undef CONFIG_VOLUME_BUTTONS - /* Sensors */ #define CONFIG_DYNAMIC_MOTION_SENSOR_COUNT /* BMI323 Base accel/gyro */ @@ -72,6 +69,8 @@ #define DA9313_PVC_CTRL_PVC_MODE BIT(1) #define DA9313_PVC_CTRL_PVC_EN BIT(0) +/* Button Config*/ +#define CONFIG_BUTTONS_RUNTIME_CONFIG #ifndef __ASSEMBLER__ #include "gpio_signal.h" @@ -98,6 +97,7 @@ enum battery_type { void board_reset_pd_mcu(void); void board_set_tcpc_power_mode(int port, int mode); int board_is_clamshell(void); +int board_has_side_volume_buttons(void); #endif /* !defined(__ASSEMBLER__) */ diff --git a/board/pazquel/gpio.inc b/board/pazquel/gpio.inc index a698422169..4d1cc57b36 100644 --- a/board/pazquel/gpio.inc +++ b/board/pazquel/gpio.inc @@ -21,6 +21,8 @@ GPIO_INT(USB_A0_OC_ODL, PIN(D, 1), GPIO_INT_BOTH | GPIO_PULL_UP, usba_oc_ GPIO_INT(CHG_ACOK_OD, PIN(0, 0), GPIO_INT_BOTH, extpower_interrupt) /* ACOK */ GPIO_INT(CCD_MODE_ODL, PIN(E, 3), GPIO_INT_FALLING, board_connect_c0_sbu) /* Case Closed Debug Mode */ GPIO_INT(EC_PWR_BTN_ODL, PIN(0, 1), GPIO_INT_BOTH, power_button_interrupt) /* Power button */ +GPIO_INT(EC_VOLDN_BTN_ODL, PIN(7, 0), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) /* Volume Down button */ +GPIO_INT(EC_VOLUP_BTN_ODL, PIN(F, 2), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) /* Volume Up button */ GPIO_INT(EC_WP_ODL, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) /* Write protection */ GPIO_INT(LID_OPEN_EC, PIN(D, 2), GPIO_INT_BOTH, lid_interrupt) /* Lid open */ GPIO_INT(AP_RST_L, PIN(C, 1), GPIO_INT_BOTH | GPIO_SEL_1P8V, chipset_ap_rst_interrupt) /* PMIC to signal AP reset */ @@ -157,8 +159,6 @@ UNUSED(PIN(8, 3)) UNUSED(PIN(B, 1)) UNUSED(PIN(5, 0)) UNUSED(PIN(D, 3)) -UNUSED(PIN(7, 0)) -UNUSED(PIN(F, 2)) /* Alternate functions GPIO definitions */ ALTERNATE(PIN_MASK(6, 0x30), 0, MODULE_UART, 0) /* UART (GPIO64/65) */ |