From: Wayne Chang <waynec@nvidia.com>
To: <heikki.krogerus@linux.intel.com>, <gregkh@linuxfoundation.org>
Cc: <waynec@nvidia.com>, <Sanket.Goswami@amd.com>,
<singhanc@nvidia.com>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 1/1] usb: typec: ucsi_ccg: Disable UCSI ALT support on Tegra
Date: Wed, 28 Sep 2022 21:16:15 +0800 [thread overview]
Message-ID: <20220928131615.3286936-1-waynec@nvidia.com> (raw)
From: Sing-Han Chen <singhanc@nvidia.com>
Firmware built for Tegra doesn't support UCSI ALT
command and has known issue of reporting wrong
capability info.
This commit disables UCSI ALT support when reading
the capability on Tegra.
Signed-off-by: Sing-Han Chen <singhanc@nvidia.com>
Signed-off-by: Wayne Chang <waynec@nvidia.com>
---
drivers/usb/typec/ucsi/ucsi_ccg.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index 5c0bf48be766..fde3da0605f5 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -122,9 +122,14 @@ struct version_format {
* Firmware version 3.1.10 or earlier, built for NVIDIA has known issue
* of missing interrupt when a device is connected for runtime resume
*/
-#define CCG_FW_BUILD_NVIDIA (('n' << 8) | 'v')
+#define CCG_FW_BUILD_NVIDIA_RTX (('n' << 8) | 'v')
#define CCG_OLD_FW_VERSION (CCG_VERSION(0x31) | CCG_VERSION_PATCH(10))
+/* Firmware for Tegra doesn't support UCSI ALT command, built
+ * for NVIDIA has known issue of reporting wrong capability info
+ */
+#define CCG_FW_BUILD_NVIDIA_TEGRA (('g' << 8) | 'n')
+
/* Altmode offset for NVIDIA Function Test Board (FTB) */
#define NVIDIA_FTB_DP_OFFSET (2)
#define NVIDIA_FTB_DBG_OFFSET (3)
@@ -513,6 +518,7 @@ static int ucsi_ccg_read(struct ucsi *ucsi, unsigned int offset,
{
struct ucsi_ccg *uc = ucsi_get_drvdata(ucsi);
u16 reg = CCGX_RAB_UCSI_DATA_BLOCK(offset);
+ struct ucsi_capability *cap;
struct ucsi_altmode *alt;
int ret;
@@ -536,6 +542,12 @@ static int ucsi_ccg_read(struct ucsi *ucsi, unsigned int offset,
ucsi_ccg_nvidia_altmode(uc, alt);
}
break;
+ case UCSI_GET_CAPABILITY:
+ if (uc->fw_build == CCG_FW_BUILD_NVIDIA_TEGRA) {
+ cap = val;
+ cap->features &= ~UCSI_CAP_ALT_MODE_DETAILS;
+ }
+ break;
default:
break;
}
@@ -1452,7 +1464,7 @@ static int ucsi_ccg_runtime_resume(struct device *dev)
* of missing interrupt when a device is connected for runtime resume.
* Schedule a work to call ISR as a workaround.
*/
- if (uc->fw_build == CCG_FW_BUILD_NVIDIA &&
+ if (uc->fw_build == CCG_FW_BUILD_NVIDIA_RTX &&
uc->fw_version <= CCG_OLD_FW_VERSION)
schedule_work(&uc->pm_work);
--
2.25.1
next reply other threads:[~2022-09-28 13:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-28 13:16 Wayne Chang [this message]
2022-09-28 13:45 ` [PATCH 1/1] usb: typec: ucsi_ccg: Disable UCSI ALT support on Tegra Greg KH
2022-09-28 14:11 ` Wayne Chang
2022-09-28 14:29 ` Greg KH
2022-09-28 14:45 ` Wayne Chang
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=20220928131615.3286936-1-waynec@nvidia.com \
--to=waynec@nvidia.com \
--cc=Sanket.Goswami@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=singhanc@nvidia.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