coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ec_acpi.c File Reference
#include <acpi/acpi.h>
#include <acpi/acpi_device.h>
#include <acpi/acpi_pld.h>
#include <acpi/acpigen.h>
#include <acpi/acpigen_ps2_keybd.h>
#include <acpi/acpigen_usb.h>
#include <console/console.h>
#include <drivers/usb/acpi/chip.h>
#include <drivers/intel/usb4/retimer/retimer.h>
#include <ec/google/common/dptf.h>
#include "chip.h"
#include "ec.h"
#include "ec_commands.h"
Include dependency graph for ec_acpi.c:

Go to the source code of this file.

Macros

#define GOOGLE_CHROMEEC_USBC_DEVICE_HID   "GOOG0014"
 
#define GOOGLE_CHROMEEC_USBC_DEVICE_NAME   "USBC"
 

Functions

const char * google_chromeec_acpi_name (const struct device *dev)
 
static void get_usb_port_references (int port_number, struct device **usb2_port, struct device **usb3_port, struct device **usb4_port)
 
static const char * port_location_to_str (enum ec_pd_port_location port_location)
 
static void add_port_location (struct acpi_dp *dsd, int port_number)
 
static void get_pld_from_usb_ports (struct acpi_pld *pld, struct device *usb2_port, struct device *usb3_port, struct device *usb4_port)
 
static void fill_ssdt_typec_device (const struct device *dev)
 
static void fill_ssdt_ps2_keyboard (const struct device *dev)
 
static const char * ec_acpi_name (const struct device *dev)
 
void google_chromeec_fill_ssdt_generator (const struct device *dev)
 
const char * ec_retimer_fw_update_path (void)
 
void ec_retimer_fw_update (uint8_t data)
 

Variables

static struct usb_pd_port_caps port_caps
 
static enum ps2_action_key ps2_enum_val []
 
static struct device_operations ec_ops
 

Macro Definition Documentation

◆ GOOGLE_CHROMEEC_USBC_DEVICE_HID

#define GOOGLE_CHROMEEC_USBC_DEVICE_HID   "GOOG0014"

Definition at line 18 of file ec_acpi.c.

◆ GOOGLE_CHROMEEC_USBC_DEVICE_NAME

#define GOOGLE_CHROMEEC_USBC_DEVICE_NAME   "USBC"

Definition at line 19 of file ec_acpi.c.

Function Documentation

◆ add_port_location()

static void add_port_location ( struct acpi_dp dsd,
int  port_number 
)
static

Definition at line 122 of file ec_acpi.c.

References acpi_dp_add_string(), port_caps, usb_pd_port_caps::port_location, and port_location_to_str().

Referenced by fill_ssdt_typec_device().

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

◆ ec_acpi_name()

static const char* ec_acpi_name ( const struct device dev)
static

Definition at line 256 of file ec_acpi.c.

◆ ec_retimer_fw_update()

void ec_retimer_fw_update ( uint8_t  data)

Definition at line 289 of file ec_acpi.c.

References acpigen_emit_namestring(), acpigen_write_byte(), acpigen_write_store(), and ec_retimer_fw_update_path().

Here is the call graph for this function:

◆ ec_retimer_fw_update_path()

const char* ec_retimer_fw_update_path ( void  )

Definition at line 284 of file ec_acpi.c.

Referenced by ec_retimer_fw_update().

Here is the caller graph for this function:

◆ fill_ssdt_ps2_keyboard()

static void fill_ssdt_ps2_keyboard ( const struct device dev)
static

◆ fill_ssdt_typec_device()

◆ get_pld_from_usb_ports()

static void get_pld_from_usb_ports ( struct acpi_pld pld,
struct device usb2_port,
struct device usb3_port,
struct device usb4_port 
)
static

Definition at line 127 of file ec_acpi.c.

References acpi_pld_fill_usb(), device::chip_info, config, and NULL.

Referenced by fill_ssdt_typec_device().

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

◆ get_usb_port_references()

static void get_usb_port_references ( int  port_number,
struct device **  usb2_port,
struct device **  usb3_port,
struct device **  usb4_port 
)
static

Definition at line 40 of file ec_acpi.c.

References config, dev_find_path(), DEVICE_PATH_USB, NULL, UPC_TYPE_C_USB2_ONLY, UPC_TYPE_C_USB2_SS, and UPC_TYPE_C_USB2_SS_SWITCH.

Referenced by fill_ssdt_typec_device().

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

◆ google_chromeec_acpi_name()

const char* google_chromeec_acpi_name ( const struct device dev)

Definition at line 21 of file ec_acpi.c.

◆ google_chromeec_fill_ssdt_generator()

void google_chromeec_fill_ssdt_generator ( const struct device dev)

◆ port_location_to_str()

static const char* port_location_to_str ( enum ec_pd_port_location  port_location)
static

Definition at line 91 of file ec_acpi.c.

Referenced by add_port_location().

Here is the caller graph for this function:

Variable Documentation

◆ ec_ops

struct device_operations ec_ops
static
Initial value:
= {
.acpi_name = ec_acpi_name,
}
static const char * ec_acpi_name(const struct device *dev)
Definition: ec_acpi.c:256

Definition at line 256 of file ec_acpi.c.

Referenced by google_chromeec_fill_ssdt_generator().

◆ port_caps

struct usb_pd_port_caps port_caps
static

◆ ps2_enum_val

enum ps2_action_key ps2_enum_val[]
static
Initial value:
= {
}
@ 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_ABSENT
@ PS2_KEY_FULLSCREEN
@ PS2_KEY_BRIGHTNESS_UP
@ PS2_KEY_PLAY_PAUSE
@ PS2_KEY_NEXT_TRACK
@ TK_KBD_BKLIGHT_DOWN
Definition: ec_commands.h:6413
@ TK_PRIVACY_SCRN_TOGGLE
Definition: ec_commands.h:6412
@ TK_KBD_BKLIGHT_TOGGLE
Definition: ec_commands.h:6418
@ TK_VOL_UP
Definition: ec_commands.h:6410
@ TK_MICMUTE
Definition: ec_commands.h:6419
@ TK_VOL_MUTE
Definition: ec_commands.h:6408
@ TK_REFRESH
Definition: ec_commands.h:6403
@ TK_BRIGHTNESS_UP
Definition: ec_commands.h:6407
@ TK_PLAY_PAUSE
Definition: ec_commands.h:6415
@ TK_NEXT_TRACK
Definition: ec_commands.h:6416
@ TK_MENU
Definition: ec_commands.h:6420
@ TK_OVERVIEW
Definition: ec_commands.h:6405
@ TK_FORWARD
Definition: ec_commands.h:6402
@ TK_BACK
Definition: ec_commands.h:6401
@ TK_ABSENT
Definition: ec_commands.h:6400
@ TK_BRIGHTNESS_DOWN
Definition: ec_commands.h:6406
@ TK_SNAPSHOT
Definition: ec_commands.h:6411
@ TK_KBD_BKLIGHT_UP
Definition: ec_commands.h:6414
@ TK_VOL_DOWN
Definition: ec_commands.h:6409
@ TK_FULLSCREEN
Definition: ec_commands.h:6404
@ TK_PREV_TRACK
Definition: ec_commands.h:6417

Definition at line 148 of file ec_acpi.c.

Referenced by fill_ssdt_ps2_keyboard().