Fixed missing mask register setting for I2C
Removed redundant code in serial_api