fru-device: Refine addressing mode detection logic

Existing EEPROM addressing mode detection logic doesn't work on some
devices (24C128 in my case) after an AC cycle so refine the logic
by setting the higher data word address bits to 0. It's safe on 8-bit
addressing EEPROMs because it doesn't write any actual data.

Tested: Both 8-bit and 16-bit EEPROMs were detected as expected.

Signed-off-by: Jae Hyun Yoo <quic_jaehyoo@quicinc.com>
Change-Id: Ia7d5f52b38529b848fb7293b2e509c2a5e40ab43
diff --git a/src/FruDevice.cpp b/src/FruDevice.cpp
index 1c49974..59d94d4 100644
--- a/src/FruDevice.cpp
+++ b/src/FruDevice.cpp
@@ -191,6 +191,14 @@
 
 static int isDevice16Bit(int file)
 {
+    // Set the higher data word address bits to 0. It's safe on 8-bit addressing
+    // EEPROMs because it doesn't write any actual data.
+    int ret = i2c_smbus_write_byte(file, 0);
+    if (ret < 0)
+    {
+        return ret;
+    }
+
     /* Get first byte */
     int byte1 = i2c_smbus_read_byte_data(file, 0);
     if (byte1 < 0)