summaryrefslogtreecommitdiff
path: root/common/i2c_master.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/i2c_master.c')
-rw-r--r--common/i2c_master.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/i2c_master.c b/common/i2c_master.c
index 5975570fdb..d5eeaab04b 100644
--- a/common/i2c_master.c
+++ b/common/i2c_master.c
@@ -1029,8 +1029,13 @@ static void scan_bus(int port, const char *desc)
(level & I2C_LINE_SCL_HIGH) ? 1 : 0);
goto scan_bus_exit;
}
-
- for (addr_flags = 0; addr_flags <= 0xEF; ++addr_flags) {
+ /*
+ * Only scan in the valid client device address range, otherwise some
+ * client devices stretch the clock in weird ways that prevent the
+ * discovery of other devices.
+ */
+ for (addr_flags = I2C_FIRST_VALID_ADDR;
+ addr_flags <= I2C_LAST_VALID_ADDR; ++addr_flags) {
watchdog_reload(); /* Otherwise a full scan trips watchdog */
ccputs(".");