aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSimon Glass2012-01-11 12:42:24 +0000
committerAlbert ARIBAUD2012-02-12 10:11:22 +0100
commit8a1133c6074716d846b941fedfd6e0654e3f4292 (patch)
tree7c2876cd81616981a0411114547dcf8264b110d8 /arch
parent2faf1863de7a69c3bc687ce8dba78d29bb821082 (diff)
tegra: Add I2C support to funcmux
Add support to funcmux for selecting I2C functions and programming the pinmux appropriately. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/tegra2/funcmux.c40
-rw-r--r--arch/arm/include/asm/arch-tegra2/funcmux.h7
2 files changed, 47 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 662ce928c48..4fe6e06531c 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -66,6 +66,46 @@ int funcmux_select(enum periph_id id, int config)
}
break;
+ case PERIPH_ID_DVC_I2C:
+ /* there is only one selection, pinmux_config is ignored */
+ if (config == FUNCMUX_DVC_I2CP) {
+ pinmux_set_func(PINGRP_I2CP, PMUX_FUNC_I2C);
+ pinmux_tristate_disable(PINGRP_I2CP);
+ }
+ break;
+
+ case PERIPH_ID_I2C1:
+ /* support pinmux_config of 0 for now, */
+ if (config == FUNCMUX_I2C1_RM) {
+ pinmux_set_func(PINGRP_RM, PMUX_FUNC_I2C);
+ pinmux_tristate_disable(PINGRP_RM);
+ }
+ break;
+ case PERIPH_ID_I2C2: /* I2C2 */
+ switch (config) {
+ case FUNCMUX_I2C2_DDC: /* DDC pin group, select I2C2 */
+ pinmux_set_func(PINGRP_DDC, PMUX_FUNC_I2C2);
+ /* PTA to HDMI */
+ pinmux_set_func(PINGRP_PTA, PMUX_FUNC_HDMI);
+ pinmux_tristate_disable(PINGRP_DDC);
+ break;
+ case FUNCMUX_I2C2_PTA: /* PTA pin group, select I2C2 */
+ pinmux_set_func(PINGRP_PTA, PMUX_FUNC_I2C2);
+ /* set DDC_SEL to RSVDx (RSVD2 works for now) */
+ pinmux_set_func(PINGRP_DDC, PMUX_FUNC_RSVD2);
+ pinmux_tristate_disable(PINGRP_PTA);
+ bad_config = 0;
+ break;
+ }
+ break;
+ case PERIPH_ID_I2C3: /* I2C3 */
+ /* support pinmux_config of 0 for now */
+ if (config == FUNCMUX_I2C3_DTF) {
+ pinmux_set_func(PINGRP_DTF, PMUX_FUNC_I2C3);
+ pinmux_tristate_disable(PINGRP_DTF);
+ }
+ break;
+
default:
debug("%s: invalid periph_id %d", __func__, id);
return -1;
diff --git a/arch/arm/include/asm/arch-tegra2/funcmux.h b/arch/arm/include/asm/arch-tegra2/funcmux.h
index 791f3011c1f..d1845238009 100644
--- a/arch/arm/include/asm/arch-tegra2/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra2/funcmux.h
@@ -32,6 +32,13 @@ enum {
FUNCMUX_UART1_IRRX_IRTX = 0,
FUNCMUX_UART2_IRDA = 0,
FUNCMUX_UART4_GMC = 0,
+
+ /* I2C configs */
+ FUNCMUX_DVC_I2CP = 0,
+ FUNCMUX_I2C1_RM = 0,
+ FUNCMUX_I2C2_DDC = 0,
+ FUNCMUX_I2C2_PTA,
+ FUNCMUX_I2C3_DTF = 0,
};
/**