coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
acpigen_ps2_keybd.c File Reference
#include <acpi/acpigen.h>
#include <acpi/acpigen_ps2_keybd.h>
#include <console/console.h>
#include <input-event-codes.h>
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for acpigen_ps2_keybd.c:

Go to the source code of this file.

Macros

#define KEYMAP(scancode, keycode)   (((uint32_t)(scancode) << 16) | (keycode & 0xFFFF))
 
#define SCANCODE(keymap)   ((keymap >> 16) & 0xFFFF)
 

Functions

static void ssdt_generate_physmap (struct acpi_dp *dp, uint8_t num_top_row_keys, enum ps2_action_key action_keys[])
 
static void ssdt_generate_keymap (struct acpi_dp *dp, uint8_t num_top_row_keys, enum ps2_action_key action_keys[], bool can_send_function_keys, bool has_numeric_keypad, bool has_scrnlock_key)
 
void acpigen_ps2_keyboard_dsd (const char *scope, uint8_t num_top_row_keys, enum ps2_action_key action_keys[], bool can_send_function_keys, bool has_numeric_keypad, bool has_scrnlock_key)
 

Variables

static const uint32_t function_keymaps []
 
static const uint32_t action_keymaps []
 
static uint32_t numeric_keypad_keymaps []
 
static uint32_t rest_of_keymaps []
 

Macro Definition Documentation

◆ KEYMAP

#define KEYMAP (   scancode,
  keycode 
)    (((uint32_t)(scancode) << 16) | (keycode & 0xFFFF))

Definition at line 10 of file acpigen_ps2_keybd.c.

◆ SCANCODE

#define SCANCODE (   keymap)    ((keymap >> 16) & 0xFFFF)

Definition at line 11 of file acpigen_ps2_keybd.c.

Function Documentation

◆ acpigen_ps2_keyboard_dsd()

void acpigen_ps2_keyboard_dsd ( const char *  scope,
uint8_t  num_top_row_keys,
enum ps2_action_key  action_keys[],
bool  can_send_function_keys,
bool  has_numeric_keypad,
bool  has_scrnlock_key 
)

Definition at line 276 of file acpigen_ps2_keybd.c.

References acpi_dp_new_table(), acpi_dp_write(), acpigen_pop_len(), acpigen_write_scope(), BIOS_ERR, printk, PS2_MAX_TOP_ROW_KEYS, PS2_MIN_TOP_ROW_KEYS, ssdt_generate_keymap(), and ssdt_generate_physmap().

Referenced by fill_ssdt_ps2_keyboard().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssdt_generate_keymap()

static void ssdt_generate_keymap ( struct acpi_dp dp,
uint8_t  num_top_row_keys,
enum ps2_action_key  action_keys[],
bool  can_send_function_keys,
bool  has_numeric_keypad,
bool  has_scrnlock_key 
)
static

Definition at line 208 of file acpigen_ps2_keybd.c.

References acpi_dp_add_array(), acpi_dp_add_integer(), acpi_dp_new_table(), action_keymaps, ARRAY_SIZE, BIOS_ERR, BIOS_INFO, function_keymaps, KEY_SLEEP, KEYMAP, NULL, numeric_keypad_keymaps, printk, and rest_of_keymaps.

Referenced by acpigen_ps2_keyboard_dsd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssdt_generate_physmap()

static void ssdt_generate_physmap ( struct acpi_dp dp,
uint8_t  num_top_row_keys,
enum ps2_action_key  action_keys[] 
)
static

Definition at line 176 of file acpigen_ps2_keybd.c.

References acpi_dp_add_array(), acpi_dp_add_integer(), acpi_dp_new_table(), action_keymaps, ARRAY_SIZE, BIOS_ERR, BIOS_INFO, NULL, printk, and SCANCODE.

Referenced by acpigen_ps2_keyboard_dsd().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ action_keymaps

const uint32_t action_keymaps[]
static
Initial value:
= {
}
#define KEYMAP(scancode, keycode)
@ PS2_KEY_REFRESH
@ PS2_KEY_PRIVACY_SCRN_TOGGLE
@ PS2_KEY_KBD_BKLIGHT_TOGGLE
@ PS2_KEY_PREV_TRACK
@ PS2_KEY_SNAPSHOT
@ PS2_KEY_MICMUTE
@ PS2_KEY_VOL_MUTE
@ PS2_KEY_KBD_BKLIGHT_DOWN
@ PS2_KEY_OVERVIEW
@ PS2_KEY_VOL_UP
@ PS2_KEY_MENU
@ PS2_KEY_BRIGHTNESS_DOWN
@ PS2_KEY_KBD_BKLIGHT_UP
@ PS2_KEY_BACK
@ PS2_KEY_FORWARD
@ PS2_KEY_VOL_DOWN
@ PS2_KEY_FULLSCREEN
@ PS2_KEY_BRIGHTNESS_UP
@ PS2_KEY_PLAY_PAUSE
@ PS2_KEY_NEXT_TRACK
#define KEY_BRIGHTNESSDOWN
#define KEY_KBDILLUMDOWN
#define KEY_PLAYPAUSE
#define KEY_SYSRQ
#define KEY_MUTE
#define KEY_PRIVACY_SCREEN_TOGGLE
#define KEY_SCALE
#define KEY_FORWARD
#define KEY_REFRESH
#define KEY_BRIGHTNESSUP
#define KEY_NEXTSONG
#define KEY_CONTROLPANEL
#define KEY_VOLUMEDOWN
#define KEY_MICMUTE
#define KEY_FULL_SCREEN
#define KEY_KBDILLUMUP
#define KEY_BACK
#define KEY_PREVIOUSSONG
#define KEY_VOLUMEUP
#define KEY_KBDILLUMTOGGLE

Definition at line 37 of file acpigen_ps2_keybd.c.

Referenced by ssdt_generate_keymap(), and ssdt_generate_physmap().

◆ function_keymaps

const uint32_t function_keymaps[]
static
Initial value:
= {
KEYMAP(0x3b, KEY_F1),
KEYMAP(0x3c, KEY_F2),
KEYMAP(0x3d, KEY_F3),
KEYMAP(0x3e, KEY_F4),
KEYMAP(0x3f, KEY_F5),
KEYMAP(0x40, KEY_F6),
KEYMAP(0x41, KEY_F7),
KEYMAP(0x42, KEY_F8),
KEYMAP(0x43, KEY_F9),
KEYMAP(0x44, KEY_F10),
KEYMAP(0x57, KEY_F11),
KEYMAP(0x58, KEY_F12),
KEYMAP(0x59, KEY_F13),
KEYMAP(0x5a, KEY_F14),
KEYMAP(0x5b, KEY_F15),
}
#define KEY_F12
#define KEY_F1
#define KEY_F5
#define KEY_F3
#define KEY_F9
#define KEY_F15
#define KEY_F8
#define KEY_F7
#define KEY_F4
#define KEY_F11
#define KEY_F6
#define KEY_F10
#define KEY_F14
#define KEY_F2
#define KEY_F13

Definition at line 14 of file acpigen_ps2_keybd.c.

Referenced by ssdt_generate_keymap().

◆ numeric_keypad_keymaps

uint32_t numeric_keypad_keymaps[]
static
Initial value:
= {
KEYMAP(0xc7, KEY_HOME),
KEYMAP(0xcf, KEY_END),
KEYMAP(0x47, KEY_KP7),
KEYMAP(0x48, KEY_KP8),
KEYMAP(0x49, KEY_KP9),
KEYMAP(0x4b, KEY_KP4),
KEYMAP(0x4c, KEY_KP5),
KEYMAP(0x4d, KEY_KP6),
KEYMAP(0x4f, KEY_KP1),
KEYMAP(0x50, KEY_KP2),
KEYMAP(0x51, KEY_KP3),
KEYMAP(0x52, KEY_KP0),
KEYMAP(0x53, KEY_KPDOT),
}
#define KEY_PAGEDOWN
#define KEY_KP1
#define KEY_KP4
#define KEY_KP6
#define KEY_DELETE
#define KEY_KPENTER
#define KEY_KPDOT
#define KEY_KP5
#define KEY_KP3
#define KEY_KPMINUS
#define KEY_KP7
#define KEY_END
#define KEY_KP0
#define KEY_KP8
#define KEY_KPASTERISK
#define KEY_KPPLUS
#define KEY_KP2
#define KEY_KP9
#define KEY_PAGEUP
#define KEY_KPSLASH
#define KEY_HOME

Definition at line 62 of file acpigen_ps2_keybd.c.

Referenced by ssdt_generate_keymap().

◆ rest_of_keymaps

uint32_t rest_of_keymaps[]
static

Definition at line 96 of file acpigen_ps2_keybd.c.

Referenced by ssdt_generate_keymap().