From: Hans de Goede Date: Fri, 22 Feb 2019 19:22:39 +0000 (+0100) Subject: usb: typec: pi3usb30532: Keep orientation when setting mux to safe mode X-Git-Tag: v5.2-rc1~132^2~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bfb2ab8e7138fc484952a948275eb443e8b9a360;p=thirdparty%2Flinux.git usb: typec: pi3usb30532: Keep orientation when setting mux to safe mode Keep the orientation value when setting the mux to safe mode, this fixes the orientation getting reset when switching alt-modes. Signed-off-by: Hans de Goede Acked-by: Heikki Krogerus Reviewed-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/typec/mux/pi3usb30532.c b/drivers/usb/typec/mux/pi3usb30532.c index 64eb5983e17a4..9294e85fd34b1 100644 --- a/drivers/usb/typec/mux/pi3usb30532.c +++ b/drivers/usb/typec/mux/pi3usb30532.c @@ -84,7 +84,8 @@ static int pi3usb30532_mux_set(struct typec_mux *mux, int state) 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) |