summaryrefslogtreecommitdiff
path: root/drivers/i2c/fsl_i2c.c
diff options
context:
space:
mode:
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>2009-09-17 11:07:16 +0200
committerHeiko Schocher <hs@denx.de>2009-09-28 07:35:53 +0200
commitd01ee4db9302cfccaa5c548a1c4e873b415681a0 (patch)
tree3cf9c20c5ff9c4fb41ca9eddfb990da9f67cc1b7 /drivers/i2c/fsl_i2c.c
parent21f4cbb77299788e2b06c9b0f48cf20a5ab00d4a (diff)
downloadu-boot-imx-d01ee4db9302cfccaa5c548a1c4e873b415681a0.zip
u-boot-imx-d01ee4db9302cfccaa5c548a1c4e873b415681a0.tar.gz
u-boot-imx-d01ee4db9302cfccaa5c548a1c4e873b415681a0.tar.bz2
fsl_i2c: Add CONFIG_FSL_I2C_CUSTOM_{DFSR/FDR}
Some boards need a higher DFSR value than the spec currently recommends so give these boards the means to define there own. For completeness, add CONFIG_FSL_I2C_CUSTOM_FDR too. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Diffstat (limited to 'drivers/i2c/fsl_i2c.c')
-rw-r--r--drivers/i2c/fsl_i2c.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
index 56f9680..0c5f6be 100644
--- a/drivers/i2c/fsl_i2c.c
+++ b/drivers/i2c/fsl_i2c.c
@@ -172,14 +172,22 @@ static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev,
u8 fdr;
#ifdef __PPC__
u8 dfsr;
+#ifdef CONFIG_FSL_I2C_CUSTOM_DFSR
+ dfsr = CONFIG_FSL_I2C_CUSTOM_DFSR;
+#else
dfsr = fsl_i2c_speed_map[i].dfsr;
#endif
+ writeb(dfsr, &dev->dfsrr); /* set default filter */
+#endif
+#ifdef CONFIG_FSL_I2C_CUSTOM_FDR
+ fdr = CONFIG_FSL_I2C_CUSTOM_FDR;
+ speed = i2c_clk / divider; /* Fake something */
+#else
fdr = fsl_i2c_speed_map[i].fdr;
speed = i2c_clk / fsl_i2c_speed_map[i].divider;
- writeb(fdr, &dev->fdr); /* set bus speed */
-#ifdef __PPC__
- writeb(dfsr, &dev->dfsrr); /* set default filter */
#endif
+ writeb(fdr, &dev->fdr); /* set bus speed */
+
break;
}