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

Go to the source code of this file.

Data Structures

struct  i2c_bus_operations
 

Functions

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

Function Documentation

◆ i2c_busdev()

static DEVTREE_CONST struct device* i2c_busdev ( const struct device dev)
inlinestatic

Definition at line 31 of file i2c_bus.h.

References bus::dev, i2c_link(), and NULL.

Referenced by i2c_dev_read_at16(), i2c_dev_readb(), i2c_dev_readb_at(), i2c_dev_writeb(), and i2c_dev_writeb_at().

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

◆ i2c_dev_read_at16()

int i2c_dev_read_at16 ( struct device dev,
uint8_t buf,
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 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 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 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: