chrome_ec: disable ccd when we use servo v4

We need to disable ccd even if we are using servo micro. The servo v4
captive cable is used for the data connection between servo v4 and the
DUT even if we are using servo micro instead of ccd. We want to make
sure that cable does not appear as a debug accessory, because that may
cause cr50 to enable ccd even if we are not using it. This change
disables the debug mode when ccd_disable is called and we are using
servo v4 to run the test.

BUG=none
BRANCH=none
TEST=plug the servo v4 captive cable into the cr50 ccd port and run
firmware_Cr50USB

Change-Id: I20a113b0864962d2b5e1735e14024a213f3be4b8
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/513618
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
diff --git a/server/cros/servo/chrome_ec.py b/server/cros/servo/chrome_ec.py
index f5923c7..bc4ffcd 100644
--- a/server/cros/servo/chrome_ec.py
+++ b/server/cros/servo/chrome_ec.py
@@ -404,6 +404,11 @@
         return self.get_version_info(self.ACTIVE)
 
 
+    def using_servo_v4(self):
+        """Returns true if the console is being served using servo v4"""
+        return 'servo_v4' in self._servo.get_servo_version()
+
+
     def using_ccd(self):
         """Returns true if the console is being served using CCD"""
         return 'ccd_cr50' in self._servo.get_servo_version()
@@ -453,12 +458,12 @@
         self.wait_for_ccd_state('on', timeout)
 
 
-    @ccd_command
     def ccd_disable(self):
         """Change the values of the CC lines to disable CCD"""
-        logging.info("disable ccd")
-        self._servo.set_nocheck('servo_v4_ccd_mode', 'disconnect')
-        self.wait_for_ccd_disable()
+        if self.using_servo_v4():
+            logging.info("disable ccd")
+            self._servo.set_nocheck('servo_v4_dts_mode', 'off')
+            self.wait_for_ccd_disable()
 
 
     @ccd_command
@@ -466,6 +471,6 @@
         """Reenable CCD and reset servo interfaces"""
         logging.info("reenable ccd")
         self._servo.set_nocheck('servo_v4_ccd_mode', 'ccd')
-        self._servo.set('sbu_mux_enable', 'on')
+        self._servo.set_nocheck('servo_v4_dts_mode', 'on')
         self._servo.set_nocheck('power_state', 'ccd_reset')
         self.wait_for_ccd_enable()