Skip to content

Commit

Permalink
usb: typec: ucsi: ccg: return EOPNOTSUPP on alt cmd
Browse files Browse the repository at this point in the history
Xaviers do not support UCSI_GET_CAM_SUPPORTED in
current firmware implementation.
usci driver will send UCSI_GET_CAM_SUPPORTED cmd
, discard the result when connector changed and
result in a 5 secs delay.

The change return EOPNOTSUPP on Xaviers when getting
UCSI_GET_CAM_SUPPORTED cmd.

Bug 3662706
Bug 3977671

Change-Id: Ie3579aa022733735108ba2e56c699898ebe79d94
Signed-off-by: Wayne Chang <[email protected]>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2741886
(cherry picked from commit 0b2471b9e2878d747d8d78707001f234b5a42ffc)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2857103
Reviewed-by: Sing-Han Chen <[email protected]>
Reviewed-by: Haotien Hsu <[email protected]>
Reviewed-by: WK Tsai <[email protected]>
GVS: Gerrit_Virtual_Submit <[email protected]>
  • Loading branch information
Wayne Chang authored and mobile promotions committed Feb 15, 2023
1 parent 520851d commit 0cc8306
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/usb/typec/ucsi/ucsi_ccg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* UCSI driver for Cypress CCGx Type-C controller
*
* Copyright (C) 2017-2022 NVIDIA Corporation. All rights reserved.
* Copyright (C) 2017-2023 NVIDIA Corporation. All rights reserved.
* Author: Ajay Gupta <[email protected]>
*
* Some code borrowed from drivers/usb/typec/ucsi/ucsi_acpi.c
Expand Down Expand Up @@ -638,6 +638,11 @@ static int ucsi_ccg_sync_write(struct ucsi *ucsi, unsigned int offset,
int con_index;
int ret;

if (offset == UCSI_CONTROL &&
UCSI_COMMAND(*(u64 *)val) == UCSI_GET_CAM_SUPPORTED &&
uc->fw_build == CCG_FW_BUILD_NVIDIA_XAVIER)
return -EOPNOTSUPP;

mutex_lock(&uc->lock);
pm_runtime_get_sync(uc->dev);
set_bit(DEV_CMD_PENDING, &uc->flags);
Expand Down

0 comments on commit 0cc8306

Please sign in to comment.