void mainboard_smi_sleep(u8 slp_typ) { printk(BIOS_DEBUG, "mainboard_smi_sleep: %x\n", slp_typ); /* Tell the EC to Enable USB power for S3 if requested */ if (smm_get_gnvs()->s3u0 != 0 || smm_get_gnvs()->s3u1 != 0) ec_mem_write(EC_EC_PSW, ec_mem_read(EC_EC_PSW) | EC_PSW_USB); /* Disable wake on USB, LAN & RTC */ /* Enable Wake from Keyboard */ if ((slp_typ == 4) || (slp_typ == 5)) { printk(BIOS_DEBUG, "Disabling wake on RTC\n"); ec_mem_write(EC_EC_PSW, EC_PSW_IKB); } }
static void program_keyboard_type(u32 search_address, u32 search_length) { char key[] = "keyboard_layout"; char kbd_jpn[] = "xkb:jp::jpn"; unsigned int offset; char kbd_type = EC_KBD_EN; /* Default keyboard type is English */ if (search_length != -1) { /* * Search for keyboard_layout identifier * The only options in the EC are Japanese or English. * The English keyboard layout is actually used for multiple * different languages - English, Spanish, French... Because * of this the code only searches for Japanese, and sets the * keyboard type to English if Japanese is not found. */ offset = search(key, (char *)search_address, sizeof(key) - 1, search_length); if (offset != search_length) { printk(BIOS_DEBUG, "Located '%s' in VPD\n", key); offset += sizeof(key); /* move to next character */ search_length = sizeof(kbd_jpn); offset = search(kbd_jpn, (char *)(search_address + offset), sizeof(kbd_jpn) - 1, search_length); if (offset != search_length) kbd_type = EC_KBD_JP; } } else printk(BIOS_DEBUG, "Error: Could not locate VPD area\n"); printk(BIOS_DEBUG, "Setting Keyboard type in EC to "); printk(BIOS_DEBUG, (kbd_type == EC_KBD_JP) ? "Japanese" : "English"); printk(BIOS_DEBUG, ".\n"); ec_mem_write(EC_KBID_REG, kbd_type); }