i2c: Move host command processing into a function
i2c: Move host command processing into a function

We are about to add more logic here, so move it this code out of
the event handler and into its own function.

BUG=chrome-os-partner:11317
TEST=manual and a bit ad-hoc:
(note, this testing is not completed yet)
Check that snow and link still process commands correctly over I2C
from U-Boot. At this stage only the old interface is supported.
SMDK5250 # mkbp test
Old interface:

New interface:
Version 0: ec_command() returned error
Test failed with error -1
SMDK5250 #

Change-Id: I5387eb5533ab6faa27769f4cf21075387357371d
Signed-off-by: Simon Glass <c00b0378376498bd9cd974c388df8854c0131d27@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27469

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