summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-02-20 11:02:47 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-21 02:02:09 +0000
commite9c6a03c8ae34dc6eb36b3d1e227521f99c256d3 (patch)
treec27ae4286ddee6bda28de068934f57e9d81b0ff5
parentdb19a8e2c9a3c97be2ef1894cf113130592edba5 (diff)
downloadchrome-ec-e9c6a03c8ae34dc6eb36b3d1e227521f99c256d3.tar.gz
samus_pd: remove resetting pericom 30 sec after detecting SDP
Remove resetting pericom 30 seconds after detecting SDP. This is not helpful anymore since we have fixed pericom detection problems and have a charge ramp for SDPs. BUG=chrome-os-partner:36813 BRANCH=samus TEST=connect samus A port to samus C port. this detects as SDP and ramps to 1A, but every 30 seconds resets the pericom. with this change it detects SDP, ramps to 1A and stays constant. Change-Id: I2400a06d237cef8c03f921960954dcf54d93de1e Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/251583 Reviewed-by: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/samus_pd/board.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c
index e25693599c..b98eb1552e 100644
--- a/board/samus_pd/board.c
+++ b/board/samus_pd/board.c
@@ -157,22 +157,15 @@ void set_usb_switches(int port, int open)
*/
#define USB_CHG_RESET_DELAY_MS 100
-/* Automatically do one redetection after a timeout period, for SDP ports. */
-#define USB_CHG_AUTO_REDETECT_TIMEOUT (30 * SECOND)
-
void usb_charger_task(void)
{
int port = (task_get_current() == TASK_ID_USB_CHG_P0 ? 0 : 1);
int device_type, charger_status;
struct charge_port_info charge;
- int type, redetect_timeout;
- uint32_t wake_event = 0;
+ int type;
charge.voltage = USB_BC12_CHARGE_VOLTAGE;
while (1) {
- /* By default, don't do automatic redetection */
- redetect_timeout = -1;
-
/* Read interrupt register to clear on chip */
pi3usb9281_get_interrupts(port);
@@ -226,18 +219,8 @@ void usb_charger_task(void)
type = CHARGE_SUPPLIER_BC12_CDP;
else if (device_type & PI3USB9281_TYPE_DCP)
type = CHARGE_SUPPLIER_BC12_DCP;
- else if (device_type & PI3USB9281_TYPE_SDP) {
- /*
- * Automatically do one redetection after a timeout
- * period when an SDP port is identified, since
- * pin contact order may have caused
- * misidentification.
- */
- if (wake_event != TASK_EVENT_TIMER)
- redetect_timeout =
- USB_CHG_AUTO_REDETECT_TIMEOUT;
+ else if (device_type & PI3USB9281_TYPE_SDP)
type = CHARGE_SUPPLIER_BC12_SDP;
- }
else
type = CHARGE_SUPPLIER_OTHER;
@@ -274,7 +257,7 @@ void usb_charger_task(void)
pd_send_host_event(PD_EVENT_POWER_CHANGE);
/* Wait for interrupt */
- wake_event = task_wait_event(redetect_timeout);
+ task_wait_event(-1);
}
}