Skip to content
Snippets Groups Projects
Commit ff229ecf authored by robertcnelson@gmail.com's avatar robertcnelson@gmail.com Committed by Tom Rini
Browse files

beagle: expansion boards: retry i2c_read with 16bit addressing


Some expansion boards now ship with at24 eeproms that need to communicate
via 16bit addressing.

Signed-off-by: default avatarRobert Nelson <robertcnelson@gmail.com>
parent b9f56698
No related branches found
No related tags found
No related merge requests found
......@@ -227,6 +227,14 @@ static unsigned int get_expansion_id(void)
i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
sizeof(expansion_config));
/* retry reading configuration data with 16bit addressing */
if ((expansion_config.device_vendor == 0xFFFFFF00) ||
(expansion_config.device_vendor == 0xFFFFFFFF)) {
printf("EEPROM is blank or 8bit addressing failed: retrying with 16bit:\n");
i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 2, (u8 *)&expansion_config,
sizeof(expansion_config));
}
i2c_set_bus_num(TWL4030_I2C_BUS);
return expansion_config.device_vendor;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment