aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorDirk Brandewie <dirk.brandewie@gmail.com>2011-10-06 14:26:31 -0400
committerBen Dooks <ben-linux@fluff.org>2011-10-29 06:03:50 -0400
commit2fa8326b4b1e5fdc889b57b03b1313f3229cb438 (patch)
treeaa76a229f4090ba1dc9e1ad7bb06666eb8ee62d5 /drivers/i2c
parent1d31b58f648c4f754b23fed4d57acc941080e5ee (diff)
i2c-designware: move i2c functionality bit field to be adapter specific
The functionality of the adapter depends on the configuration of the IP block at silicon compile time and is adapter specific. Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-designware-core.c8
-rw-r--r--drivers/i2c/busses/i2c-designware-core.h1
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c8
3 files changed, 11 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index cd52f17028cd..71055114bd80 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -457,12 +457,8 @@ done:
457 457
458u32 i2c_dw_func(struct i2c_adapter *adap) 458u32 i2c_dw_func(struct i2c_adapter *adap)
459{ 459{
460 return I2C_FUNC_I2C | 460 struct dw_i2c_dev *dev = i2c_get_adapdata(adap);
461 I2C_FUNC_10BIT_ADDR | 461 return dev->functionality;
462 I2C_FUNC_SMBUS_BYTE |
463 I2C_FUNC_SMBUS_BYTE_DATA |
464 I2C_FUNC_SMBUS_WORD_DATA |
465 I2C_FUNC_SMBUS_I2C_BLOCK;
466} 462}
467 463
468static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev) 464static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev)
diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
index 43de340af57f..ab4e655a6c61 100644
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -182,6 +182,7 @@ struct dw_i2c_dev {
182 int irq; 182 int irq;
183 int swab; 183 int swab;
184 struct i2c_adapter adapter; 184 struct i2c_adapter adapter;
185 u32 functionality;
185 unsigned int tx_fifo_depth; 186 unsigned int tx_fifo_depth;
186 unsigned int rx_fifo_depth; 187 unsigned int rx_fifo_depth;
187}; 188};
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 08783a6ff1a2..36db7a80cbb2 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -96,6 +96,14 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
96 } 96 }
97 clk_enable(dev->clk); 97 clk_enable(dev->clk);
98 98
99 dev->functionality =
100 I2C_FUNC_I2C |
101 I2C_FUNC_10BIT_ADDR |
102 I2C_FUNC_SMBUS_BYTE |
103 I2C_FUNC_SMBUS_BYTE_DATA |
104 I2C_FUNC_SMBUS_WORD_DATA |
105 I2C_FUNC_SMBUS_I2C_BLOCK;
106
99 dev->base = ioremap(mem->start, resource_size(mem)); 107 dev->base = ioremap(mem->start, resource_size(mem));
100 if (dev->base == NULL) { 108 if (dev->base == NULL) {
101 dev_err(&pdev->dev, "failure mapping io resources\n"); 109 dev_err(&pdev->dev, "failure mapping io resources\n");