#include <stdint.h>
#include <console/console.h>
#include <device/device.h>
#include <device/i2c_bus.h>
#include <timer.h>
#include <delay.h>
#include "chip.h"
#include "kempld.h"
#include "kempld_internal.h"
Go to the source code of this file.
◆ EAGAIN
◆ EBUSY
◆ EIO
◆ ENXIO
◆ ETIMEDOUT
◆ I2C_CMD_IACK
#define I2C_CMD_IACK 0x01 |
◆ I2C_CMD_READ
#define I2C_CMD_READ 0x21 |
◆ I2C_CMD_READ_ACK
#define I2C_CMD_READ_ACK 0x21 |
◆ I2C_CMD_READ_NACK
#define I2C_CMD_READ_NACK 0x29 |
◆ I2C_CMD_START
#define I2C_CMD_START 0x91 |
◆ I2C_CMD_STOP
#define I2C_CMD_STOP 0x41 |
◆ I2C_CMD_WRITE
#define I2C_CMD_WRITE 0x11 |
◆ I2C_CTRL_EN
◆ I2C_CTRL_IEN
#define I2C_CTRL_IEN 0x40 |
◆ I2C_STAT_ARBLOST
#define I2C_STAT_ARBLOST 0x20 |
◆ I2C_STAT_BUSY
#define I2C_STAT_BUSY 0x40 |
◆ I2C_STAT_IF
◆ I2C_STAT_NACK
#define I2C_STAT_NACK 0x80 |
◆ I2C_STAT_TIP
#define I2C_STAT_TIP 0x02 |
◆ KEMPLD_I2C_CMD
#define KEMPLD_I2C_CMD 0x0f |
◆ KEMPLD_I2C_CTRL
#define KEMPLD_I2C_CTRL 0x0d |
◆ KEMPLD_I2C_DATA
#define KEMPLD_I2C_DATA 0x0e |
◆ KEMPLD_I2C_PREHIGH
#define KEMPLD_I2C_PREHIGH 0x0c |
◆ KEMPLD_I2C_PRELOW
#define KEMPLD_I2C_PRELOW 0x0b |
◆ KEMPLD_I2C_STAT
#define KEMPLD_I2C_STAT 0x0f |
◆ kempld_i2c_state
Enumerator |
---|
STATE_DONE | |
STATE_INIT | |
STATE_ADDR | |
STATE_ADDR10 | |
STATE_START | |
STATE_WRITE | |
STATE_READ | |
STATE_ERROR | |
Definition at line 50 of file kempld_i2c.c.
◆ kempld_i2c_device_init()
void kempld_i2c_device_init |
( |
struct device *const |
dev | ) |
|
Definition at line 228 of file kempld_i2c.c.
References BIOS_INFO, BIOS_NOTICE, device::chip_info, config, I2C_CMD_IACK, I2C_CMD_STOP, I2C_CTRL_EN, I2C_CTRL_IEN, I2C_STAT_BUSY, KEMPLD_CFG, KEMPLD_CFG_GPIO_I2C_MUX, KEMPLD_CLK, kempld_get_mutex(), KEMPLD_I2C_CMD, KEMPLD_I2C_CTRL, kempld_i2c_dev_ops, KEMPLD_I2C_FREQ_MAX, KEMPLD_I2C_FREQ_STANDARD_MODE_100KHZ, KEMPLD_I2C_PREHIGH, KEMPLD_I2C_PRELOW, KEMPLD_I2C_STAT, kempld_read8(), kempld_release_mutex(), KEMPLD_SPEC, KEMPLD_SPEC_GET_MAJOR, kempld_write8(), device::ops, and printk.
◆ kempld_i2c_process()
Definition at line 71 of file kempld_i2c.c.
References addr, i2c_msg::buf, EAGAIN, EBUSY, EIO, ENXIO, i2c_msg::flags, I2C_CMD_IACK, I2C_CMD_READ_ACK, I2C_CMD_READ_NACK, I2C_CMD_START, I2C_CMD_STOP, I2C_CMD_WRITE, I2C_M_NOSTART, I2C_M_RD, I2C_M_TEN, I2C_STAT_ARBLOST, I2C_STAT_BUSY, I2C_STAT_NACK, I2C_STAT_TIP, KEMPLD_I2C_CMD, KEMPLD_I2C_DATA, KEMPLD_I2C_STAT, kempld_read8(), kempld_write8(), i2c_msg::len, kempld_i2c_data::msg, kempld_i2c_data::nmsgs, kempld_i2c_data::pos, i2c_msg::slave, kempld_i2c_data::state, STATE_ADDR, STATE_ADDR10, STATE_DONE, STATE_ERROR, STATE_INIT, STATE_READ, STATE_START, and STATE_WRITE.
◆ kempld_i2c_xfer()
static int kempld_i2c_xfer |
( |
struct device *const |
dev, |
|
|
const struct i2c_msg *const |
msgs, |
|
|
const size_t |
num |
|
) |
| |
|
static |
◆ kempld_i2c_bus_ops
Initial value:= {
}
static int kempld_i2c_xfer(struct device *const dev, const struct i2c_msg *const msgs, const size_t num)
Definition at line 173 of file kempld_i2c.c.
◆ kempld_i2c_dev_ops
Initial value:= {
}
static const struct i2c_bus_operations kempld_i2c_bus_ops
void scan_smbus(struct device *bus)
Definition at line 173 of file kempld_i2c.c.
Referenced by kempld_i2c_device_init().