coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smbus.h File Reference
#include <stdint.h>
#include <device/device.h>
#include <device/i2c_bus.h>
Include dependency graph for smbus.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  smbus_bus_operations
 

Functions

static const struct smbus_bus_operationsops_smbus_bus (struct bus *bus)
 
struct busget_pbus_smbus (struct device *dev)
 
static int smbus_recv_byte (struct device *const dev)
 
static int smbus_send_byte (struct device *const dev, u8 byte)
 
static int smbus_read_byte (struct device *const dev, u8 addr)
 
static int smbus_write_byte (struct device *const dev, u8 addr, u8 val)
 
int smbus_block_read (struct device *dev, u8 cmd, u8 bytes, u8 *buffer)
 
int smbus_block_write (struct device *dev, u8 cmd, u8 bytes, const u8 *buffer)
 

Function Documentation

◆ get_pbus_smbus()

struct bus* get_pbus_smbus ( struct device dev)

Definition at line 8 of file smbus_ops.c.

References BIOS_ALERT, bus::dev, dev_path(), die(), i2c_link(), device::ops, device_operations::ops_smbus_bus, and printk.

Referenced by lsmbus_block_write(), lsmbus_read_byte(), lsmbus_recv_byte(), lsmbus_send_byte(), lsmbus_write_byte(), rtd2132_init(), smbus_block_read(), smbus_block_write(), and tas5825m_init().

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

◆ ops_smbus_bus()

static const struct smbus_bus_operations* ops_smbus_bus ( struct bus bus)
inlinestatic

Definition at line 19 of file smbus.h.

References bus::dev, device::ops, and device_operations::ops_smbus_bus.

Referenced by rtd2132_init(), smbus_block_read(), smbus_block_write(), and tas5825m_init().

Here is the caller graph for this function:

◆ smbus_block_read()

int smbus_block_read ( struct device dev,
u8  cmd,
u8  bytes,
u8 buffer 
)

Definition at line 26 of file smbus_ops.c.

References smbus_bus_operations::block_read, buffer, CHECK_PRESENCE, bus::dev, get_pbus_smbus(), and ops_smbus_bus().

Referenced by ck505_init(), and set_fsb_frequency().

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

◆ smbus_block_write()

int smbus_block_write ( struct device dev,
u8  cmd,
u8  bytes,
const u8 buffer 
)

Definition at line 34 of file smbus_ops.c.

References smbus_bus_operations::block_write, buffer, CHECK_PRESENCE, bus::dev, get_pbus_smbus(), and ops_smbus_bus().

Referenced by ck505_init(), and set_fsb_frequency().

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

◆ smbus_read_byte()

◆ smbus_recv_byte()

static int smbus_recv_byte ( struct device *const  dev)
inlinestatic

Definition at line 33 of file smbus.h.

References bus::dev, and i2c_dev_readb().

Here is the call graph for this function:

◆ smbus_send_byte()

static int smbus_send_byte ( struct device *const  dev,
u8  byte 
)
inlinestatic

Definition at line 38 of file smbus.h.

References bus::dev, and i2c_dev_writeb().

Here is the call graph for this function:

◆ smbus_write_byte()

static int smbus_write_byte ( struct device *const  dev,
u8  addr,
u8  val 
)
inlinestatic

Definition at line 48 of file smbus.h.

References addr, bus::dev, i2c_dev_writeb_at(), and val.

Referenced by at24rf08c_init(), get_spd(), pcf8523_init(), pcf8523_set_build_date(), pcf8523_set_user_date(), rtd2132_firmware_start(), rtd2132_firmware_stop(), rtd2132_write_reg(), tas5825m_write_at(), and tas5825m_write_block_at().

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