diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2008-10-03 16:07:36 +0200 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-10-03 16:57:06 +0200 |
commit | c46c948260f41af18b277c1eb1895d788d3605dc (patch) | |
tree | f073823d5b3dab9cb02d231dcce591343759fa8d /drivers/i2c/busses/i2c-pxa.c | |
parent | [ARM] pxa: remove references to pxa_gpio_mode() in comments (diff) | |
download | linux-c46c948260f41af18b277c1eb1895d788d3605dc.tar.xz linux-c46c948260f41af18b277c1eb1895d788d3605dc.zip |
[ARM] 5278/1: i2c-pxa fast mode support
Add fast_mode option to i2c_pxa_platform_data and use it to set the
ICR_FM bit appropriately when i2c_pxa_reset is called. Parameter
called fast_mode rather than frequency as this driver is also used
for the i2c_pxa_pwr bus which has different normal and fast frequencies.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/i2c/busses/i2c-pxa.c')
-rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 518b57c795c8..8b38ed0379d5 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -66,7 +66,8 @@ struct pxa_i2c { unsigned long iosize; int irq; - int use_pio; + unsigned int use_pio :1; + unsigned int fast_mode :1; }; #define _IBMR(i2c) ((i2c)->reg_base + (0x0 << (i2c)->reg_shift)) @@ -366,7 +367,7 @@ static void i2c_pxa_reset(struct pxa_i2c *i2c) writel(i2c->slave_addr, _ISAR(i2c)); /* set control register values */ - writel(I2C_ICR_INIT, _ICR(i2c)); + writel(I2C_ICR_INIT | (i2c->fast_mode ? ICR_FM : 0), _ICR(i2c)); #ifdef CONFIG_I2C_PXA_SLAVE dev_info(&i2c->adap.dev, "Enabling slave mode\n"); @@ -1010,6 +1011,7 @@ static int i2c_pxa_probe(struct platform_device *dev) if (plat) { i2c->adap.class = plat->class; i2c->use_pio = plat->use_pio; + i2c->fast_mode = plat->fast_mode; } if (i2c->use_pio) { |