提交 691f43cb 编写于 作者: S Sing-Han Chen 提交者: Greg Kroah-Hartman

usb: typec: ucsi_ccg: Disable UCSI ALT support on Tegra

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: NSing-Han Chen <singhanc@nvidia.com>
Signed-off-by: NWayne Chang <waynec@nvidia.com>
Link: https://lore.kernel.org/r/20220928150840.3804313-1-waynec@nvidia.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c9180362
...@@ -125,6 +125,11 @@ struct version_format { ...@@ -125,6 +125,11 @@ struct version_format {
#define CCG_FW_BUILD_NVIDIA (('n' << 8) | 'v') #define CCG_FW_BUILD_NVIDIA (('n' << 8) | 'v')
#define CCG_OLD_FW_VERSION (CCG_VERSION(0x31) | CCG_VERSION_PATCH(10)) #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) */ /* Altmode offset for NVIDIA Function Test Board (FTB) */
#define NVIDIA_FTB_DP_OFFSET (2) #define NVIDIA_FTB_DP_OFFSET (2)
#define NVIDIA_FTB_DBG_OFFSET (3) #define NVIDIA_FTB_DBG_OFFSET (3)
...@@ -513,6 +518,7 @@ static int ucsi_ccg_read(struct ucsi *ucsi, unsigned int offset, ...@@ -513,6 +518,7 @@ static int ucsi_ccg_read(struct ucsi *ucsi, unsigned int offset,
{ {
struct ucsi_ccg *uc = ucsi_get_drvdata(ucsi); struct ucsi_ccg *uc = ucsi_get_drvdata(ucsi);
u16 reg = CCGX_RAB_UCSI_DATA_BLOCK(offset); u16 reg = CCGX_RAB_UCSI_DATA_BLOCK(offset);
struct ucsi_capability *cap;
struct ucsi_altmode *alt; struct ucsi_altmode *alt;
int ret; int ret;
...@@ -536,6 +542,12 @@ static int ucsi_ccg_read(struct ucsi *ucsi, unsigned int offset, ...@@ -536,6 +542,12 @@ static int ucsi_ccg_read(struct ucsi *ucsi, unsigned int offset,
ucsi_ccg_nvidia_altmode(uc, alt); ucsi_ccg_nvidia_altmode(uc, alt);
} }
break; 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: default:
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册