lm4: move I2C transfer state machine to interrupt handler
lm4: move I2C transfer state machine to interrupt handler

This significantly decreases the task swapping overhead when doing
many transfers.

Also fix a bug where on error, i2c_xfer() would issue a stop
condition, but not actually wait for it to complete before returning;
this could interfere with the next transfer in a back-to-back
scenario.

BUG=chrome-os-partner:25015
BRANCH=lm4 (more specifically, rambi and derivatives)
TEST=battery command should show the same info as before
     i2cscan should show devices at bus 0 0x12, 0x16, bus 5 0x98
     no charger errors on boot

Change-Id: I2195f0f9800b03a54fa33170dbae6705382578c7
Signed-off-by: Randall Spangler <62698fdbb84d1779579ee80c3f39fac22017e5bc@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/182503
Reviewed-by: Alec Berg <1a4429eeda29095a12e19a73405f80f5b7f37a63@chromium.org>
Reviewed-by: Yung-chieh Lo <2d80bee8408e64f859a1b5868bd3b311c0a4b4cd@chromium.org>

coreboot/chrome-ec,thehobn/ec,eatbyte/chromium-ec,eatbyte/chromium-ec,gelraen/cros-ec,akappy7/ChromeOS_EC_LED_Diagnostics,coreboot/chrome-ec,md5555/ec,thehobn/ec,fourier49/BIZ_EC,fourier49/BZ_DEV_EC,thehobn/ec,eatbyte/chromium-ec,akappy7/ChromeOS_EC_LED_Diagnostics,fourier49/BIZ_EC,md5555/ec,mtk09422/chromiumos-platform-ec,alterapraxisptyltd/chromium-ec,longsleep/ec,gelraen/cros-ec,eatbyte/chromium-ec,gelraen/cros-ec,mtk09422/chromiumos-platform-ec,longsleep/ec,mtk09422/chromiumos-platform-ec,alterapraxisptyltd/chromium-ec,coreboot/chrome-ec,thehobn/ec,md5555/ec,coreboot/chrome-ec,fourier49/BZ_DEV_EC,akappy7/ChromeOS_EC_LED_Diagnostics,alterapraxisptyltd/chromium-ec,akappy7/ChromeOS_EC_LED_Diagnostics,fourier49/BIZ_EC,akappy7/ChromeOS_EC_LED_Diagnostics,fourier49/BZ_DEV_EC,mtk09422/chromiumos-platform-ec,md5555/ec,gelraen/cros-ec,fourier49/BZ_DEV_EC,fourier49/BIZ_EC,alterapraxisptyltd/chromium-ec,longsleep/ec,longsleep/ec,coreboot/chrome-ec,coreboot/chrome-ec