diff mbox

[U-Boot] omap: am335x_evm: enable i2c1 channel

Message ID 1338824079-16800-1-git-send-email-steve@sakoman.com
State Changes Requested
Delegated to: Tom Rini
Headers show

Commit Message

Steve Sakoman June 4, 2012, 3:34 p.m. UTC
This patch sets up pinmux, enables fclk, and
defines CONFIG_I2C_MULTI_BUS

Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 arch/arm/cpu/armv7/am33xx/clock.c |    5 +++++
 board/ti/am335x/mux.c             |    8 ++++++++
 include/configs/am335x_evm.h      |    1 +
 3 files changed, 14 insertions(+), 0 deletions(-)

Comments

Tom Rini June 21, 2012, 1:13 a.m. UTC | #1
On Mon, Jun 04, 2012 at 08:34:39AM -0700, Steve Sakoman wrote:

> This patch sets up pinmux, enables fclk, and
> defines CONFIG_I2C_MULTI_BUS

You add, but don't use the pinmux for i2c1:
mux.c:283: warning: 'i2c1_pin_mux' defined but not used

v2 please? :)
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/am33xx/clock.c b/arch/arm/cpu/armv7/am33xx/clock.c
index bbb9c13..57bec98 100644
--- a/arch/arm/cpu/armv7/am33xx/clock.c
+++ b/arch/arm/cpu/armv7/am33xx/clock.c
@@ -118,6 +118,11 @@  static void enable_per_clocks(void)
 	writel(PRCM_MOD_EN, &cmwkup->wkup_i2c0ctrl);
 	while (readl(&cmwkup->wkup_i2c0ctrl) != PRCM_MOD_EN)
 		;
+
+	/* i2c1 */
+	writel(PRCM_MOD_EN, &cmper->i2c1clkctrl);
+	while (readl(&cmper->i2c1clkctrl) != PRCM_MOD_EN)
+		;
 }
 
 static void mpu_pll_config(void)
diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c
index 9ccb436..b97cfc8 100644
--- a/board/ti/am335x/mux.c
+++ b/board/ti/am335x/mux.c
@@ -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
  */
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 89e2aa0..2b41c1c 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -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