diff --git a/src/ec/dell/mec5035/mec5035.c b/src/ec/dell/mec5035/mec5035.c index dffbb7960c..17ac2c1dab 100644 --- a/src/ec/dell/mec5035/mec5035.c +++ b/src/ec/dell/mec5035/mec5035.c @@ -94,6 +94,13 @@ void mec5035_control_radio(enum ec_radio_dev dev, enum ec_radio_state state) ec_command(CMD_RADIO_CTRL); } +static void mec5035_power_button_route(enum ec_power_button_route target) +{ + u8 buf = (u8)target; + write_mailbox_regs(&buf, 2, 1); + ec_command(CMD_POWER_BUTTON_TO_HOST); +} + void mec5035_early_init(void) { /* If this isn't sent the EC shuts down the system after about 15 @@ -107,6 +114,7 @@ static void mec5035_init(struct device *dev) /* Unconditionally use this argument for now as this setting is probably the most sensible default out of the 3 choices. */ mec5035_mouse_touchpad(TP_PS2_MOUSE); + mec5035_power_button_route(HOST); pc_keyboard_init(NO_AUX_DEVICE); diff --git a/src/ec/dell/mec5035/mec5035.h b/src/ec/dell/mec5035/mec5035.h index 32f791cb01..5fdf56631b 100644 --- a/src/ec/dell/mec5035/mec5035.h +++ b/src/ec/dell/mec5035/mec5035.h @@ -10,6 +10,7 @@ enum mec5035_cmd { CMD_MOUSE_TP = 0x1a, CMD_RADIO_CTRL = 0x2b, + CMD_POWER_BUTTON_TO_HOST = 0x3e, CMD_CPU_OK = 0xc2, }; @@ -33,6 +34,11 @@ enum ec_radio_state { RADIO_ON }; +enum ec_power_button_route { + EC = 0, + HOST +}; + u8 mec5035_mouse_touchpad(enum ec_mouse_setting setting); void mec5035_cpu_ok(void); void mec5035_early_init(void);