Lines Matching refs:oper_state
155 enum npcx_i2c_oper_state oper_state; /* controller operation state */ member
480 if (data->oper_state != NPCX_I2C_ERROR_RECOVERY) { in i2c_ctrl_recovery()
481 data->oper_state = NPCX_I2C_ERROR_RECOVERY; in i2c_ctrl_recovery()
519 data->oper_state = NPCX_I2C_IDLE; in i2c_ctrl_recovery()
555 if (data->oper_state == NPCX_I2C_WAIT_START) { in i2c_ctrl_handle_write_int_event()
559 data->oper_state = NPCX_I2C_WRITE_FIFO; in i2c_ctrl_handle_write_int_event()
564 if (data->oper_state == NPCX_I2C_WRITE_FIFO) { in i2c_ctrl_handle_write_int_event()
576 data->oper_state = NPCX_I2C_WRITE_SUSPEND; in i2c_ctrl_handle_write_int_event()
582 if (data->oper_state == NPCX_I2C_WRITE_SUSPEND) { in i2c_ctrl_handle_write_int_event()
589 data->oper_state = NPCX_I2C_WAIT_STOP; in i2c_ctrl_handle_write_int_event()
604 if (data->oper_state == NPCX_I2C_WAIT_START || in i2c_ctrl_handle_read_int_event()
605 data->oper_state == NPCX_I2C_WAIT_RESTART) { in i2c_ctrl_handle_read_int_event()
612 data->oper_state = NPCX_I2C_READ_FIFO; in i2c_ctrl_handle_read_int_event()
617 if (data->oper_state == NPCX_I2C_READ_FIFO) { in i2c_ctrl_handle_read_int_event()
663 data->oper_state = NPCX_I2C_WAIT_STOP; in i2c_ctrl_handle_read_int_event()
667 data->oper_state = NPCX_I2C_READ_SUSPEND; in i2c_ctrl_handle_read_int_event()
682 if (data->oper_state == NPCX_I2C_IDLE) { in i2c_ctrl_proc_write_msg()
683 data->oper_state = NPCX_I2C_WAIT_START; in i2c_ctrl_proc_write_msg()
692 } else if (data->oper_state == NPCX_I2C_WRITE_SUSPEND) { in i2c_ctrl_proc_write_msg()
693 data->oper_state = NPCX_I2C_WRITE_FIFO; in i2c_ctrl_proc_write_msg()
700 data->oper_state, data->port); in i2c_ctrl_proc_write_msg()
713 if (data->oper_state == NPCX_I2C_IDLE) { in i2c_ctrl_proc_read_msg()
714 data->oper_state = NPCX_I2C_WAIT_START; in i2c_ctrl_proc_read_msg()
723 } else if (data->oper_state == NPCX_I2C_WRITE_SUSPEND) { in i2c_ctrl_proc_read_msg()
724 data->oper_state = NPCX_I2C_WAIT_RESTART; in i2c_ctrl_proc_read_msg()
730 } else if (data->oper_state == NPCX_I2C_READ_SUSPEND) { in i2c_ctrl_proc_read_msg()
731 data->oper_state = NPCX_I2C_READ_FIFO; in i2c_ctrl_proc_read_msg()
746 data->oper_state, data->port); in i2c_ctrl_proc_read_msg()
780 data->oper_state = NPCX_I2C_IDLE; in i2c_ctrl_target_isr()
791 data->oper_state = NPCX_I2C_IDLE; in i2c_ctrl_target_isr()
815 data->oper_state = NPCX_I2C_WRITE_FIFO; in i2c_ctrl_target_isr()
823 data->oper_state = NPCX_I2C_READ_FIFO; in i2c_ctrl_target_isr()
834 if (data->oper_state == NPCX_I2C_WRITE_FIFO) { in i2c_ctrl_target_isr()
840 } else if (data->oper_state == NPCX_I2C_READ_FIFO) { in i2c_ctrl_target_isr()
848 data->oper_state, data->port); in i2c_ctrl_target_isr()
870 LOG_DBG("status: %02x, %d", status, data->oper_state); in i2c_ctrl_isr()
891 data->oper_state = NPCX_I2C_ERROR_RECOVERY; in i2c_ctrl_isr()
907 data->oper_state = NPCX_I2C_WAIT_STOP; in i2c_ctrl_isr()
1087 if (data->oper_state != NPCX_I2C_IDLE) { in npcx_i2c_ctrl_target_register()
1125 if (data->oper_state != NPCX_I2C_IDLE) { in npcx_i2c_ctrl_target_unregister()
1172 if (data->oper_state != NPCX_I2C_WRITE_SUSPEND && in npcx_i2c_ctrl_transfer()
1173 data->oper_state != NPCX_I2C_READ_SUSPEND) { in npcx_i2c_ctrl_transfer()
1175 data->oper_state == NPCX_I2C_ERROR_RECOVERY) { in npcx_i2c_ctrl_transfer()
1217 if (data->oper_state == NPCX_I2C_WAIT_STOP) { in npcx_i2c_ctrl_transfer()
1221 data->oper_state = NPCX_I2C_IDLE; in npcx_i2c_ctrl_transfer()
1225 data->oper_state = NPCX_I2C_ERROR_RECOVERY; in npcx_i2c_ctrl_transfer()
1229 if (data->oper_state == NPCX_I2C_ERROR_RECOVERY || ret == -ETIMEDOUT) { in npcx_i2c_ctrl_transfer()
1293 data->oper_state = NPCX_I2C_IDLE; in i2c_ctrl_init()