58 lines
2.2 KiB
Diff
58 lines
2.2 KiB
Diff
From: Russell King <rmk+kernel@arm.linux.org.uk>
|
|
Date: Thu, 16 May 2013 21:37:11 +0100
|
|
Subject: [1/3] I2C: mv64xxx: remove I2C_M_NOSTART code
|
|
Origin: https://git.kernel.org/linus/aa6bce5319a54c050af26e095287472854abccfd
|
|
Bug-Debian: http://bugs.debian.org/622325
|
|
|
|
As this driver does not advertise protocol mangling support
|
|
(I2C_FUNC_PROTOCOL_MANGLING is not set), having code to act on
|
|
I2C_M_NOSTART is illogical, and in any case isn't supportable on
|
|
anything but the first message - which makes no sense. Remove
|
|
the I2C_M_NOSTART code.
|
|
|
|
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
|
|
Acked-by: Mark A. Greer <mgreer@animalcreek.com>
|
|
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
|
|
---
|
|
drivers/i2c/busses/i2c-mv64xxx.c | 26 +++++---------------------
|
|
1 file changed, 5 insertions(+), 21 deletions(-)
|
|
|
|
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
|
|
index 4b45c73..f11cb25 100644
|
|
--- a/drivers/i2c/busses/i2c-mv64xxx.c
|
|
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
|
|
@@ -419,28 +419,12 @@ mv64xxx_i2c_execute_msg(struct mv64xxx_i2c_data *drv_data, struct i2c_msg *msg,
|
|
spin_lock_irqsave(&drv_data->lock, flags);
|
|
mv64xxx_i2c_prepare_for_io(drv_data, msg);
|
|
|
|
- if (unlikely(msg->flags & I2C_M_NOSTART)) { /* Skip start/addr phases */
|
|
- if (drv_data->msg->flags & I2C_M_RD) {
|
|
- /* No action to do, wait for slave to send a byte */
|
|
- drv_data->action = MV64XXX_I2C_ACTION_CONTINUE;
|
|
- drv_data->state =
|
|
- MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA;
|
|
- } else {
|
|
- drv_data->action = MV64XXX_I2C_ACTION_SEND_DATA;
|
|
- drv_data->state =
|
|
- MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK;
|
|
- drv_data->bytes_left--;
|
|
- }
|
|
+ if (is_first) {
|
|
+ drv_data->action = MV64XXX_I2C_ACTION_SEND_START;
|
|
+ drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_START_COND;
|
|
} else {
|
|
- if (is_first) {
|
|
- drv_data->action = MV64XXX_I2C_ACTION_SEND_START;
|
|
- drv_data->state =
|
|
- MV64XXX_I2C_STATE_WAITING_FOR_START_COND;
|
|
- } else {
|
|
- drv_data->action = MV64XXX_I2C_ACTION_SEND_ADDR_1;
|
|
- drv_data->state =
|
|
- MV64XXX_I2C_STATE_WAITING_FOR_ADDR_1_ACK;
|
|
- }
|
|
+ drv_data->action = MV64XXX_I2C_ACTION_SEND_ADDR_1;
|
|
+ drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_ADDR_1_ACK;
|
|
}
|
|
|
|
drv_data->send_stop = is_last;
|