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 <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27469
1 file changed