coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
i2c_bus.c File Reference
#include <stdint.h>
#include <console/console.h>
#include <device/smbus.h>
#include <device/i2c_bus.h>
#include <commonlib/endian.h>
Include dependency graph for i2c_bus.c:

Go to the source code of this file.

Functions

struct busi2c_link (const struct device *const dev)
 
int i2c_dev_readb (struct device *const dev)
 
int i2c_dev_writeb (struct device *const dev, uint8_t val)
 
int i2c_dev_readb_at (struct device *const dev, uint8_t off)
 
int i2c_dev_writeb_at (struct device *const dev, const uint8_t off, const uint8_t val)
 
int i2c_dev_read_at16 (struct device *const dev, uint8_t *const buf, const size_t len, uint16_t off)
 

Function Documentation

◆ i2c_dev_read_at16()

int i2c_dev_read_at16 ( struct device *const  dev,
uint8_t *const  buf,
const size_t  len,
uint16_t  off 
)

Definition at line 144 of file i2c_bus.c.

References ARRAY_SIZE, BIOS_ERR, buf, dev_path(), i2c_path::device, i2c_msg::flags, device_path::i2c, i2c_busdev(), I2C_M_RD, i2c_msg::len, device::ops, device_operations::ops_i2c_bus, device::path, printk, i2c_bus_operations::transfer, and write_be16().

Referenced by eeprom_read_string().

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

◆ i2c_dev_readb()

int i2c_dev_readb ( struct device *const  dev)

Definition at line 34 of file i2c_bus.c.

References BIOS_ERR, dev_path(), i2c_path::device, i2c_msg::flags, device_path::i2c, i2c_busdev(), I2C_M_RD, device::ops, device_operations::ops_i2c_bus, device_operations::ops_smbus_bus, device::path, printk, smbus_bus_operations::recv_byte, i2c_bus_operations::transfer, and val.

Referenced by smbus_recv_byte().

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

◆ i2c_dev_readb_at()

◆ i2c_dev_writeb()

int i2c_dev_writeb ( struct device *const  dev,
uint8_t  val 
)

Definition at line 62 of file i2c_bus.c.

References BIOS_ERR, dev_path(), i2c_path::device, i2c_msg::flags, device_path::i2c, i2c_busdev(), device::ops, device_operations::ops_i2c_bus, device_operations::ops_smbus_bus, device::path, printk, smbus_bus_operations::send_byte, i2c_bus_operations::transfer, and val.

Referenced by smbus_send_byte().

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

◆ i2c_dev_writeb_at()

◆ i2c_link()

struct bus* i2c_link ( const struct device *const  dev)

Definition at line 9 of file i2c_bus.c.

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

Referenced by get_pbus_smbus(), and i2c_busdev().

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