mirror of https://gitee.com/openkylin/linux.git
i2c: mv64xxx: directly call send_start when initializing transfer
Calling the state machine with a definite state which is only used in this context is superfluous. Do it directly. Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
4c5b38e881
commit
b0200abeba
|
@ -98,7 +98,6 @@ enum {
|
||||||
enum {
|
enum {
|
||||||
MV64XXX_I2C_ACTION_INVALID,
|
MV64XXX_I2C_ACTION_INVALID,
|
||||||
MV64XXX_I2C_ACTION_CONTINUE,
|
MV64XXX_I2C_ACTION_CONTINUE,
|
||||||
MV64XXX_I2C_ACTION_SEND_START,
|
|
||||||
MV64XXX_I2C_ACTION_SEND_RESTART,
|
MV64XXX_I2C_ACTION_SEND_RESTART,
|
||||||
MV64XXX_I2C_ACTION_OFFLOAD_RESTART,
|
MV64XXX_I2C_ACTION_OFFLOAD_RESTART,
|
||||||
MV64XXX_I2C_ACTION_SEND_ADDR_1,
|
MV64XXX_I2C_ACTION_SEND_ADDR_1,
|
||||||
|
@ -467,10 +466,6 @@ mv64xxx_i2c_do_action(struct mv64xxx_i2c_data *drv_data)
|
||||||
drv_data->reg_base + drv_data->reg_offsets.control);
|
drv_data->reg_base + drv_data->reg_offsets.control);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MV64XXX_I2C_ACTION_SEND_START:
|
|
||||||
mv64xxx_i2c_send_start(drv_data);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MV64XXX_I2C_ACTION_SEND_ADDR_1:
|
case MV64XXX_I2C_ACTION_SEND_ADDR_1:
|
||||||
writel(drv_data->addr1,
|
writel(drv_data->addr1,
|
||||||
drv_data->reg_base + drv_data->reg_offsets.data);
|
drv_data->reg_base + drv_data->reg_offsets.data);
|
||||||
|
@ -633,12 +628,11 @@ mv64xxx_i2c_execute_msg(struct mv64xxx_i2c_data *drv_data, struct i2c_msg *msg,
|
||||||
|
|
||||||
spin_lock_irqsave(&drv_data->lock, flags);
|
spin_lock_irqsave(&drv_data->lock, flags);
|
||||||
|
|
||||||
drv_data->action = MV64XXX_I2C_ACTION_SEND_START;
|
|
||||||
drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_START_COND;
|
drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_START_COND;
|
||||||
|
|
||||||
drv_data->send_stop = is_last;
|
drv_data->send_stop = is_last;
|
||||||
drv_data->block = 1;
|
drv_data->block = 1;
|
||||||
mv64xxx_i2c_do_action(drv_data);
|
mv64xxx_i2c_send_start(drv_data);
|
||||||
spin_unlock_irqrestore(&drv_data->lock, flags);
|
spin_unlock_irqrestore(&drv_data->lock, flags);
|
||||||
|
|
||||||
mv64xxx_i2c_wait_for_completion(drv_data);
|
mv64xxx_i2c_wait_for_completion(drv_data);
|
||||||
|
|
Loading…
Reference in New Issue