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

Go to the source code of this file.

Macros

#define CHECK_PRESENCE(x)
 

Functions

struct busget_pbus_smbus (struct device *dev)
 
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)
 

Macro Definition Documentation

◆ CHECK_PRESENCE

#define CHECK_PRESENCE (   x)
Value:
if (!ops_smbus_bus(get_pbus_smbus(dev))->x) { \
printk(BIOS_ERR, "%s missing " #x "\n", \
dev_path(dev)); \
return -1; \
}
struct bus * get_pbus_smbus(struct device *dev)
Definition: smbus_ops.c:8
const char * dev_path(const struct device *dev)
Definition: device_util.c:149
static const struct smbus_bus_operations * ops_smbus_bus(struct bus *bus)
Definition: smbus.h:19
int x
Definition: edid.c:994
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition: loglevel.h:72

Definition at line 19 of file smbus_ops.c.

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:

◆ 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: