diff options
author | Jeffrey (Sheng-Hui) Chu <jeffchu@broadcom.com> | 2011-11-23 11:33:07 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-09 09:21:35 -0800 |
commit | 3724acf6680ac4233a6ce2cfbab7e71070bf93e3 (patch) | |
tree | 2a0757cc732261545b543fe0ada7a9dd1a4be2b6 | |
parent | 2f2ce136c8983e7b179ef8ab6097c2dcf9c5150e (diff) | |
download | lwn-3724acf6680ac4233a6ce2cfbab7e71070bf93e3.tar.gz lwn-3724acf6680ac4233a6ce2cfbab7e71070bf93e3.zip |
i2c-algo-bit: Generate correct i2c address sequence for 10-bit target
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>
-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 e25e13980af3..44921600cf25 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c @@ -471,7 +471,7 @@ static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg) if (flags & I2C_M_TEN) { /* a ten bit address */ - addr = 0xf0 | ((msg->addr >> 7) & 0x03); + addr = 0xf0 | ((msg->addr >> 7) & 0x06); bit_dbg(2, &i2c_adap->dev, "addr0: %d\n", addr); /* try extended address code...*/ ret = try_address(i2c_adap, addr, retries); @@ -481,7 +481,7 @@ static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg) return -EREMOTEIO; } /* the remaining 8 bit address */ - ret = i2c_outb(i2c_adap, msg->addr & 0x7f); + ret = i2c_outb(i2c_adap, msg->addr & 0xff); if ((ret != 1) && !nak_ok) { /* the chip did not ack / xmission error occurred */ dev_err(&i2c_adap->dev, "died at 2nd address code\n"); |