diff mbox series

[2/6] usb: typec: ucsi: Workaround for missed op_mode change

Message ID 20200423132058.6972-3-heikki.krogerus@linux.intel.com (mailing list archive)
State Mainlined
Commit a0d4618788f26bd6f31f80a00f922f1c4bc66457
Headers show
Series ucsi driver changes for v5.8 | expand

Commit Message

Heikki Krogerus April 23, 2020, 1:20 p.m. UTC
From: "K V, Abhilash" <abhilash.k.v@intel.com>

EC firmware on Dell XPS & Latitude series does not set "Power Operation
Mode Change" bit in "Connector Status change" field of MESSAGE IN Data
while transitioning from type-C current to PD mode.

Instead the "Negotiated Power Level Change" bit is set when the "Power
Operation Mode" field shows the correct mode (i.e. PD).

This patch adds a check for this bit also, to trigger an update of
power operation mode in class driver, while handling GET_CONNECTOR_STATUS
command.

Signed-off-by: K V, Abhilash <abhilash.k.v@intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index e9baa9a749e5..0c7c3f9b1b50 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -613,7 +613,8 @@  static void ucsi_handle_connector_change(struct work_struct *work)
 
 	role = !!(con->status.flags & UCSI_CONSTAT_PWR_DIR);
 
-	if (con->status.change & UCSI_CONSTAT_POWER_OPMODE_CHANGE)
+	if (con->status.change & UCSI_CONSTAT_POWER_OPMODE_CHANGE ||
+	    con->status.change & UCSI_CONSTAT_POWER_LEVEL_CHANGE)
 		ucsi_pwr_opmode_change(con);
 
 	if (con->status.change & UCSI_CONSTAT_POWER_DIR_CHANGE) {