summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
}