@@ -302,6 +302,11 @@ static void module_pwr_control_enable(bool state)
302302 gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_module_pwr_on ), 0 );
303303}
304304
305+ void me_gpio_change (uint32_t flags )
306+ {
307+ gpio_pin_configure_dt (GPIO_DT_FROM_NODELABEL (gpio_me_en ), flags );
308+ }
309+
305310enum power_state power_handle_state (enum power_state state )
306311{
307312 switch (state ) {
@@ -320,10 +325,10 @@ enum power_state power_handle_state(enum power_state state)
320325 return POWER_G3 ;
321326 }
322327
323- gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_me_en ), !!(me_change & ME_UNLOCK ));
324-
325328 k_msleep (10 );
326329 gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_ec_soc_rsmrst_l ), 1 );
330+ me_gpio_change (me_change & ME_UNLOCK ? GPIO_OUTPUT_HIGH : GPIO_OUTPUT_LOW );
331+
327332 if (extpower_is_present ())
328333 gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_ac_present ), 1 );
329334
@@ -407,6 +412,7 @@ enum power_state power_handle_state(enum power_state state)
407412
408413 gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_pch_pwrok_ls ), 1 );
409414 k_msleep (10 );
415+ me_gpio_change (GPIO_INPUT );
410416 gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_sys_pwrok_ls ), 1 );
411417
412418 /* Call hooks now that rails are up */
@@ -473,11 +479,10 @@ enum power_state power_handle_state(enum power_state state)
473479 case POWER_S0S3 :
474480 k_msleep (5 );
475481 gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_susp_l ), 0 );
482+ me_gpio_change (GPIO_OUTPUT_LOW );
476483 gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_pch_pwrok_ls ), 0 );
477484 gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_sys_pwrok_ls ), 0 );
478485
479- gpio_pin_set_dt (GPIO_DT_FROM_NODELABEL (gpio_me_en ), 0 );
480-
481486 lpc_s0ix_suspend_clear_masks ();
482487 /* Call hooks before we remove power rails */
483488 hook_notify (HOOK_CHIPSET_SUSPEND );
0 commit comments