summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRoland Stigge <stigge@antcom.de>2012-08-08 09:42:32 +0200
committerWolfram Sang <w.sang@pengutronix.de>2012-09-12 17:52:44 +0200
commitc076ada4e4aaf45e1a31ad6de7c6cce36081e045 (patch)
tree0c1676608ef8316d271ed0a54f275c21feb3008e /include
parentb3aafe80c83097403d2b5edccfc440fac3d5f028 (diff)
downloadlinux-c076ada4e4aaf45e1a31ad6de7c6cce36081e045.tar.bz2
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')
-rw-r--r--include/linux/i2c-pnx.h1
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 {
struct timer_list timer; /* Timeout */
u8 * buf; /* Data buffer */
int len; /* Length of data buffer */
+ int order; /* RX Bytes to order via TX */
};
struct i2c_pnx_algo_data {