7 #include <soc/addressmap.h>
19 .i2c_regs = (
void *)(
I2C_BASE + 0x1000),
25 .i2c_regs = (
void *)(
I2C_BASE + 0x2000),
31 .i2c_regs = (
void *)(
I2C_BASE + 0x9000),
37 .i2c_regs = (
void *)(
I2C_BASE + 0xa000),
47 .i2c_regs = (
void *)(
I2C_BASE + 0xc000),
53 "Wrong size of mtk_i2c_bus_controller");
55 #define I2CTAG "[I2C][PL] "
58 #define I2CLOG(fmt, arg...) printk(BIOS_INFO, I2CTAG fmt, ##arg)
60 #define I2CLOG(fmt, arg...)
63 #define I2CERR(fmt, arg...) printk(BIOS_ERR, I2CTAG fmt, ##arg)
75 i2c_freq =
I2C_CLK_HZ / (step_div * sample_div * 2);
76 assert(sample_div < 8 && step_div < 64 && i2c_freq < 400 *
KHz &&
77 i2c_freq >= 380 *
KHz);
81 (sample_div - 1) << 8 | (step_div - 1));
static void write32(void *addr, uint32_t val)
#define assert(statement)
#define DIV_ROUND_UP(x, y)
struct mt_i2c_dma_regs * i2c_dma_regs
struct mt_i2c_regs * i2c_regs