summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-09-25 16:06:41 -0700
committerCommit Bot <commit-bot@chromium.org>2020-09-26 03:02:07 +0000
commit233287d60adf9988f864bc0593717596ecd65a2c (patch)
tree0fcff7d3c648469656af38ca551ee465a25bdc29
parent289bb8aa3b431395d895105e6f44a58ef64c9543 (diff)
downloadchrome-ec-233287d60adf9988f864bc0593717596ecd65a2c.tar.gz
Coachz: Remove the reversed-plug detection for detachible base
The reversed-plug is not supported. Updated the TODO's and removed the reversed-plug detection. BRANCH=None BUG=b:169094188, b:168712053 TEST=Built the Coachz image. Change-Id: I15563c91e37bb752f15a7538bd1e19b9d922d5f9 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2432411 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
-rw-r--r--board/coachz/base_detect.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/board/coachz/base_detect.c b/board/coachz/base_detect.c
index 24ea3d51ef..ae485dc5ee 100644
--- a/board/coachz/base_detect.c
+++ b/board/coachz/base_detect.c
@@ -32,8 +32,6 @@
#define BASE_DETECT_RETRY_US (500 * MSEC)
/*
- * TODO(b:169094188): Clarify the pull-up value 601K or 100K?
- *
* Lid has 604K pull-up, base has 30.1K pull-down, so the
* ADC value should be around 30.1/(604+30.1)*3300 = 156
*
@@ -43,15 +41,6 @@
#define BASE_DETECT_MIN_MV 120
#define BASE_DETECT_MAX_MV 300
-/*
- * TODO(b:169094188): Clarify the pull-down present?
- *
- * When the base is connected in reverse, it presents a 100K pull-down,
- * so the ADC value should be around 100/(604+100)*3300 = 469
- */
-#define BASE_DETECT_REVERSE_MIN_MV 450
-#define BASE_DETECT_REVERSE_MAX_MV 500
-
/* Minimum ADC value to indicate base is disconnected for sure */
#define BASE_DETECT_DISCONNECT_MIN_MV 1500
@@ -71,7 +60,6 @@ enum base_status {
BASE_UNKNOWN = 0,
BASE_DISCONNECTED = 1,
BASE_CONNECTED = 2,
- BASE_CONNECTED_REVERSE = 3,
};
static enum base_status current_base_status;
@@ -113,7 +101,6 @@ static void base_detect_deferred(void)
uint64_t time_now = get_time().val;
int v;
uint32_t tmp_pulse_width = pulse_width;
- static int reverse_debounce = 1;
if (base_detect_debounce_time > time_now) {
hook_call_deferred(&base_detect_deferred_data,
@@ -127,29 +114,6 @@ static void base_detect_deferred(void)
print_base_detect_value(v, tmp_pulse_width);
- if (v >= BASE_DETECT_REVERSE_MIN_MV &&
- v <= BASE_DETECT_REVERSE_MAX_MV) {
- /*
- * If we are unlucky when we sample the ADC, we may think that
- * the base is connected in reverse, while this may just be a
- * transient. Force debouncing a little longer in that case.
- */
- if (current_base_status == BASE_CONNECTED_REVERSE)
- return;
-
- if (reverse_debounce == 0) {
- base_detect_change(BASE_CONNECTED_REVERSE);
- return;
- }
-
- reverse_debounce = 0;
- hook_call_deferred(&base_detect_deferred_data,
- BASE_DETECT_DEBOUNCE_US);
- return;
- }
- /* Reset reverse debounce */
- reverse_debounce = 1;
-
if (v >= BASE_DETECT_MIN_MV && v <= BASE_DETECT_MAX_MV) {
if (current_base_status != BASE_CONNECTED) {
base_detect_change(BASE_CONNECTED);