Open main menu

DAVE Developer's Wiki β

Changes

Enabling I2C2 on Linux (Diva)

2,470 bytes added, 08:04, 21 June 2013
m
no edit summary
|D18
|}
 
=== Linux kernel patches ===
 
The files <code>arch/arm/mach-omap2/board-diva.c</code> and <code>arch/arm/mach-omap2/diva_pinmux_table.h</code> must be modified according to the following patches:
 
<diff>
diff --git a/arch/arm/mach-omap2/board-diva.c b/arch/arm/mach-omap2/board-diva.c
index 42898e9..282917d 100644
--- a/arch/arm/mach-omap2/board-diva.c
+++ b/arch/arm/mach-omap2/board-diva.c
@@ -734,6 +734,14 @@ static void __init diva_i2c_init(void)
ARRAY_SIZE(am335x_i2c0_boardinfo));
}
+/* ------------ I2C2 BUS -------------------------------------------------*/
+
+static void i2c2_init(int evm_id, int profile)
+{
+ setup_pin_mux(i2c2_pin_mux);
+ omap_register_i2c_bus(3, 100, NULL, 0);
+}
+
/* ------------ USB BUS -------------------------------------------------*/
static struct omap_musb_board_data musb_board_data = {
@@ -880,6 +888,8 @@ static struct evm_dev_cfg diva_dev_cfg[] = {
{w1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
+ {i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE},
+
/* {enable_ecap2, DEV_ON_BASEBOARD, PROFILE_NONE},*/
/* {mmc1_wl12xx_init, DEV_ON_BASEBOARD, PROFILE_NONE},*/
/* {uart1_wl12xx_init, DEV_ON_BASEBOARD, PROFILE_NONE},*/
</diff>
 
<diff>
diff --git a/arch/arm/mach-omap2/diva_pinmux_table.h b/arch/arm/mach-omap2/diva_pinmux_table.h
index f6647b0..8d88a27 100644
--- a/arch/arm/mach-omap2/diva_pinmux_table.h
+++ b/arch/arm/mach-omap2/diva_pinmux_table.h
@@ -179,6 +179,14 @@ static struct pinmux_config w1_gpio_pin_mux[] = {
{NULL, 0},
};
+static struct pinmux_config i2c2_pin_mux[] = {
+ {"uart1_ctsn.i2c2_sda", OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW |
+ AM33XX_PULL_UP | AM33XX_INPUT_EN},
+ {"uart1_rtsn.i2c2_scl", OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW |
+ AM33XX_PULL_UP | AM33XX_INPUT_EN},
+ {NULL, 0},
+};
+
/*
* the following mux configurations are un-tested but are left here for
* reference. They are all comment-out to avoid "defined but not used" warning
@@ -265,14 +273,6 @@ static struct pinmux_config i2c1_pin_mux[] = {
{NULL, 0},
};
-static struct pinmux_config i2c2_pin_mux[] = {
- {"uart1_ctsn.i2c2_sda", OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW |
- AM33XX_PULL_UP | AM33XX_INPUT_EN},
- {"uart1_rtsn.i2c2_scl", OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW |
- AM33XX_PULL_UP | AM33XX_INPUT_EN},
- {NULL, 0},
-};
-
static struct pinmux_config mmc0_cd_only_pin_mux[] = {
{"gpmc_csn1.gpio1_30", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
{NULL, 0},
</diff>