coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ec_i2c.c File Reference
#include <console/console.h>
#include <device/i2c_simple.h>
#include <stdint.h>
#include <string.h>
#include "ec.h"
#include "ec_commands.h"
Include dependency graph for ec_i2c.c:

Go to the source code of this file.

Data Structures

struct  EcCommandI2c
 
struct  EcResponseI2c
 

Macros

#define MAX_I2C_DATA_SIZE   (0xff)
 

Functions

static void i2c_dump (int bus, int chip, const uint8_t *data, size_t size)
 
static int ec_verify_checksum (const EcResponseI2c *resp)
 
static void ec_fill_checksum (EcCommandI2c *cmd)
 
int google_chromeec_command (struct chromeec_command *cec_command)
 Send a command to a CrOS EC. More...
 
enum host_event_code google_chromeec_get_event (void)
 

Macro Definition Documentation

◆ MAX_I2C_DATA_SIZE

#define MAX_I2C_DATA_SIZE   (0xff)

Definition at line 128 of file ec_i2c.c.

Function Documentation

◆ ec_fill_checksum()

static void ec_fill_checksum ( EcCommandI2c cmd)
static

Definition at line 169 of file ec_i2c.c.

References EcCommandI2c::data, google_chromeec_calc_checksum(), and EcCommandI2c::length.

Referenced by google_chromeec_command().

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

◆ ec_verify_checksum()

static int ec_verify_checksum ( const EcResponseI2c resp)
static

Definition at line 155 of file ec_i2c.c.

References BIOS_ERR, EcResponseI2c::data, google_chromeec_calc_checksum(), EcResponseI2c::length, and printk.

Referenced by google_chromeec_command().

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

◆ google_chromeec_command()

int google_chromeec_command ( struct chromeec_command cec_command)

Send a command to a CrOS EC.

Parameters
cec_commandCrOS EC command to send
Returns
0 for success. Non-zero for error.

Definition at line 176 of file ec_i2c.c.

◆ google_chromeec_get_event()

enum host_event_code google_chromeec_get_event ( void  )

Definition at line 176 of file ec_i2c.c.

◆ i2c_dump()

static void i2c_dump ( int  bus,
int  chip,
const uint8_t data,
size_t  size 
)
inlinestatic

Definition at line 143 of file ec_i2c.c.

References BIOS_INFO, chip, and printk.

Referenced by google_chromeec_command().

Here is the caller graph for this function: