Skip to content

Commit d58a767

Browse files
pakatiyargregkh
authored andcommitted
usb: typec: ucsi: UCSI2.0 Get Error Status data structure changes
Add support for UCSI 2.0 Get Error Status data structure changes to add more error codes to the data structure. Reviewed-by: Heikki Krogerus <[email protected]> Signed-off-by: Pooja Katiyar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 22d96a2 commit d58a767

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/usb/typec/ucsi/ucsi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ static int ucsi_read_error(struct ucsi *ucsi)
117117
case UCSI_ERROR_SWAP_REJECTED:
118118
dev_warn(ucsi->dev, "Swap rejected\n");
119119
break;
120+
case UCSI_ERROR_REVERSE_CURRENT_PROTECTION:
121+
dev_warn(ucsi->dev, "Reverse Current Protection detected\n");
122+
break;
123+
case UCSI_ERROR_SET_SINK_PATH_REJECTED:
124+
dev_warn(ucsi->dev, "Set Sink Path rejected\n");
125+
break;
120126
case UCSI_ERROR_UNDEFINED:
121127
default:
122128
dev_err(ucsi->dev, "unknown error %u\n", error);

drivers/usb/typec/ucsi/ucsi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num);
198198
#define UCSI_ERROR_HARD_RESET BIT(10)
199199
#define UCSI_ERROR_PPM_POLICY_CONFLICT BIT(11)
200200
#define UCSI_ERROR_SWAP_REJECTED BIT(12)
201+
#define UCSI_ERROR_REVERSE_CURRENT_PROTECTION BIT(13)
202+
#define UCSI_ERROR_SET_SINK_PATH_REJECTED BIT(14)
201203

202204
#define UCSI_SET_NEW_CAM_ENTER(x) (((x) >> 23) & 0x1)
203205
#define UCSI_SET_NEW_CAM_GET_AM(x) (((x) >> 24) & 0xff)

0 commit comments

Comments
 (0)