Skip to contentSkip to conversation

usb: typec: pi3usb30532: Keep orientation when setting mux to safe mode

DISCUSSION Heikki Krogerus 1 participant 1 message Mar 19, 2019 USB

lore
Share & tools
lore
#0 lore raw
Quoted 7 lines · Heikki Krogerus
Quoted 4 lines · Hans de Goede

Keep the orientation value when setting the mux to safe mode, this fixes the orientation getting reset when switching alt-modes.

Also applied to my typec-next branch:
https://github.com/krohei/linux/commit/4002f81b327b4537dead79ed6117dcb8065d2dca

Quoted 10 lines
Quoted 10 lines
---
 drivers/usb/typec/mux/pi3usb30532.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/typec/mux/pi3usb30532.c +0 -0
index 64eb5983e17a..9294e85fd34b 100644
@@ -84,7 +84,8 @@ static int pi3usb30532_mux_set(struct typec_mux *mux, int state)
 
Quoted 10 lines
Quoted 10 lines
drivers/usb/typec/mux/pi3usb30532.c +2 -1
 	switch (state) {
 	case TYPEC_STATE_SAFE:
-		new_conf = PI3USB30532_CONF_OPEN;
+		new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
+			   PI3USB30532_CONF_OPEN;
 		break;
 	case TYPEC_STATE_USB:
 		new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
Signature · 1 line
2.20.1

thanks,