summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorPooja Katiyar <pooja.katiyar@intel.com>2024-06-26 11:58:53 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-06-27 16:09:41 +0200
commitd58a7671078a67c46bee4dd56efca073b25f11bb (patch)
tree5e90a4595203aa7c95c98ccf2b03b9fff82a657f /drivers/usb
parent22d96a285449ba78abeaf3e197caca46bc24f8e5 (diff)
downloadlwn-d58a7671078a67c46bee4dd56efca073b25f11bb.tar.gz
lwn-d58a7671078a67c46bee4dd56efca073b25f11bb.zip
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 <heikki.krogerus@linux.intel.com> Signed-off-by: Pooja Katiyar <pooja.katiyar@intel.com> Link: https://lore.kernel.org/r/20240626185853.2956700-1-pooja.katiyar@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/typec/ucsi/ucsi.c6
-rw-r--r--drivers/usb/typec/ucsi/ucsi.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 77e46bf4a098..c80454778d91 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -117,6 +117,12 @@ static int ucsi_read_error(struct ucsi *ucsi)
case UCSI_ERROR_SWAP_REJECTED:
dev_warn(ucsi->dev, "Swap rejected\n");
break;
+ case UCSI_ERROR_REVERSE_CURRENT_PROTECTION:
+ dev_warn(ucsi->dev, "Reverse Current Protection detected\n");
+ break;
+ case UCSI_ERROR_SET_SINK_PATH_REJECTED:
+ dev_warn(ucsi->dev, "Set Sink Path rejected\n");
+ break;
case UCSI_ERROR_UNDEFINED:
default:
dev_err(ucsi->dev, "unknown error %u\n", error);
diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
index 1280cac314fe..47a3a0ca2c15 100644
--- a/drivers/usb/typec/ucsi/ucsi.h
+++ b/drivers/usb/typec/ucsi/ucsi.h
@@ -198,6 +198,8 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num);
#define UCSI_ERROR_HARD_RESET BIT(10)
#define UCSI_ERROR_PPM_POLICY_CONFLICT BIT(11)
#define UCSI_ERROR_SWAP_REJECTED BIT(12)
+#define UCSI_ERROR_REVERSE_CURRENT_PROTECTION BIT(13)
+#define UCSI_ERROR_SET_SINK_PATH_REJECTED BIT(14)
#define UCSI_SET_NEW_CAM_ENTER(x) (((x) >> 23) & 0x1)
#define UCSI_SET_NEW_CAM_GET_AM(x) (((x) >> 24) & 0xff)