int mhl_tx_read_reg_block(void *drv_context, u8 page, u8 offset, u8 count, u8 *values) { int ret; ret = platform_read_i2c_block(i2c_bus_adapter, page, offset, count, values); if (ret != 2) { MHL_TX_DBG_ERR(drv_context, "I2c read failed, 0x%02x:0x%02x\n", page, offset); ret = -EIO; } else { ret = 0; DUMP_I2C_TRANSFER(drv_context, page, offset, count, values, false); } return ret; }
int mhl_pf_read_reg_block(u8 page, u8 offset, u8 count, u8 *values) { int ret; ret = platform_read_i2c_block(i2c_bus_adapter , page , offset , count , values ); if (ret == -MHL_I2C_NOT_AVAILABLE) { pr_info("%s:chip power is off:0x%04x\n", __func__, ret); pr_info("%s:0x%02x:0x%02x\n", __func__, page, offset); return ret; } else if (ret != 2) { pr_err("%s:I2c read failed, 0x%02x:0x%02x\n", __func__, page, offset); ret = -EIO; } else { ret = 0; DUMP_I2C_TRANSFER(NULL, page, offset, count, values, false); } return ret; }