coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ec.c File Reference
#include <arch/io.h>
#include <console/console.h>
#include <device/device.h>
#include <device/pnp.h>
#include <delay.h>
#include <elog.h>
#include <pc80/keyboard.h>
#include "ec.h"
#include "chip.h"
Include dependency graph for ec.c:

Go to the source code of this file.

Functions

static int ec_input_buffer_empty (u8 status_port)
 
static int ec_output_buffer_full (u8 status_port)
 
u8 ec_kbc_read_ob (void)
 
void ec_kbc_write_cmd (u8 cmd)
 
void ec_kbc_write_ib (u8 data)
 
u8 ec_read_ob (void)
 
void ec_write_cmd (u8 cmd)
 
void ec_write_ib (u8 data)
 
u8 ec_mem_read (u8 addr)
 
void ec_mem_write (u8 addr, u8 data)
 
static void ene_kb3940q_log_events (void)
 
static void ene_kb3940q_init (struct device *dev)
 
static void enable_dev (struct device *dev)
 

Variables

static struct device_operations ops
 
static struct pnp_info pnp_dev_info []
 
struct chip_operations ec_quanta_ene_kb3940q_ops
 

Function Documentation

◆ ec_input_buffer_empty()

static int ec_input_buffer_empty ( u8  status_port)
static

Definition at line 15 of file ec.c.

References BIOS_WARNING, inb(), KBC_TIMEOUT_IN_MS, KBD_IBF, mdelay(), and printk.

Referenced by ec_kbc_write_cmd(), ec_kbc_write_ib(), ec_write_cmd(), and ec_write_ib().

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

◆ ec_kbc_read_ob()

u8 ec_kbc_read_ob ( void  )

Definition at line 54 of file ec.c.

References ec_output_buffer_full(), inb(), KBD_DATA, and KBD_STATUS.

Here is the call graph for this function:

◆ ec_kbc_write_cmd()

void ec_kbc_write_cmd ( u8  cmd)

Definition at line 60 of file ec.c.

References ec_input_buffer_empty(), KBD_COMMAND, KBD_STATUS, and outb().

Here is the call graph for this function:

◆ ec_kbc_write_ib()

void ec_kbc_write_ib ( u8  data)

Definition at line 66 of file ec.c.

References ec_input_buffer_empty(), KBD_DATA, KBD_STATUS, and outb().

Here is the call graph for this function:

◆ ec_mem_read()

u8 ec_mem_read ( u8  addr)

Definition at line 94 of file ec.c.

References addr, EC_CMD_READ_RAM, ec_read_ob(), ec_write_cmd(), and ec_write_ib().

Referenced by butterfly_ec_init(), ene_kb3940q_log_events(), get_lid_switch(), and mainboard_smi_sleep().

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

◆ ec_mem_write()

void ec_mem_write ( u8  addr,
u8  data 
)

Definition at line 101 of file ec.c.

References addr, EC_CMD_WRITE_RAM, ec_write_cmd(), and ec_write_ib().

Referenced by butterfly_ec_init(), mainboard_smi_sleep(), and program_keyboard_type().

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

◆ ec_output_buffer_full()

static int ec_output_buffer_full ( u8  status_port)
static

Definition at line 29 of file ec.c.

References BIOS_INFO, inb(), KBC_TIMEOUT_IN_MS, KBD_OBF, mdelay(), and printk.

Referenced by ec_kbc_read_ob(), and ec_read_ob().

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

◆ ec_read_ob()

u8 ec_read_ob ( void  )

Definition at line 73 of file ec.c.

References EC_DATA, ec_output_buffer_full(), EC_SC, and inb().

Referenced by ec_it8518_get_event(), ec_mem_read(), and ec_read().

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

◆ ec_write_cmd()

void ec_write_cmd ( u8  cmd)

Definition at line 79 of file ec.c.

References EC_COMMAND, ec_input_buffer_empty(), EC_SC, and outb().

Referenced by early_ec_init(), ec_it8518_get_event(), ec_mem_read(), ec_mem_write(), ec_read(), ec_write(), mainboard_smi_apmc(), and mainboard_suspend_resume().

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

◆ ec_write_ib()

void ec_write_ib ( u8  data)

Definition at line 85 of file ec.c.

References EC_DATA, ec_input_buffer_empty(), EC_SC, and outb().

Referenced by ec_mem_read(), ec_mem_write(), ec_read(), and ec_write().

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

◆ enable_dev()

static void enable_dev ( struct device dev)
static

Definition at line 138 of file ec.c.

◆ ene_kb3940q_init()

static void ene_kb3940q_init ( struct device dev)
static

Definition at line 117 of file ec.c.

References BIOS_DEBUG, device::enabled, ene_kb3940q_log_events(), NO_AUX_DEVICE, pc_keyboard_init(), and printk.

Here is the call graph for this function:

◆ ene_kb3940q_log_events()

static void ene_kb3940q_log_events ( void  )
static

Definition at line 108 of file ec.c.

References CONFIG, ec_mem_read(), EC_SHUTDOWN_REASON, elog_add_event_byte(), and ELOG_TYPE_EC_SHUTDOWN.

Referenced by ene_kb3940q_init().

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

Variable Documentation

◆ ec_quanta_ene_kb3940q_ops

struct chip_operations ec_quanta_ene_kb3940q_ops
Initial value:
= {
.enable_dev = enable_dev
}
static void enable_dev(struct device *dev)
Definition: ec.c:138

Definition at line 138 of file ec.c.

◆ ops

struct device_operations ops
static
Initial value:
= {
.read_resources = noop_read_resources,
.set_resources = noop_set_resources,
}
static void ene_kb3940q_init(struct device *dev)
Definition: ec.c:117
static void noop_read_resources(struct device *dev)
Standard device operations function pointers shims.
Definition: device.h:73
static void noop_set_resources(struct device *dev)
Definition: device.h:74

Definition at line 117 of file ec.c.

◆ pnp_dev_info

struct pnp_info pnp_dev_info[]
static
Initial value:
= {
{ NULL, 0, 0, 0, }
}
#define NULL
Definition: stddef.h:19

Definition at line 117 of file ec.c.