diff options
author | Roland Stigge <stigge@antcom.de> | 2012-08-08 03:42:32 -0400 |
---|---|---|
committer | Wolfram Sang <w.sang@pengutronix.de> | 2012-09-12 11:52:44 -0400 |
commit | c076ada4e4aaf45e1a31ad6de7c6cce36081e045 (patch) | |
tree | 0c1676608ef8316d271ed0a54f275c21feb3008e /include/linux/i2c-pnx.h | |
parent | b3aafe80c83097403d2b5edccfc440fac3d5f028 (diff) |
i2c: pnx: Fix read transactions of >= 2 bytes
On transactions with n>=2 bytes, the controller actually wrongly clocks in n+1
bytes. This is caused by the (wrong) assumption that RFE in the Status Register
is 1 iff there is no byte already ordered (via a dummy TX byte). This lead to
the implementation of synchronized byte ordering, e.g.:
Dummy-TX - RX - Dummy-TX - RX - ...
But since RFE actually stays high after some Dummy-TX, it rather looks like:
Dummy-TX - Dummy-TX - RX - Dummy-TX - RX - (RX)
The last RX byte is clocked in by the bus controller, but ignored by the kernel
when filling the userspace buffer.
This patch fixes the issue by asking for RX via Dummy-TX asynchronously.
Introducing a separate counter for TX bytes.
Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'include/linux/i2c-pnx.h')
-rw-r--r-- | include/linux/i2c-pnx.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h index 1bc74afe7a35..49ed17fdf055 100644 --- a/include/linux/i2c-pnx.h +++ b/include/linux/i2c-pnx.h | |||
@@ -22,6 +22,7 @@ struct i2c_pnx_mif { | |||
22 | struct timer_list timer; /* Timeout */ | 22 | struct timer_list timer; /* Timeout */ |
23 | u8 * buf; /* Data buffer */ | 23 | u8 * buf; /* Data buffer */ |
24 | int len; /* Length of data buffer */ | 24 | int len; /* Length of data buffer */ |
25 | int order; /* RX Bytes to order via TX */ | ||
25 | }; | 26 | }; |
26 | 27 | ||
27 | struct i2c_pnx_algo_data { | 28 | struct i2c_pnx_algo_data { |