提交 d3decdeb 编写于 作者: S Steve Sakoman 提交者: Albert ARIBAUD

omap: am335x_evm: enable i2c1 channel

This patch sets up pinmux, enables fclk, and
defines CONFIG_I2C_MULTI_BUS
Signed-off-by: NSteve Sakoman <steve@sakoman.com>
上级 71a271c6
......@@ -133,6 +133,11 @@ static void enable_per_clocks(void)
writel(PRCM_MOD_EN, &cmper->gpio3clkctrl);
while (readl(&cmper->gpio3clkctrl) != PRCM_MOD_EN)
;
/* i2c1 */
writel(PRCM_MOD_EN, &cmper->i2c1clkctrl);
while (readl(&cmper->i2c1clkctrl) != PRCM_MOD_EN)
;
}
static void mpu_pll_config(void)
......
......@@ -30,6 +30,7 @@ int board_init(void)
#ifdef CONFIG_I2C
enable_i2c0_pin_mux();
enable_i2c1_pin_mux();
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
#endif
......
......@@ -280,6 +280,14 @@ static struct module_pin_mux i2c0_pin_mux[] = {
{-1},
};
static struct module_pin_mux i2c1_pin_mux[] = {
{OFFSET(spi0_d1), (MODE(2) | RXACTIVE |
PULLUDEN | SLEWCTRL)}, /* I2C_DATA */
{OFFSET(spi0_cs0), (MODE(2) | RXACTIVE |
PULLUDEN | SLEWCTRL)}, /* I2C_SCLK */
{-1},
};
/*
* Configure the pin mux for the module
*/
......@@ -310,3 +318,8 @@ void enable_i2c0_pin_mux(void)
{
configure_module_pin_mux(i2c0_pin_mux);
}
void enable_i2c1_pin_mux(void)
{
configure_module_pin_mux(i2c1_pin_mux);
}
......@@ -108,6 +108,7 @@
#define CONFIG_HARD_I2C
#define CONFIG_SYS_I2C_SPEED 100000
#define CONFIG_SYS_I2C_SLAVE 1
#define CONFIG_I2C_MULTI_BUS
#define CONFIG_DRIVER_OMAP24XX_I2C
#define CONFIG_BAUDRATE 115200
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册