i2c: npcx: Loosen requirements for target registration
Allow NPCX_I2C_ERROR_RECOVERY as a valid state when registering a target. Signed-off-by: Yuval Peress <peress@google.com>
This commit is contained in:
parent
270c98bc23
commit
6c73b5813f
@ -1237,9 +1237,13 @@ int npcx_i2c_ctrl_target_register(const struct device *i2c_dev,
|
||||
int addr_idx;
|
||||
|
||||
/* A transiaction is ongoing */
|
||||
if (data->oper_state != NPCX_I2C_IDLE) {
|
||||
if (data->oper_state != NPCX_I2C_IDLE && data->oper_state != NPCX_I2C_ERROR_RECOVERY) {
|
||||
LOG_ERR("Reg TGT in err state: %d", data->oper_state);
|
||||
return -EBUSY;
|
||||
}
|
||||
if (data->oper_state == NPCX_I2C_ERROR_RECOVERY) {
|
||||
LOG_WRN("Reg TGT in Recovery");
|
||||
}
|
||||
|
||||
/* Find valid smbaddr location */
|
||||
avail_addr_slot = find_lsb_set(~i2c_tgt_mask) - 1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user