Upgrade to Google EC API v1 (re-send).

Basically this is a re-send of 1c4b784 (which is reverted in cf6e3a3),
but added extra code:

1. add an extra wait_for_ec() before outb(cmd) in v1 API.

2. don't jump if EC is running the target copy. This is to fix the bug
   that REBOOT_EC would response 2 SUCCESSes.

3. upgrade i2c to v1 as well.

4. fix a bug in original CL that forgets to negative resp_buf[0] for
   return value.

BUG=chrome-os-partner:11320
TEST=build and tested on link and snow:
F="flashrom -p internal:bus=lpc -V "
for i in `seq 0 19`; do
        $F -w ec.bin.1 || exit 1
        $F -w ec.bin.2 || exit 2
done

Change-Id: I9a1364dcbcb8e9006b9b61fd72c20491900c5a12
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29874
Reviewed-by: David Hendricks <dhendrix@chromium.org>
diff --git a/programmer.h b/programmer.h
index 55bc7a7..3eaa602 100644
--- a/programmer.h
+++ b/programmer.h
@@ -678,7 +678,7 @@
 int gec_prepare(uint8_t *image, int size);
 struct gec_priv {
 	int detected;
-	int (*ec_command)(int command, const void *indata, int insize,
+	int (*ec_command)(int command, int ver, const void *indata, int insize,
 			  void *outdata, int outsize);
 };
 int gec_probe_size(struct flashchip *flash);