Commit 4a86ec48 authored by Stefan Roese's avatar Stefan Roese
Browse files

arm: mvebu: axp/high_speed_env_lib: Switch to DM_I2C API



After all Armada XP boards have been switched over from legacy I2C
support to DM I2C, let's now also convert this serdes code to use
the DM I2C API.
Signed-off-by: Stefan Roese's avatarStefan Roese <sr@denx.de>
parent 2f7dae27
......@@ -77,6 +77,7 @@ static u32 board_id_get(void)
__weak u8 board_sat_r_get(u8 dev_num, u8 reg)
{
struct udevice *udev;
u8 data;
u8 *dev;
u32 board_id = board_id_get();
......@@ -107,8 +108,11 @@ __weak u8 board_sat_r_get(u8 dev_num, u8 reg)
}
/* Read MPP module ID */
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
ret = i2c_read(dev[dev_num], 0, 1, (u8 *)&data, 1);
ret = i2c_get_chip_for_busnum(0, dev[dev_num], 1, &udev);
if (ret)
return MV_ERROR;
ret = dm_i2c_read(udev, 0, &data, 1);
if (ret)
return MV_ERROR;
......@@ -124,13 +128,18 @@ static int board_modules_scan(void)
/* Perform scan only for DB board */
if ((board_id == DB_88F78XX0_BP_ID) ||
(board_id == DB_88F78XX0_BP_REV2_ID)) {
struct udevice *udev;
/* reset modules flags */
config_module = 0;
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
ret = i2c_get_chip_for_busnum(0, MV_BOARD_PEX_MODULE_ADDR,
1, &udev);
if (ret)
return MV_ERROR;
/* SERDES module (only PEX model is supported now) */
ret = i2c_read(MV_BOARD_PEX_MODULE_ADDR, 0, 1, (u8 *)&val, 1);
ret = dm_i2c_read(udev, 0, &val, 1);
if (ret)
return MV_ERROR;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment