#include "cobalt-driver.h"
#include "cobalt-i2c.h"
struct cobalt_i2c_regs { … };
#define M00018_CTR_BITMAP_EN_MSK …
#define M00018_CTR_BITMAP_IEN_MSK …
#define M00018_CR_BITMAP_STA_MSK …
#define M00018_CR_BITMAP_STO_MSK …
#define M00018_CR_BITMAP_RD_MSK …
#define M00018_CR_BITMAP_WR_MSK …
#define M00018_CR_BITMAP_ACK_MSK …
#define M00018_CR_BITMAP_IACK_MSK …
#define M00018_SR_BITMAP_RXACK_MSK …
#define M00018_SR_BITMAP_BUSY_MSK …
#define M00018_SR_BITMAP_AL_MSK …
#define M00018_SR_BITMAP_TIP_MSK …
#define M00018_SR_BITMAP_IF_MSK …
#define I2C_FREQUENCY …
#define ALT_CPU_FREQ …
static struct cobalt_i2c_regs __iomem *
cobalt_i2c_regs(struct cobalt *cobalt, unsigned idx)
{ … }
static int cobalt_tx_bytes(struct cobalt_i2c_regs __iomem *regs,
struct i2c_adapter *adap, bool start, bool stop,
u8 *data, u16 len)
{ … }
static int cobalt_rx_bytes(struct cobalt_i2c_regs __iomem *regs,
struct i2c_adapter *adap, bool start, bool stop,
u8 *data, u16 len)
{ … }
static int cobalt_stop(struct cobalt_i2c_regs __iomem *regs,
struct i2c_adapter *adap)
{ … }
static int cobalt_xfer(struct i2c_adapter *adap,
struct i2c_msg msgs[], int num)
{ … }
static u32 cobalt_func(struct i2c_adapter *adap)
{ … }
static const struct i2c_adapter cobalt_i2c_adap_template = …;
static const struct i2c_algorithm cobalt_algo = …;
int cobalt_i2c_init(struct cobalt *cobalt)
{ … }
void cobalt_i2c_exit(struct cobalt *cobalt)
{ … }