linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Hans de Goede <hdegoede@redhat.com>, Jun Li <jun.li@nxp.com>,
	Mats Karrman <mats.dev.list@gmail.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 7/8] usb: typec: pi3usb30532: Start using generic state values
Date: Wed, 27 Jun 2018 18:19:52 +0300	[thread overview]
Message-ID: <20180627151953.30942-8-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <20180627151953.30942-1-heikki.krogerus@linux.intel.com>

Instead of the tcpm specific mux states, using the generic
USB Type-C connector state values, and with DisplayPort
using connector states defined for the DisplayPort Alt Mode.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/mux/pi3usb30532.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/typec/mux/pi3usb30532.c b/drivers/usb/typec/mux/pi3usb30532.c
index b0e88db60ecf..64eb5983e17a 100644
--- a/drivers/usb/typec/mux/pi3usb30532.c
+++ b/drivers/usb/typec/mux/pi3usb30532.c
@@ -9,7 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
-#include <linux/usb/tcpm.h>
+#include <linux/usb/typec_dp.h>
 #include <linux/usb/typec_mux.h>
 
 #define PI3USB30532_CONF			0x00
@@ -83,21 +83,24 @@ static int pi3usb30532_mux_set(struct typec_mux *mux, int state)
 	new_conf = pi->conf;
 
 	switch (state) {
-	case TYPEC_MUX_NONE:
+	case TYPEC_STATE_SAFE:
 		new_conf = PI3USB30532_CONF_OPEN;
 		break;
-	case TYPEC_MUX_USB:
+	case TYPEC_STATE_USB:
 		new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
 			   PI3USB30532_CONF_USB3;
 		break;
-	case TYPEC_MUX_DP:
+	case TYPEC_DP_STATE_C:
+	case TYPEC_DP_STATE_E:
 		new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
 			   PI3USB30532_CONF_4LANE_DP;
 		break;
-	case TYPEC_MUX_DOCK:
+	case TYPEC_DP_STATE_D:
 		new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
 			   PI3USB30532_CONF_USB3_AND_2LANE_DP;
 		break;
+	default:
+		break;
 	}
 
 	ret = pi3usb30532_set_conf(pi, new_conf);
-- 
2.18.0


  parent reply	other threads:[~2018-06-27 15:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-27 15:19 [PATCH 0/8] usb: typec: Support for Alternate Modes Heikki Krogerus
2018-06-27 15:19 ` [PATCH 1/8] usb: pd: include kernel.h Heikki Krogerus
2018-07-09 18:58   ` Guenter Roeck
2018-06-27 15:19 ` [PATCH 2/8] usb: typec: function for checking cable plug orientation Heikki Krogerus
2018-07-09 18:59   ` Guenter Roeck
2018-06-27 15:19 ` [PATCH 3/8] usb: typec: mux: Get the mux identifier from function parameter Heikki Krogerus
2018-06-28 10:51   ` Greg Kroah-Hartman
2018-06-28 11:34     ` Heikki Krogerus
2018-07-09 19:03       ` Guenter Roeck
2018-07-20 10:53         ` Heikki Krogerus
2018-06-27 15:19 ` [PATCH 4/8] usb: typec: Register a device for every mode Heikki Krogerus
2018-06-27 15:19 ` [PATCH 5/8] usb: typec: Bus type for alternate modes Heikki Krogerus
2018-06-27 15:19 ` [PATCH 6/8] usb: typec: Add driver for DisplayPort alternate mode Heikki Krogerus
2018-06-27 15:19 ` Heikki Krogerus [this message]
2018-06-27 15:19 ` [PATCH 8/8] usb: typec: tcpm: Support for Alternate Modes Heikki Krogerus
2018-06-29 14:21 ` [PATCH 0/8] usb: typec: " Heikki Krogerus
2018-07-01 12:08 ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180627151953.30942-8-heikki.krogerus@linux.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=jun.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mats.dev.list@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).