summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott <scollyer@chromium.org>2017-03-30 15:43:28 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2017-05-17 17:20:58 +0000
commit541f7b69ed276a9ccf014eae33249e3940e84e36 (patch)
tree753024025d7f1bcb1263ee212d0278490addbbfb
parentfd31304cdafd47666c78bb6f51a3c3a0f447d30f (diff)
downloadchrome-ec-541f7b69ed276a9ccf014eae33249e3940e84e36.tar.gz
servo_v4: Don't disable SBU mux when TypeC detach occurs
When a USB PD connection is made, servo_v4 senses the polarity of the SBU signals and sets the SBU mux for the deteted polarity. If the DUT is reset, the SBU mux needs to retain the same state so the H1 console USB endpoint is not disrupted. Modified the CCD_MODE_DISABLED case to no longer disable the SBU mux. In addition, removed the static variable ccd_mode as it was being set, but not ever being checked, so wasn't serving any purpose. BUG=b:36561120 BRANCH=servo_v4 TEST=Connect servo_v4 to Electro. On Electro EC console enter 'reboot' verify the H1 USB console remains connected. Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/464068 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Change-Id: I4f0f5167221c04314ca5be063411f200896bbdf6 Reviewed-on: https://chromium-review.googlesource.com/506958
-rw-r--r--board/servo_v4/board.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/board/servo_v4/board.c b/board/servo_v4/board.c
index 99a0fa1500..b843d56290 100644
--- a/board/servo_v4/board.c
+++ b/board/servo_v4/board.c
@@ -307,8 +307,6 @@ static void init_ioexpander(void)
/* Define voltage thresholds for SBU USB detection */
#define GND_MAX_MV 350
#define USB_HIGH_MV 1500
-/* Tracks current state of ccd */
-static int ccd_mode;
static void ccd_measure_sbu(void);
DECLARE_DEFERRED(ccd_measure_sbu);
@@ -327,16 +325,12 @@ static void ccd_measure_sbu(void)
/* SBU flip = 1 */
write_ioexpander(0, 2, 1);
msleep(10);
- gpio_set_level(GPIO_SBU_MUX_EN, 1);
- ccd_mode = CCD_MODE_ENABLED;
CPRINTS("CCD: connected flip");
} else if ((sbu2 > USB_HIGH_MV) &&
(sbu1 < GND_MAX_MV)) {
/* SBU flip = 0 */
write_ioexpander(0, 2, 0);
msleep(10);
- gpio_set_level(GPIO_SBU_MUX_EN, 1);
- ccd_mode = CCD_MODE_ENABLED;
CPRINTS("CCD: connected noflip");
} else {
/* Measure again after 100 msec */
@@ -355,10 +349,12 @@ void ccd_set_mode(enum ccd_mode new_mode)
/* Disable ccd_measure_sbu deferred call always */
hook_call_deferred(&ccd_measure_sbu_data, -1);
- /* Turn off CCD */
- gpio_set_level(GPIO_SBU_MUX_EN, 0);
- CPRINTS("CCD: disconnect");
- ccd_mode = CCD_MODE_DISABLED;
+ /*
+ * The DUT port has detected a detach event. Don't want to
+ * disconnect the SBU mux here so that the H1 USB console can
+ * remain connected.
+ */
+ CPRINTS("CCD: TypeC detach, no change to SBU mux");
}
}
@@ -385,7 +381,11 @@ static void board_init(void)
init_ioexpander();
init_uservo_port();
- /* Initialize CCD mode and disable sbu mux. */
- ccd_set_mode(CCD_MODE_DISABLED);
+ /*
+ * Enable SBU mux. The polarity is set each time a new PD attach event
+ * occurs. But, the SBU mux is not disabled on detach so that the H1 USB
+ * console will survie a DUT EC reset.
+ */
+ gpio_set_level(GPIO_SBU_MUX_EN, 1);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);