diff options
author | Jeffrey (Sheng-Hui) Chu <jeffchu@broadcom.com> | 2011-11-23 05:33:07 -0500 |
---|---|---|
committer | Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com> | 2011-12-12 08:07:02 -0500 |
commit | 84066f3d8db83c3211023d9b64ab0c39d3cb35a3 (patch) | |
tree | 9ff43826ab1db05a097f15185105185b65e6d7ea | |
parent | 703edf081b3ff9d90833b71a09ab2eab9ffaca95 (diff) |
i2c-algo-bit: Generate correct i2c address sequence for 10-bit target
BugLink: http://bugs.launchpad.net/bugs/902312
commit cc6bcf7d2ec2234e7b41770185e4dc826390185e upstream.
The wrong bits were put on the wire, fix that.
This fixes kernel bug #42562.
Signed-off-by: Sheng-Hui J. Chu <jeffchu@broadcom.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-rw-r--r-- | drivers/i2c/algos/i2c-algo-bit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index d6d58684712..eca3bcc4599 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c | |||
@@ -486,7 +486,7 @@ static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg) | |||
486 | 486 | ||
487 | if (flags & I2C_M_TEN) { | 487 | if (flags & I2C_M_TEN) { |
488 | /* a ten bit address */ | 488 | /* a ten bit address */ |
489 | addr = 0xf0 | ((msg->addr >> 7) & 0x03); | 489 | addr = 0xf0 | ((msg->addr >> 7) & 0x06); |
490 | bit_dbg(2, &i2c_adap->dev, "addr0: %d\n", addr); | 490 | bit_dbg(2, &i2c_adap->dev, "addr0: %d\n", addr); |
491 | /* try extended address code...*/ | 491 | /* try extended address code...*/ |
492 | ret = try_address(i2c_adap, addr, retries); | 492 | ret = try_address(i2c_adap, addr, retries); |
@@ -496,7 +496,7 @@ static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg) | |||
496 | return -EREMOTEIO; | 496 | return -EREMOTEIO; |
497 | } | 497 | } |
498 | /* the remaining 8 bit address */ | 498 | /* the remaining 8 bit address */ |
499 | ret = i2c_outb(i2c_adap, msg->addr & 0x7f); | 499 | ret = i2c_outb(i2c_adap, msg->addr & 0xff); |
500 | if ((ret != 1) && !nak_ok) { | 500 | if ((ret != 1) && !nak_ok) { |
501 | /* the chip did not ack / xmission error occurred */ | 501 | /* the chip did not ack / xmission error occurred */ |
502 | dev_err(&i2c_adap->dev, "died at 2nd address code\n"); | 502 | dev_err(&i2c_adap->dev, "died at 2nd address code\n"); |