Skip to content

Commit e4f518b

Browse files
GTLin08fabiobaltieri
authored andcommitted
drivers/i2c: it8xxx2: Add port info to error logs
Improve I2C error logs by adding port number to all timeout and host error messages, making it easier to identify which controller reports failures. Signed-off-by: Tim Lin <[email protected]>
1 parent 82ed28f commit e4f518b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/i2c/i2c_ite_it8xxx2.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,22 @@ static int i2c_parsing_return_value(const struct device *dev)
144144
LOG_ERR("I2C ch%d Address:0x%X Transaction time out.",
145145
config->port, data->addr_16bit);
146146
} else {
147-
LOG_DBG("I2C ch%d Address:0x%X Host error bits message:",
148-
config->port, data->addr_16bit);
149147
/* Host error bits message*/
150148
if (data->err & HOSTA_TMOE) {
151-
LOG_ERR("Time-out error: hardware time-out error.");
149+
LOG_ERR("I2C ch%d Address:0x%X Time-out error: hardware time-out error.",
150+
config->port, data->addr_16bit);
152151
}
153152
if (data->err & HOSTA_NACK) {
154-
LOG_DBG("NACK error: device does not response ACK.");
153+
LOG_DBG("I2C ch%d Address:0x%X NACK error: device does not response ACK.",
154+
config->port, data->addr_16bit);
155155
}
156156
if (data->err & HOSTA_FAIL) {
157-
LOG_ERR("Fail: a processing transmission is killed.");
157+
LOG_ERR("I2C ch%d Address:0x%X Fail: a processing transmission is killed.",
158+
config->port, data->addr_16bit);
158159
}
159160
if (data->err & HOSTA_BSER) {
160-
LOG_ERR("BUS error: SMBus has lost arbitration.");
161+
LOG_ERR("I2C ch%d Address:0x%X BUS error: SMBus has lost arbitration.",
162+
config->port, data->addr_16bit);
161163
}
162164
}
163165

0 commit comments

Comments
 (0)