diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-pnx.c')
-rw-r--r-- | drivers/i2c/busses/i2c-pnx.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c index 9532dee6b580..a97e3fec8148 100644 --- a/drivers/i2c/busses/i2c-pnx.c +++ b/drivers/i2c/busses/i2c-pnx.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/err.h> | 23 | #include <linux/err.h> |
24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
25 | #include <linux/slab.h> | ||
25 | 26 | ||
26 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
27 | #include <mach/i2c.h> | 28 | #include <mach/i2c.h> |
@@ -172,6 +173,9 @@ static int i2c_pnx_master_xmit(struct i2c_pnx_algo_data *alg_data) | |||
172 | /* We still have something to talk about... */ | 173 | /* We still have something to talk about... */ |
173 | val = *alg_data->mif.buf++; | 174 | val = *alg_data->mif.buf++; |
174 | 175 | ||
176 | if (alg_data->mif.len == 1) | ||
177 | val |= stop_bit; | ||
178 | |||
175 | alg_data->mif.len--; | 179 | alg_data->mif.len--; |
176 | iowrite32(val, I2C_REG_TX(alg_data)); | 180 | iowrite32(val, I2C_REG_TX(alg_data)); |
177 | 181 | ||
@@ -245,6 +249,9 @@ static int i2c_pnx_master_rcv(struct i2c_pnx_algo_data *alg_data) | |||
245 | __func__); | 249 | __func__); |
246 | 250 | ||
247 | if (alg_data->mif.len == 1) { | 251 | if (alg_data->mif.len == 1) { |
252 | /* Last byte, do not acknowledge next rcv. */ | ||
253 | val |= stop_bit; | ||
254 | |||
248 | /* | 255 | /* |
249 | * Enable interrupt RFDAIE (data in Rx fifo), | 256 | * Enable interrupt RFDAIE (data in Rx fifo), |
250 | * and disable DRMIE (need data for Tx) | 257 | * and disable DRMIE (need data for Tx) |
@@ -632,6 +639,8 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev) | |||
632 | */ | 639 | */ |
633 | 640 | ||
634 | tmp = ((freq / 1000) / I2C_PNX_SPEED_KHZ) / 2 - 2; | 641 | tmp = ((freq / 1000) / I2C_PNX_SPEED_KHZ) / 2 - 2; |
642 | if (tmp > 0x3FF) | ||
643 | tmp = 0x3FF; | ||
635 | iowrite32(tmp, I2C_REG_CKH(alg_data)); | 644 | iowrite32(tmp, I2C_REG_CKH(alg_data)); |
636 | iowrite32(tmp, I2C_REG_CKL(alg_data)); | 645 | iowrite32(tmp, I2C_REG_CKL(alg_data)); |
637 | 646 | ||