Skip to content

Commit 38f68cf

Browse files
authored
azalea: remove keyboard workaround (#873)
Signed-off-by: LeoCX_Tsai <[email protected]>
1 parent 1c0acf5 commit 38f68cf

File tree

1 file changed

+0
-46
lines changed

1 file changed

+0
-46
lines changed

zephyr/program/lotus/azalea/src/power_sequence.c

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -301,47 +301,6 @@ static int chipset_prepare_S3(uint8_t enable)
301301
return true;
302302
}
303303

304-
/*
305-
* Issue : 866a60d67
306-
* for this issue, if into S3 and resume back by keyboard, system would not wake
307-
* because scan code was send before espi_rst, at the moment system would not
308-
* take any scan code, co-work with BIOS when Keyboard event send,
309-
* do this workaround to send a scan code again
310-
*/
311-
static void key_stuck_wa(void);
312-
DECLARE_DEFERRED(key_stuck_wa);
313-
static void key_stuck_wa(void)
314-
{
315-
int wa_bit = *host_get_memmap(EC_CUSTOMIZED_MEMMAP_DISPLAY_ON);
316-
317-
if (wa_bit) {
318-
*host_get_memmap(EC_CUSTOMIZED_MEMMAP_DISPLAY_ON) = 0;
319-
hook_call_deferred(&key_stuck_wa_data, -1);
320-
simulate_keyboard(SCANCODE_UNASSIGNED, 1);
321-
simulate_keyboard(SCANCODE_UNASSIGNED, 0);
322-
} else
323-
hook_call_deferred(&key_stuck_wa_data, 10 * MSEC);
324-
325-
}
326-
327-
/*
328-
* Issue : 866ajywad
329-
* for this issue, if into S3 and resume back by power button,
330-
* system would not take Keybuffer(DBBOUT) after EC send IRQ1,
331-
* add this workaround EC manually send Keybuffer and clearn OBF flag,
332-
* it will regenerate a IRQ signal to notice system.
333-
*/
334-
static void key_stuck_ptn(void)
335-
{
336-
*host_get_memmap(EC_CUSTOMIZED_MEMMAP_DISPLAY_ON) = 0;
337-
simulate_keyboard(SCANCODE_UNASSIGNED, 1);
338-
simulate_keyboard(SCANCODE_UNASSIGNED, 0);
339-
keyboard_clear_buffer();
340-
/* stop key_stuck_wa if system already wake */
341-
hook_call_deferred(&key_stuck_wa_data, -1);
342-
}
343-
DECLARE_DEFERRED(key_stuck_ptn);
344-
345304
enum power_state power_handle_state(enum power_state state)
346305
{
347306
switch (state) {
@@ -525,17 +484,13 @@ enum power_state power_handle_state(enum power_state state)
525484

526485
case POWER_S0ixS3:
527486
CPRINTS("PH S0ixS3");
528-
/* make sure next time wake flag not error trigger */
529-
*host_get_memmap(EC_CUSTOMIZED_MEMMAP_DISPLAY_ON) = 0;
530-
hook_call_deferred(&key_stuck_wa_data, -1);
531487
/* follow power sequence Disable S3 power */
532488
chipset_prepare_S3(0);
533489
CPRINTS("PH S0ixS0->S3");
534490
return POWER_S3;
535491

536492
case POWER_S3S0ix:
537493
CPRINTS("PH S3->S0ix");
538-
hook_call_deferred(&key_stuck_wa_data, 1);
539494
/* Enable power for CPU check system */
540495
chipset_prepare_S3(1);
541496
CPRINTS("PH S3S0ix->S0ix");
@@ -545,7 +500,6 @@ enum power_state power_handle_state(enum power_state state)
545500
CPRINTS("PH S0ixS0");
546501
resume_ms_flag = 0;
547502
system_in_s0ix = 0;
548-
hook_call_deferred(&key_stuck_ptn_data, 100 * MSEC);
549503
lpc_s0ix_resume_restore_masks();
550504
/* Call hooks now that rails are up */
551505
hook_notify(HOOK_CHIPSET_RESUME);

0 commit comments

Comments
 (0)