aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-30 04:55:34 -0400
committerJean Delvare <khali@endymion.delvare>2012-05-30 04:55:34 -0400
commit14674e70119ea01549ce593d8901a797f8a90f74 (patch)
tree15474236bfa505aa396bf2892cbbee65e842b94b /drivers
parent838bfa6049fb84dc66c9c9bbeb3a968ec987fd3d (diff)
i2c: Split I2C_M_NOSTART support out of I2C_FUNC_PROTOCOL_MANGLING
Since there are uses for I2C_M_NOSTART which are much more sensible and standard than most of the protocol mangling functionality (the main one being gather writes to devices where something like a register address needs to be inserted before a block of data) create a new I2C_FUNC_NOSTART for this feature and update all the users to use it. Also strengthen the disrecommendation of the protocol mangling while we're at it. In the case of regmap-i2c we remove the requirement for mangling as I2C_M_NOSTART is the only mangling feature which is being used. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/regmap/regmap-i2c.c2
-rw-r--r--drivers/i2c/algos/i2c-algo-bit.c2
-rw-r--r--drivers/i2c/busses/i2c-nuc900.c3
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c3
-rw-r--r--drivers/input/joystick/as5011.c1
-rw-r--r--drivers/video/matrox/matroxfb_maven.c1
6 files changed, 8 insertions, 4 deletions
diff --git a/drivers/base/regmap/regmap-i2c.c b/drivers/base/regmap/regmap-i2c.c
index 5f6b2478bf17..fa6bf5279d28 100644
--- a/drivers/base/regmap/regmap-i2c.c
+++ b/drivers/base/regmap/regmap-i2c.c
@@ -42,7 +42,7 @@ static int regmap_i2c_gather_write(void *context,
42 /* If the I2C controller can't do a gather tell the core, it 42 /* If the I2C controller can't do a gather tell the core, it
43 * will substitute in a linear write for us. 43 * will substitute in a linear write for us.
44 */ 44 */
45 if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_PROTOCOL_MANGLING)) 45 if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_NOSTART))
46 return -ENOTSUPP; 46 return -ENOTSUPP;
47 47
48 xfer[0].addr = i2c->addr; 48 xfer[0].addr = i2c->addr;
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index 7f0b83219744..fad22b0bb5b0 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -608,7 +608,7 @@ bailout:
608 608
609static u32 bit_func(struct i2c_adapter *adap) 609static u32 bit_func(struct i2c_adapter *adap)
610{ 610{
611 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | 611 return I2C_FUNC_I2C | I2C_FUNC_NOSTART | I2C_FUNC_SMBUS_EMUL |
612 I2C_FUNC_SMBUS_READ_BLOCK_DATA | 612 I2C_FUNC_SMBUS_READ_BLOCK_DATA |
613 I2C_FUNC_SMBUS_BLOCK_PROC_CALL | 613 I2C_FUNC_SMBUS_BLOCK_PROC_CALL |
614 I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING; 614 I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING;
diff --git a/drivers/i2c/busses/i2c-nuc900.c b/drivers/i2c/busses/i2c-nuc900.c
index 03b615778887..a26dfb8cd586 100644
--- a/drivers/i2c/busses/i2c-nuc900.c
+++ b/drivers/i2c/busses/i2c-nuc900.c
@@ -502,7 +502,8 @@ static int nuc900_i2c_xfer(struct i2c_adapter *adap,
502/* declare our i2c functionality */ 502/* declare our i2c functionality */
503static u32 nuc900_i2c_func(struct i2c_adapter *adap) 503static u32 nuc900_i2c_func(struct i2c_adapter *adap)
504{ 504{
505 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_PROTOCOL_MANGLING; 505 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_NOSTART |
506 I2C_FUNC_PROTOCOL_MANGLING;
506} 507}
507 508
508/* i2c bus registration info */ 509/* i2c bus registration info */
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index fa0b13490873..01959154572d 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -626,7 +626,8 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
626/* declare our i2c functionality */ 626/* declare our i2c functionality */
627static u32 s3c24xx_i2c_func(struct i2c_adapter *adap) 627static u32 s3c24xx_i2c_func(struct i2c_adapter *adap)
628{ 628{
629 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_PROTOCOL_MANGLING; 629 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_NOSTART |
630 I2C_FUNC_PROTOCOL_MANGLING;
630} 631}
631 632
632/* i2c bus registration info */ 633/* i2c bus registration info */
diff --git a/drivers/input/joystick/as5011.c b/drivers/input/joystick/as5011.c
index 3063464474bf..57d19d4e0a2d 100644
--- a/drivers/input/joystick/as5011.c
+++ b/drivers/input/joystick/as5011.c
@@ -231,6 +231,7 @@ static int __devinit as5011_probe(struct i2c_client *client,
231 } 231 }
232 232
233 if (!i2c_check_functionality(client->adapter, 233 if (!i2c_check_functionality(client->adapter,
234 I2C_FUNC_NOSTART |
234 I2C_FUNC_PROTOCOL_MANGLING)) { 235 I2C_FUNC_PROTOCOL_MANGLING)) {
235 dev_err(&client->dev, 236 dev_err(&client->dev,
236 "need i2c bus that supports protocol mangling\n"); 237 "need i2c bus that supports protocol mangling\n");
diff --git a/drivers/video/matrox/matroxfb_maven.c b/drivers/video/matrox/matroxfb_maven.c
index 31b8f67477b7..217678e0b983 100644
--- a/drivers/video/matrox/matroxfb_maven.c
+++ b/drivers/video/matrox/matroxfb_maven.c
@@ -1243,6 +1243,7 @@ static int maven_probe(struct i2c_client *client,
1243 1243
1244 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_WORD_DATA | 1244 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_WORD_DATA |
1245 I2C_FUNC_SMBUS_BYTE_DATA | 1245 I2C_FUNC_SMBUS_BYTE_DATA |
1246 I2C_FUNC_NOSTART |
1246 I2C_FUNC_PROTOCOL_MANGLING)) 1247 I2C_FUNC_PROTOCOL_MANGLING))
1247 goto ERROR0; 1248 goto ERROR0;
1248 if (!(data = kzalloc(sizeof(*data), GFP_KERNEL))) { 1249 if (!(data = kzalloc(sizeof(*data), GFP_KERNEL))) {