/* HDMI phy registers access through internal I2C bus.  */
static int hdmi_phy_i2c_write(uint16_t data, uint8_t addr)
/* HDMI phy registers access through internal I2C bus.  */
static int hdmi_phy_i2c_write(uint16_t data, uint8_t addr)
{
    HW_HDMI_IH_I2CMPHY_STAT0.U = 0xFF;
    HW_HDMI_PHY_I2CM_ADDRESS_ADDR.U = addr;
    HW_HDMI_PHY_I2CM_DATAO_1_ADDR.U = (uint8_t) (data >> 8);
    HW_HDMI_PHY_I2CM_DATAO_0_ADDR.U = (uint8_t) data;
    HW_HDMI_PHY_I2CM_OPERATION_ADDR.B.WRITE = 1;
    return hdmi_phy_wait_i2c_done(1000);
}