linuxkpi: i2c: Fix 7bit/8bit addressing
Linux is using 7 bit addressing while FreeBSD uses 8 bit addresses internally, but i2c(8) uses 7 bit address. This confused me when originally doing the code and I thought that 0x50 was the 8bit EDID address while it's the 7bit address and since I did all my testing using this I didn't noticed the problem. Reported by: avg PR: 265920 (somewhat)
This commit is contained in:
parent
dd89489769
commit
319a4bddb0
@ -183,7 +183,7 @@ lkpi_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
|
||||
M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
|
||||
for (i = 0; i < nmsgs; i++) {
|
||||
linux_msgs[i].addr = msgs[i].slave;
|
||||
linux_msgs[i].addr = msgs[i].slave >> 1;
|
||||
linux_msgs[i].len = msgs[i].len;
|
||||
linux_msgs[i].buf = msgs[i].buf;
|
||||
if (msgs[i].flags & IIC_M_RD) {
|
||||
|
Loading…
Reference in New Issue
Block a user