summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyushee Shah <ayushee.shah@intel.com>2021-04-22 10:23:02 -0700
committerCommit Bot <commit-bot@chromium.org>2021-06-29 19:29:20 +0000
commite1807baa12054ec4adfb4319506f960ea9046df5 (patch)
tree261c0dab5962e119540379678658c922df4bd8b9
parent400f2560bf37f92c94ab090d0223685785eae3cd (diff)
downloadchrome-ec-e1807baa12054ec4adfb4319506f960ea9046df5.tar.gz
usb_mux: Remove disconnect latch flag
With dark resume enabled, disconnect latch flag is obsolete BUG=None BRANCH=None TEST=Swapping Type C devices in s0ix works Signed-off-by: Ayushee Shah <ayushee.shah@intel.com> Change-Id: Ica1b55f820f5b3fff5b7dabf88ca57ac0993f246 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2846417 Reviewed-by: Madhusudanarao Amara <madhusudanarao.amara@intel.corp-partner.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--driver/usb_mux/usb_mux.c53
-rw-r--r--include/usb_mux.h18
2 files changed, 1 insertions, 70 deletions
diff --git a/driver/usb_mux/usb_mux.c b/driver/usb_mux/usb_mux.c
index ad347c284f..f3418556d0 100644
--- a/driver/usb_mux/usb_mux.c
+++ b/driver/usb_mux/usb_mux.c
@@ -35,11 +35,8 @@ static uint32_t flags[CONFIG_USB_PD_PORT_MAX_COUNT];
/* Device is in low power mode. */
#define USB_MUX_FLAG_IN_LPM BIT(0)
-/* The following bit is used to configure virtual mux in disconnect mode */
-#define USB_MUX_FLAG_DISCONNECT_LATCH BIT(1)
-
/* Device initialized at least once */
-#define USB_MUX_FLAG_INIT BIT(2)
+#define USB_MUX_FLAG_INIT BIT(1)
enum mux_config_type {
USB_MUX_INIT,
@@ -66,12 +63,6 @@ static int configure_mux(int port,
*mux_state = USB_PD_MUX_NONE;
}
- if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND) &&
- ((config == USB_MUX_SET_MODE && *mux_state == USB_PD_MUX_NONE) ||
- config == USB_MUX_INIT)) {
- usb_mux_set_disconnect_latch_flag(port, true);
- }
-
/*
* a MUX for a particular port can be a linked list chain of
* MUXes. So when we change one, we traverse the whole list
@@ -285,35 +276,6 @@ mux_state_t usb_mux_get(int port)
return rv ? USB_PD_MUX_NONE : mux_state;
}
-/* Get USB MUX (virtual MUX) disconnect flag */
-bool usb_mux_get_disconnect_latch_flag(int port)
-{
- bool rv = false;
-
- if (port >= board_get_usb_pd_port_count())
- return rv;
-
- if (!IS_ENABLED(CONFIG_USB_MUX_VIRTUAL))
- return rv;
-
- return !!(flags[port] & USB_MUX_FLAG_DISCONNECT_LATCH);
-}
-
-/* Set USB MUX (virtual MUX) disconnect flag */
-void usb_mux_set_disconnect_latch_flag(int port, bool enable)
-{
- if (port >= board_get_usb_pd_port_count())
- return;
-
- if (!IS_ENABLED(CONFIG_USB_MUX_VIRTUAL))
- return;
-
- if (enable)
- atomic_or(&flags[port], USB_MUX_FLAG_DISCONNECT_LATCH);
- else
- atomic_clear_bits(&flags[port], USB_MUX_FLAG_DISCONNECT_LATCH);
-}
-
void usb_mux_flip(int port)
{
mux_state_t mux_state;
@@ -464,19 +426,6 @@ static enum ec_status hc_usb_pd_mux_info(struct host_cmd_handler_args *args)
r->flags = mux_state;
- /*
- * Force disconnect mode if disconnect latch flag is set.
- * Send host event for configuring the latest mux state
- */
- if (IS_ENABLED(CONFIG_USB_MUX_VIRTUAL) &&
- usb_mux_get_disconnect_latch_flag(port)) {
- r->flags = USB_PD_MUX_NONE;
- usb_mux_set_disconnect_latch_flag(port, false);
- args->response_size = sizeof(*r);
- host_set_single_event(EC_HOST_EVENT_USB_MUX);
- return EC_RES_SUCCESS;
- }
-
/* Clear HPD IRQ event since we're about to inform host of it. */
if (IS_ENABLED(CONFIG_USB_MUX_VIRTUAL) &&
(r->flags & USB_PD_MUX_HPD_IRQ)) {
diff --git a/include/usb_mux.h b/include/usb_mux.h
index f3d18a7874..61a2c5167b 100644
--- a/include/usb_mux.h
+++ b/include/usb_mux.h
@@ -261,22 +261,4 @@ void usb_mux_hpd_update(int port, int hpd_lvl, int hpd_irq);
*/
int usb_mux_retimer_fw_update_port_info(void);
-/**
- * Get the disconnect latch flag so that the Kernel Mux driver doesn't
- * miss the unnoticed disconnection status.
- *
- * @param port port number.
- * @return status of disconnect latch flag
- */
-bool usb_mux_get_disconnect_latch_flag(int port);
-
-/**
- * Set the disconnect latch flag if the Type-C devices are disconnected and
- * the information is not yet updated to Kernel Mux driver.
- *
- * @param port port number
- * @param enable whether to enable or disable the disconnect latch flag
- */
-void usb_mux_set_disconnect_latch_flag(int port, bool enable);
-
#endif