From: Kyle Tso <kyletso@google.com>
To: linux@roeck-us.net, heikki.krogerus@linux.intel.com,
gregkh@linuxfoundation.org, hdegoede@redhat.com,
robh+dt@kernel.org
Cc: badhri@google.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Kyle Tso <kyletso@google.com>
Subject: [PATCH v6 5/7] usb: typec: displayport: Fill the negotiated SVDM Version in the header
Date: Fri, 5 Feb 2021 11:34:13 +0800 [thread overview]
Message-ID: <20210205033415.3320439-6-kyletso@google.com> (raw)
In-Reply-To: <20210205033415.3320439-1-kyletso@google.com>
VDM header now requires SVDM Version. Get it from typec_partner.
Signed-off-by: Kyle Tso <kyletso@google.com>
---
Changes since v5:
- follow the changes of "usb: typec: Manage SVDM version"
drivers/usb/typec/altmodes/displayport.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
index 0abc3121238f..b7f094435b00 100644
--- a/drivers/usb/typec/altmodes/displayport.c
+++ b/drivers/usb/typec/altmodes/displayport.c
@@ -15,8 +15,8 @@
#include <linux/usb/typec_dp.h>
#include "displayport.h"
-#define DP_HEADER(_dp, cmd) (VDO((_dp)->alt->svid, 1, SVDM_VER_1_0, cmd) | \
- VDO_OPOS(USB_TYPEC_DP_MODE))
+#define DP_HEADER(_dp, ver, cmd) (VDO((_dp)->alt->svid, 1, ver, cmd) \
+ | VDO_OPOS(USB_TYPEC_DP_MODE))
enum {
DP_CONF_USB,
@@ -156,9 +156,14 @@ static int dp_altmode_configured(struct dp_altmode *dp)
static int dp_altmode_configure_vdm(struct dp_altmode *dp, u32 conf)
{
- u32 header = DP_HEADER(dp, DP_CMD_CONFIGURE);
+ int svdm_version = typec_altmode_get_svdm_version(dp->alt);
+ u32 header;
int ret;
+ if (svdm_version < 0)
+ return svdm_version;
+
+ header = DP_HEADER(dp, svdm_version, DP_CMD_CONFIGURE);
ret = typec_altmode_notify(dp->alt, TYPEC_STATE_SAFE, &dp->data);
if (ret) {
dev_err(&dp->alt->dev,
@@ -181,6 +186,7 @@ static int dp_altmode_configure_vdm(struct dp_altmode *dp, u32 conf)
static void dp_altmode_work(struct work_struct *work)
{
struct dp_altmode *dp = container_of(work, struct dp_altmode, work);
+ int svdm_version;
u32 header;
u32 vdo;
int ret;
@@ -194,7 +200,10 @@ static void dp_altmode_work(struct work_struct *work)
dev_err(&dp->alt->dev, "failed to enter mode\n");
break;
case DP_STATE_UPDATE:
- header = DP_HEADER(dp, DP_CMD_STATUS_UPDATE);
+ svdm_version = typec_altmode_get_svdm_version(dp->alt);
+ if (svdm_version < 0)
+ break;
+ header = DP_HEADER(dp, svdm_version, DP_CMD_STATUS_UPDATE);
vdo = 1;
ret = typec_altmode_vdm(dp->alt, header, &vdo, 2);
if (ret)
--
2.30.0.365.g02bc693789-goog
next prev parent reply other threads:[~2021-02-05 3:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 3:34 [PATCH v6 0/7] common SVDM version and VDO from dt Kyle Tso
2021-02-05 3:34 ` [PATCHi v6 1/7] usb: typec: Manage SVDM version Kyle Tso
2021-02-12 4:09 ` Guenter Roeck
2021-02-05 3:34 ` [PATCH v6 2/7] usb: pd: Make SVDM Version configurable in VDM header Kyle Tso
2021-02-12 4:09 ` Guenter Roeck
2021-02-05 3:34 ` [PATCH v6 3/7] usb: typec: tcpm: Determine common SVDM Version Kyle Tso
2021-02-12 4:17 ` Guenter Roeck
2021-02-12 7:10 ` Kyle Tso
2021-02-12 7:24 ` Kyle Tso
2021-02-12 15:18 ` Guenter Roeck
2021-02-12 15:20 ` Guenter Roeck
2021-02-05 3:34 ` [PATCH v6 4/7] usb: typec: ucsi: " Kyle Tso
2021-02-12 4:18 ` Guenter Roeck
2021-02-05 3:34 ` Kyle Tso [this message]
2021-02-12 4:19 ` [PATCH v6 5/7] usb: typec: displayport: Fill the negotiated SVDM Version in the header Guenter Roeck
2021-02-05 3:34 ` [PATCH v6 6/7] dt-bindings: connector: Add SVDM VDO properties Kyle Tso
2021-02-05 21:29 ` Rob Herring
2021-02-06 0:29 ` Kyle Tso
2021-02-12 4:21 ` Guenter Roeck
2021-02-12 7:28 ` Kyle Tso
2021-02-05 3:34 ` [PATCH v6 7/7] usb: typec: tcpm: Get Sink VDO from fwnode Kyle Tso
2021-02-12 4:21 ` Guenter Roeck
2021-02-05 11:42 ` [PATCH v6 0/7] common SVDM version and VDO from dt Heikki Krogerus
2021-02-05 12:20 ` Guenter Roeck
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=20210205033415.3320439-6-kyletso@google.com \
--to=kyletso@google.com \
--cc=badhri@google.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh+dt@kernel.org \
/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).