diff options
Diffstat (limited to 'board/katsu/board.c')
-rw-r--r-- | board/katsu/board.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/board/katsu/board.c b/board/katsu/board.c index 5e1147c919..a91f2c4afa 100644 --- a/board/katsu/board.c +++ b/board/katsu/board.c @@ -239,6 +239,7 @@ int extpower_is_present(void) * so exclude such ports. */ int usb_c_extpower_present; + static int prev_usb_c_extpower_present; if (board_vbus_source_enabled(CHARGE_PORT_USB_C)) usb_c_extpower_present = 0; @@ -247,6 +248,14 @@ int extpower_is_present(void) CHARGE_PORT_USB_C, VBUS_PRESENT); + if (prev_usb_c_extpower_present != usb_c_extpower_present) { + if (usb_c_extpower_present) + host_set_single_event(EC_HOST_EVENT_AC_CONNECTED); + else + host_set_single_event(EC_HOST_EVENT_AC_DISCONNECTED); + prev_usb_c_extpower_present = usb_c_extpower_present; + } + return usb_c_extpower_present; } |