18 .i2c_regs = (
void *)(
I2C_BASE + 0xc000),
24 .i2c_regs = (
void *)(
I2C_BASE + 0x4000),
30 .i2c_regs = (
void *)(
I2C_BASE + 0xa000),
36 .i2c_regs = (
void *)(
I2C_BASE + 0x3000),
42 .i2c_regs = (
void *)(
I2C_BASE + 0x11000),
54 "Wrong size of mtk_i2c_bus_controller");
61 #define PAD_FUNC(name, func) {GPIO(name), PAD_##name##_FUNC_##func}
99 for (
size_t i = 0; i < 2; i++) {
116 (400 *
KHz * sample_div * 2) * clock_div);
117 i2c_freq =
I2C_CLK_HZ / (step_div * sample_div * 2 * clock_div);
118 assert(sample_div < 8 && step_div < 64 && i2c_freq <= 400 *
KHz &&
119 i2c_freq >= 380 *
KHz);
123 (sample_div - 1) << 8 | (step_div - 1));
125 (sample_div - 1) << 6 | (step_div - 1));
static void write32(void *addr, uint32_t val)
static uint32_t read32(const void *addr)
#define assert(statement)
#define DIV_ROUND_UP(x, y)
#define printk(level,...)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
struct mt_i2c_regs * i2c_regs